# PDF Viewer: Access Scroll Bars

**URL:** <https://forum.inductiveautomation.com/t/pdf-viewer-access-scroll-bars/36911>\
**Category:** Ignition\
**Created:** [July 21, 2020, 5:48pm UTC](https://forum.inductiveautomation.com/t/pdf-viewer-access-scroll-bars/36911 "2020-07-21T17:48:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 21, 2020, 5:48pm UTC](https://forum.inductiveautomation.com/t/pdf-viewer-access-scroll-bars/36911/1 "2020-07-21T17:48:28Z")

</div>

I’m having trouble getting access to the scroll bars on the pdf viewer component, java noob here. I was able to control the rotation and zoom mode with the swingController ,`target.getController()`, but I don’t see anything with the scroll bars. Will those be apart of JScrollPane or something else?

**Update** I was able to get to the value of the scroll bar with

```auto
target = event.source.parent.getComponent('PDF Viewer')
swingController = target.getController()
viewController = swingController.getDocumentViewController()
hScroll = viewController.getHorizontalScrollBar()
print hScroll.getValue()

```

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [July 21, 2020, 6:05pm UTC](https://forum.inductiveautomation.com/t/pdf-viewer-access-scroll-bars/36911/2 "2020-07-21T18:05:58Z")

</div>

Wow, impressed myself a little bit 🙂 I figured it out.

```auto
target = event.source.parent.getComponent('PDF Viewer')
swingController = target.getController()
viewController = swingController.getDocumentViewController()
hScroll = viewController.getHorizontalScrollBar()
rightJustify = hScroll.getMaximum()
hScroll.setValue(rightJustify)
swingController.updateDocumentView()

```
