Quantcast
Channel: Adobe Community : All Content - Acrobat SDK
Viewing all articles
Browse latest Browse all 2571

Page navigation using AxAcroPDFLib.AxAcroPDF

$
0
0

I'm building a WinForms PDF viewer using C# and .NET 4.5. I'm attempting to use AxAcroPDFLib.AxAcroPDF to open and navigate the pdf in an Acrobat COM control in my WinForm. It's working for the most part but I'm having an issue trying to go to specific pages once the PDF is open. When the PDF first opens I set it to page 1 using the SetCurrentPage method of AxAcroPDF. However, when i try to use setCurrentPage to another page in the PDF, it stays on page 1. I know PDF pages are 0 based so I am taking that into account when I specify the page. Is there anything I'm missing?

 

Code:

 

private void viewPDF(string pdf, int page)

        {

            AxAcroPDFLib.AxAcroPDF pdfViewer = axAcroPDF1;

            pdfViewer.LoadFile(pdf);

            pdfViewer.setView("Fit");

            int gotoPage = --page;  // '--' takes into account zero based page numbering.

            pdfViewer.setCurrentPage(gotoPage);

}

 

Thanks in advance for any assistance.


Viewing all articles
Browse latest Browse all 2571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>