thiagoelg/node-printer

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

prasheel888 opened this issue · 2 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,

@thiagoelg Facing the exact same issue myself, tried to change type/data, recompiled the .node myself, but it seems that's it's breaking when calling the print_helper func in the lib (which is pretty reasonable considering the error is from node_printer_win.cc:735)

Also tried to switch different node versions, didn't make much of a difference, the error is the same as mentioned above.

Has anyone been able to fix this, or found a workaround?

I'm encountering the exact same problem here, any workaround?