|
-
Jul 24th, 2007, 03:48 AM
#1
Thread Starter
New Member
[2.0] I need help on PDF Files ... tnx
1. How would i know if the type of file is a PDF file?
2. To determine the number of pages of a PDF File.
* please use c#
Thanks in advance ...
-
Jul 24th, 2007, 04:01 AM
#2
PowerPoster
Re: [2.0] I need help on PDF Files ... tnx
Welcome to the forum.
Can't we use FileStream method for that. I said that based on Java, not at best in C#. Hope it will work.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
Jul 24th, 2007, 04:11 AM
#3
PowerPoster
Re: [2.0] I need help on PDF Files ... tnx
There is a PDFParser class as well. May be it will help you. I found it on MSDN.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
Jul 25th, 2007, 05:17 AM
#4
Thread Starter
New Member
Re: [2.0] I need help on PDF Files ... tnx
-
Jul 25th, 2007, 12:44 PM
#5
Addicted Member
Re: [2.0] I need help on PDF Files ... tnx
The first four charaters of a valid pdf file will should be:
-
Jul 26th, 2007, 12:52 AM
#6
Registered User
Re: [2.0] I need help on PDF Files ... tnx
Code:
using Acrobat;
using AFORMAUTLib;
private void DisplayPDFPageNumber(string FilePath)
{
AcroPDDocClass objPages = new AcroPDDocClass();
objPages.Open(FilePath);
long TotalPDFPages = objPages.GetNumPages();
objPages.Close();
AcroAVDocClass avDoc = new AcroAVDocClass();
avDoc.Open(FilePath, "Title");
IAFormApp formApp = new AFormAppClass();
IFields myFields = (IFields)formApp.Fields;
firstPageNumber = myFields.ExecuteThisJavascript("event.value=this.getPageLabel(0);");
long lst = TotalPDFPages - 1;
lastPageNumber = myFields.ExecuteThisJavascript("event.value=this.getPageLabel('" + lst + "');");
avDoc.Close(0);
}
This code is used to get the pdf page number.
You can get the first page number and the last page number.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|