crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

Trying to print on thermal printer #640

Closed rohitatcoffee closed 1 year ago

rohitatcoffee commented 2 years ago

const responseBlob = new Blob([pdfBlob], { type: 'application/pdf' }); const fileURL = URL.createObjectURL(responseBlob); setPreview(false); // printJS(fileURL); printJS({ type: 'pdf', printable: fileURL, });

Trying to print a pdf receipt, but it adds empty spaces on top and bottom.

Screenshot 2022-09-08 at 6 52 40 PM

How I can remove these spaces?

Note: PDF does not have margin on the top and bottom

Screenshot 2022-09-08 at 7 06 00 PM

TingNLP commented 1 year ago

@rohitatcoffee try it https://developer.mozilla.org/en-US/docs/Web/CSS/@page