Perspective clients are web browser sessions. Browsers donât allow websites to push a print job.
Think of the fun that could be had by the black hats if that were possible.
You could consider having the button run the print job on the gateway and direct it to the local printer. There should be some posts on the forum detailing how to do that.
The function youâre attempting to use, as @bkarabinchak.psi has pointed out, is only available in a âVision Clientâ. You have tagged this topic as perspective, and so we are assuming you are attempting to use this in a Perspective based application.
The function when used in a Vision Client can be used to print a Component.
The script you have provided will not work in a Perspective application. Not only is the system.print.createPrintJop() function not available, but neiter is event.source.parent.
On top of that, but the script as provided has an error, as you are overwriting the variable job with setShowPrintDialog(1) in the second line.
Your users will have to manually request to print a page or a selection from their browserâs menu. You cannot automate thisâit is a browser security violation.
Yes, I understand that now. I was replying to @Transistor since he said that there was a way to print to the gateway.
As of now, is there any way to âprintâ a popup in perspective? Based on what I am seeing, it does not seem possible. If it is not possible, is there a way that I can save a popup, locally, as a PDF?
No, the closest you can get is to run a report via script and push a download of the report's PDF (via system.perspective.download). Your user would have to accept the download, open it, and print it.
I apologize, but maybe I should have been more clear. I have a popup that does not have the report viewer component. In a perfect world, the user would be able to click a button and the popup will print as a PDF and save to their local PC. Basically, doing a âprint screenâ function of just the popup that is opened. Based on what I am finding and what you have said, doing a print command is not possibleâŚ
I looked into the command system.perspective.download like you suggested, and I looked at the example of it, but I am not sure how/where I would call the popup to be downloaded in the script?