Hi,
I am using pdf viewer componant and I want to execute my code after PDF get loaded completely. How can I get that PDF is loaded. I cant see any event, there I will get to know PDF loaded or not. Now my code is executing before PDF load.
Any idea?
You’ll have to use some Java methods within Jython in order to do this. Start Here org.icepdf.core.events
You want to probably look at org.icepdf.core.events
, then PageLoadingListener
Okay…But How PageLoadingListener is used in Ignition scripting?
can you please guide?
I started a script to test, but I have little experience in Java. Someone else maybe able to get the script working.
if event.propertyName == 'filePath':
import org.icepdf.core.events.PageLoadingEvent as PageLoadingEvent
import org.icepdf.core.events.PageLoadingListener as PageLoadingListener
ple = PageLoadingEvent(event.source)
target = pageLoadingListener.get()
if target.pageLoadingEnded(ple):
system.gui.messageBox('Loading Complete')
It maybe much simpler to have your code called by invokeLater()
. The script below will execute 1000ms after the filePath of the PDF viewer changes.
if event.propertyName == 'filePath':
def myFunc():
...
system.util.invokeLater(myFunc,1000)
okay… Thank you…
I think it is in vision but I want it in perpsective.
can I try with same way in perspective?
Hi, I have tried this but it is throwing error like 'No icepdf module available '.
I have downloaded this but no idea about How to import external java module in ignition.
Can you please help on this?
I’d say that perspective isn’t using icePDF for the pdf component since perspective is based on html5 and CSS not a Java runtime like Vision. I don’t know much about Perspective, so I can’t really say where to start.
okay.Thanks.