Hi everyone,
Is there a way in Ignition perspective to print an entire screen in the browser with a button?
Hi everyone,
Is there a way in Ignition perspective to print an entire screen in the browser with a button?
Came across a topic related to this a little while ago that mentions a new component function they added in a Nightly Change some time ago.
Never used it before personally, but give it a whirl and let us know how it goes. Note that is is only functional within web browsers not mobile.
forgive the dumb question here but how would I use this?
You'd put it on a button's list of actions to perform. Note that it cannot print outside the browser, or other tabs. And the user will have to confirm the request, choosing where to print. Anything more automated than that is considered malware in browsers.
Do I need to update my Ignition gateway for this or do I just have to write something in?
That changelog is for v8.1.28. If your Ignition version is older, you will need to upgrade.
Ok I am on 8.1.35 so I should be fine there. So do I just write requestPrint() on the button? or do I need to add anything else to my gateway
self.requestPrint(target='page',documentTitle='MyPDF')
This line of code should be sufficient in the onActionPerformed
event for a button.
target
will give you some options for the scope of what you're printing (see the changelog for the options). documentTitle
will give the document a default name for the user.
Oh ok that makes more sense. And sorry but where in the changelog do I find the options?
Changelogs are just a summary of what is new. Look in the user manual.
Ok yes sorry didnt realize that.
I went through it and basically I just want to print everything that is on that page I tried:
self.requestPrint(target='view',documentTitle='MyPage')
But that seemed to only print what is visible on the screen. My page scrolls down and I would like that as well
Did you try target='page'
?
tried that too both just show whats on the page that is it
Mentioned, in the original post I was referencing. There's no way to get around that (unless you zoom way out...).