tojocky / node-printer

Native node.js printer
1.54k stars 443 forks source link

Cannot print a PS, a PDF, a PNG or just some kind of customized text option in Windows 7 32bit #206

Open FedeBert opened 6 years ago

FedeBert commented 6 years ago

I work in a Windows 7@32bit environment; my electron app need to print a well-formed ticket (infos about purchases, ...). I can produce PDF, PNGs, customized text formats.

From what I've read, in Windows I can only use the PrintDirect function. With the current function, I cannot reduce font size or use anything "different" than a text field, so the printer starts a new line each time it needs and only reads text.

Moreover, I cannot print directly from the format I wrote, so each time i have to translate those to other formats, such as PS.

Finally, sending the PS content using the PrintDirect function, setting type to RAW, produces a very long ticket filled with a mess of instructions: the PS won't be renderized at all.

So my questions are: 1) Is it possible to customize tickets in Windows? 2) Is it possible, even with a workaround, to print a file with customizable font or small images? 3) Is it possible to print a PS file correctly, without needing to have a PS printer, and so using a sort of interpreter callable at code level?

FlandersBurger commented 6 years ago

I got tired of trying to figure it out with various plugins. what worked for me is using command line to send it to the printer from Node

var execFile = require('child_process').exec;

Command line options