node-printer icon indicating copy to clipboard operation
node-printer copied to clipboard

Error: StartDocPrinterW error: code: 1804, message: The specified datatype is invalid.

Open prasheel888 opened this issue 3 years ago • 1 comments

i'm printing buffer as Image As a JPEG type here is my code

const Printer = require("@thiagoelg/node-printer"); Printer.printDirect({ data: buffer, type: "JPEG", success: function (jobID) { console.log("sent to printer with ID: " + jobID); },

                error: function (err) {
                  console.log(err);
                },
              });
            }
          });

and i didnt installed vscode,

prasheel888 avatar Mar 16 '22 05:03 prasheel888

Hello! Try checking if the printer you're printing to supports the JPEG datatype. This may be configured on the printer, but you might get more info by running "get-printer | format-list" in powershell.

Also, are you printing to Microsoft's "Print to PDF"? This throws the same error for me, even though it supports the datatype I'm sending to it.

maxvinten avatar May 19 '23 04:05 maxvinten