artiebits/pdf-to-printer

Question about defaultPrinter

augustosnk12 opened this issue ยท 3 comments

Hello everyone!!!

I really appreciate the great work all you did with this lib!

BUT today I'm here to question about something that's is killing me: when I pass the printer to the print function, everything works fine. The problem is when the windows user has set a "default printer". So, when you set the printer, and there is another printer as "default", it will do the print twice. The default printer is also used when no printer is provided to the print function.

So...it should be this way or am I missing something? If so, is there a way to do not use the default windows printer when I already selected one?

Thanks in advance ๐Ÿ˜๐Ÿ˜˜

Hi, sorry for the delay in response!

Do I understand it correct that if you have Microsoft Print to PDF as a default printer, and do something like this

import { print } from "pdf-to-printer";

const options = {
  printer: "Zebra",
};

print("assets/pdf-sample.pdf", options).then(console.log);

then this package will send a file to both Microsoft Print to PDF and Zebra printers?

Could you please show me your code that prints a file?

Thanks @artiebits for the response!!! For some reason I can not reproduce this anymore, both the issues I related...maybe I was the mistake ๐Ÿ˜…

I'll close the issue then.

great to hear it!