VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



To get a pdf page number.

by Ravichandran (2 Submissions)
Category: Miscellaneous
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Thu 17th May 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)

To get a pdf page number.

Rate To get a pdf page number.



using Acrobat;
using AFORMAUTLib;

public static DisplayPDFPageNumber(string FilePath)
{
            AcroPDDocClass objPages = new AcroPDDocClass();
            objPages.Open(FilePath);
            int TotalPDFPages = objPages.GetNumPages();
            objPages.Close();

            AcroAVDocClass avDoc = new AcroAVDocClass();
            avDoc.Open(FilePath, "Title");

            IAFormApp formApp = new AFormAppClass();
            IFields myFields = (IFields)formApp.Fields;
            for (int i = 0; i < TotalPDFPages; i++)
            {
                string PageNumber = myFields.ExecuteThisJavascript("event.value=this.getPageLabel(" + i + ");");
                MessageBox.Show("Page " + i + " : " + PageNumber  + "");
            }

}

Download this snippet    Add to My Saved Code

To get a pdf page number. Comments

No comments have been posted about To get a pdf page number.. Why not be the first to post a comment about To get a pdf page number..

Post your comment

Subject:
Message:
0/1000 characters