How is your experience with the OutSystems Community?
195
Views
8
Comments
How to send file to network printer
Question

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


2021-04-09 11-42-43
assif_tiger
 
MVP

Hi Walter,
Why don't you try this:

https://printjs.crabbly.com/

Hope it helps,

Assif

2016-01-04 19-12-23
Walter Martins

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.

Best Regards,

Walter Martins

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

2016-01-04 19-12-23
Walter Martins

Hi Kilian,

Thanks for your reply.

Oh, no! Bad news! :)

I will then have to find another type of solution.

Thanks.


Best Regards,

Walter Martins

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

UserImage.jpg
John Melks

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.

UserImage.jpg
Jack Smith

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

UserImage.jpg
Jack Smith

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.