0

I am in need of developing an electron based desktop application which will listen for PDFs and ZPL files from a remote server. The application needs to print the PDFs and the ZPL files to the selected printer. Please note that the PDFs and ZPLs are generated remotely and sent as files, so I cannot use webContents.print() API in electron.

The functionalities would include getting the list of printers along with their statuses and able to send printing data to them. The following are the methods/tools I researched.

I have considered using wmic from the node process to get the printers list along with their states but it seems that admin privileges are needed.

I saw many of Node JS implementations have used the node-printer package but it seems like it is out of maintenance.

I have also looked into using native windows APIs using ffi but couldn't find some easy-to-use guides.

Currently, I have decided to use sumatra PDF for printing PDFs. I'm stuck with printing ZPL files and stuck with getting printers meta data.

Could someone please point me in the right direction.

Thanks for your help in advance.

3
  • Apologies for the confusion, I have updated the question for better clarification. I have decided to use sumatra for PDF printing and I'm not planning to use it for ZPL files. Commented Jul 6, 2023 at 5:58
  • Have you found a solution for printing ZPL files from nodejs? Commented Feb 27, 2024 at 15:32
  • I found a .NET snippet which utilizes windows APIs to send raw prints to printers. I build a command line application with it and was able to call the exe from the electron app. Commented Mar 3, 2024 at 9:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.