Open cmnstmntmn opened 7 years ago
@kiuKisas nope. i even try with pdfium. not raw or emf stream works.
Try postscript
I print PDF on windows
function printPdf(pdfData) {
let fileId = guid();
let pdfPath = tempPath+'/'+fileId+'.pdf';
fs.writeFileSync(pdfPath,pdfData);
execFile(`${__dirname}/bin/win64/pdftops`, ['-paper','A4',pdfPath], null, function (error, stdout, stderr) {
console.log(error, stdout, stderr);
fs.unlinkSync(pdfPath);
let psData = fs.readFileSync(psPath,'utf8');
fs.unlinkSync(psPath);
printer.printDirect({
data:psData,
printer:printer.getDefaultPrinterName(), // printer name
options:{
},
type: 'RAW',
success:function(jobID){
console.log('jobid',jobID);
},
error:function(err){
console.log('joberr',err);
}
});
});
}
@xioxin can't make it work. nothing goes to the printer.
Install PostScript version driver
@xioxin if i select XPS2GDI
it prints the ps file content, without rendering it.
@xioxin pff, can't install de adobe ps driver on windows 10
as i can see here node_printer_win.cc,
PrintFile
is not yet implemented.as @tojocky suggested on some other issues, there are few links to start:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd145226(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/dd162624(v=vs.85).aspx