TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pramod Kumar Nandagiri
NA
484
0
To read the page count of a zipped PDF file
Apr 29 2011 7:30 AM
public int GetNoOfPagesPDF(string FileName)
{
FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
StreamReader r = new StreamReader(fs);
string pdfText = r.ReadToEnd();
System.Text.RegularExpressions.Regex regx = new Regex(@"/Type\s*/Page[^s]");
System.Text.RegularExpressions.MatchCollection matches = regx.Matches(pdfText);
result = matches.Count;
return result;
//13086143_1910486.zip
}
Hi with the help of above function we can read the page count of a pdf, because of the regular expression "/Type\s*/Page[^s]" it reads the pdf page count, for a .docx file and text file it won't reads
Please tell me that is it possible to read the page count of a .docx file by changing the regular expression, if possible what is the regex
Also to read the zip file , what is the regex to be used
My requirement is to read the pdf file page count which is zipped with out unzipping it,
Reply
Answers (
1
)
Cross-thread operation not valid: Control 'dateTimePicker1' accessed from a thread other than the thread it was created on.
How we can bind dataset with axml file in vb.net?