PDF Viewer & Event Handlers

Hello everyone,
I want to retrieve the active PDF page of the PDF Viewer component. I’ve already done this inside a script of a button:

target = event.source.parent.getComponent('PDF Viewer')
swingController = target.getController()
event.source.parent.getComponent('random_label').text = str(swingController.getCurrentPageNumber())

My objective was to get the page number on the event “mouseClick”. However I have the feeling that none of the events are “triggered” within this component.
First I tought I had done something wrong so I just put:

print "mouse clicked :)"

In the event handler “mouseClicked” of the PDF Viewer component. Unfortunately I don’t see anything in the console output even after clicking several times. (I’ve tested other event handlers and none of them seem to work).

PS: I’m on Ignition 7.9.12.

Here is some recent forum activity that may be of use:

ignitionusermanualexport.zip\doc79\pdf-viewer_8227280.html (this assumes you downloaded the manual )
Finally, if you are in a hurry, you may wish to first check out the policies, then send an e-mail or call starting at the following link: https://support.inductiveautomation.com
I hope this helps… it gave me some understanding about the IA Labs PDF Viewer module ( now deprecated ).

Thanks but the topic is not related to my problem. My hyperlinks into PDF are working and I don’t need to create one.
I just want to know why the event handlers doesn’t work with the PDF Viewer component. And how to overcome this?
I know the PDF component is coming from ICEpdf and there’s an action listener in the swingcontroller: http://res.icesoft.org/docs/icepdf/v4_3_2/viewer/javadocs/org/icepdf/ri/common/SwingController.html
So I hope there’s an explanation and solution …

I thought it was a trivial question: Are events like “mouseClick” functional on the PDF Viewer component? :disappointed:


Hope this helps, for the hyperlinks I’ve made they do work on on both the PDF Viewer Component and within adobe acrobat, I’m currently on 7.9.10.

The PDF viewer component is our integration of an “off the shelf” library. Without investigating it too far, it’s likely that we aren’t doing the required shenanigans in Java Swing to allow custom mouse events to fire. That might just be an oversight, but it’s equally possible that it’s not possible to introduce custom mouse event handlers without breaking the actual component. Again - I don’t know for sure, but there’s a decent chance that’s the case. I would recommend getting in contact with support to see if there’s a workaround (maybe overlaying a transparent label, and intercepting mouse events on it?) or so that they can file a bug ticket if this indeed is something we can simply implement.

Thanks a lot that’s the confirmation of my observations.

I already tested to put a transparent control in front of my PDF but it doesn’t work and moreover since I click on the control and not on the PDF Viewer the hyperlink is not triggered.

I’ve already opened a support ticket, they ask me ton install TeamViewer to get a remote access to check my code… It’s not a question of checking my code, because I’ve tested the event with just a print …

Mouse events seem to work if I click on the border of the PDF Viewer component. Could you somehow make use of this in your application?