Hello,
I need implement a solution (Traditional Web or Reactive) that receives information from another system and in this solution create a file and print directly (without downloading the file).
Steps of the global solution:
1) The other system call the print action, then sends the information to the Outsystems solution. 2) The Outsystems solution receives the information and create a file. 3) Finally, the Outsystems solution send the file for network printing.
How to send file to network printer?I tried de forge component "Print PDF file by Network Printer" but it didn't work.
Is there any other solution? I need help with this topic.
Thanks.
Best Regards,
Walter Martins
Hi Walter,Why don't you try this:https://printjs.crabbly.com/Hope it helps,
Assif
Hi assif_tiger,
Thanks for your reply. But I don't think it works for my scenario. The printjs open window.print. The scenario is to send it directly to the printer without opening any more windows or downloading the file.
Hi Walter,
You cannot do this client-side. That is, there's no way to print anything from your browser, not even via JavaScript, without the browser first invoking the print pop-up. That's a security measure, so malicious websites can't print something without your permission. So any solution you need must print via the server. However, since that's likely a cloud server not connected to your internal network (unless you use VPN), which is the likely cause that the "Print PDF file by Network printer" component doesn't work.
So basically you want something that's not technically feasible, unfortunately.
Hi Kilian,
Thanks for your reply.
Oh, no! Bad news! :)
I will then have to find another type of solution.
Yeah, it sucks from a corporate point of view, but from a security point of view it makes sense. What you could try to set-up is indeed something via VPN, or have some non-OutSystems component run on your network with access from the outside world (but secured of course) that can pass print requests to a network printer, but it'll be messy.
I realize this is from a while ago, but the server-side requirement you mentioned got me thinking. Have you considered using a lightweight relay service on a local machine that watches a folder and sends files to the printer via a simple script? That might bypass the browser restrictions without needing a full intermediary setup.
You are right that silent client-side printing won't work
You will need a small server-side service on your internal network, or a VPN, to handle the print job
I ran into the same limitation with network printers from cloud servers. Instead of fighting browser restrictions, I switched to faxing documents through Faxly for secure delivery without print dialogs. It handles PDFs and other formats, sends internationally, and I get delivery receipts.