# Jump to specific page in pdf viewer

**URL:** <https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423>\
**Category:** Ignition\
**Tags:** perspective, vision\
**Created:** [February 17, 2025, 12:28pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423 "2025-02-17T12:28:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oldrich\_Houzvicka](https://avatars.discourse-cdn.com/v4/letter/o/57b2e6/32.png) [@Oldrich\_Houzvicka](https://forum.inductiveautomation.com/u/Oldrich_Houzvicka)\
**Post date:** [February 17, 2025, 12:28pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423/1 "2025-02-17T12:28:45Z")

</div>

Hello, I can use the PDF Viewer component in vision to open a .pdf file. It is working fine. Just want to ask if there is posibility to jump to specific page when .pdf document is loaded?  
I see there is such posibility in perspective but cannot find it in vision.

Thank you

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 17, 2025, 12:50pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423/2 "2025-02-17T12:50:48Z")

</div>

You can set it via scripting using something like this:

```python
viewer = event.source.parent.getComponent('PDF Viewer')
viewer.getController().showPage(100)

```

---

<div class="post-metadata">

**Author:** ![Oldrich\_Houzvicka](https://avatars.discourse-cdn.com/v4/letter/o/57b2e6/32.png) [@Oldrich\_Houzvicka](https://forum.inductiveautomation.com/u/Oldrich_Houzvicka)\
**Post date:** [February 17, 2025, 2:07pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423/3 "2025-02-17T14:07:01Z")

</div>

works, thank you.

---

<div class="post-metadata">

**Author:** ![petr.sasin](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@petr.sasin](https://forum.inductiveautomation.com/u/petr.sasin)\
**Post date:** [February 27, 2025, 2:38pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423/4 "2025-02-27T14:38:21Z")

</div>

Is it possible to get also actual page number and max page number?  
Is somewhere list of all available methods of Vision PDF Viewer? How do You know that there is getController()? I didn't found it in Ignition documentation.  
Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 27, 2025, 2:46pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423/5 "2025-02-27T14:46:30Z")

</div>

No, sorry, this isn't documented. It's part of the underlying PDF library.

You can introspect things by doing something like e.g.

```python
print dir(viewer.getController())

```

or maybe easier by using one of @pturmel's utility functions.

> [@petr.sasin](#):
>
> it possible to get also actual page number and max page number?

Try `viewer.getController().getCurrentPageNumber()` and `viewer.getController().getPageTree().getNumberOfPages()`.

Unfortunately you just have to dig around for these.

---

<div class="post-metadata">

**Author:** ![petr.sasin](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@petr.sasin](https://forum.inductiveautomation.com/u/petr.sasin)\
**Post date:** [February 27, 2025, 5:15pm UTC](https://forum.inductiveautomation.com/t/jump-to-specific-page-in-pdf-viewer/102423/6 "2025-02-27T17:15:30Z")

</div>

> [@Kevin.Herron](#):
>
> `print dir(viewer.getController())`

`viewer.getController().getCurrentPageNumber()` is returning actual page number, but it is 0 based so first page = 0, second page = 1, ...

`viewer.getController().showPage(100)` is working in the same way. This example will go to page 101. If ther is no page 101 then it is not doing anything.

For total number of pages I have used `viewer.getController().document.numberOfPages`. It returns 1 if document has only 1 page.
