Click to See Complete Forum and Search --> : [2.0] I need help on PDF Files ... tnx
moon524
Jul 24th, 2007, 03:48 AM
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 ...
eranga262154
Jul 24th, 2007, 04:01 AM
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.
eranga262154
Jul 24th, 2007, 04:11 AM
There is a PDFParser class as well. May be it will help you. I found it on MSDN.
moon524
Jul 25th, 2007, 05:17 AM
Thanks
Ken B
Jul 25th, 2007, 12:44 PM
The first four charaters of a valid pdf file will should be:
%PDF-
RaviIntegra
Jul 26th, 2007, 12:52 AM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.