PDF Viewer Page Numbers Accessible?

I need to be able to change the current page number of a PDF in the PDF Viewer component. How can I do this with Ignition or with some Java?

1 Like

To directly go forward a page:

target = event.source.parent.getComponent('PDF Viewer')
swingController = target.getController()
documentController = swingController.getDocumentViewController()
swingController.goToDeltaPage(documentController.getDocumentView().getNextPageIncrement());

To choose a specific page, pass a page index to swingController.showPage(). To get the total number of pages, use swingController.getPageTree().getNumberOfPages(). Full documentation is available here:
http://res.icesoft.org/docs/icepdf/v4_3_2/viewer/javadocs/org/icepdf/ri/common/SwingController.html

4 Likes

You should be able to suffix a page argument, like so:
http://www.pdf995.com/samples/pdf.pdf#page=5