crabbly / Print.js

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

Print PDFs not working (blank) in Firefox #665

Open Scilly-guy opened 1 year ago

Scilly-guy commented 1 year ago

Whether I click a print.js button on my site (on localhost) or on the Print.js Crabbly page, if it is for a PDF I get the correct number of pages but they are blank. Works as expected with images (from Print.js homepage) or in Chrome with PDFs on my site. If I open the PDF in Firefox directly and send to print it works, so this seems limited to Print.js and Firefox. It worked a few weeks ago and I can't think what setting I have changed within the browser since then that may have caused it to stop so wanted to check if others were having the issue.

I am running Firefox 110.0 (64-bit) on Windows 10 Home v22H2 - build 19045.2604

AlinaStanishevskaya commented 1 year ago

I have the same issue. It works fine in Chrome and Edge but doesn't work in Firefox (110.0.1 (64-bit) on Windows 11).

FayP commented 1 year ago

We're also seeing the same issue, two different users on Windows 10, Firefox 110. Can confirm Mac Firefox is working as expected as well as Chrome and Edge.

We're on version 1.6.0, looking at downgrading until this is resolved.

Scilly-guy commented 1 year ago

Thanks, good to know it isn't just me although I was half expecting someone to state an obvious fix.

FayP commented 1 year ago

Looks like there's a fix waiting to be released https://github.com/crabbly/Print.js/commit/dec4b1e09d3fd4b5fab70a68f0bd3773426604e9

LukasKlement commented 1 year ago

Meanwhile, I published an updated version of this library with the latest changes from the master branch to npmjs: https://www.npmjs.com/package/print-js-updated

arical commented 1 year ago

It looks like it's been solved in this PR, but not released. Hoping that someone can get a release out soon 🙏

j2L4e commented 1 year ago

@LukasKlement your release is missing dist files. import printjs from 'print-js-updated/src/index' works though.

if you don't want to use another release, install from git npm i "git+https://github.com/crabbly/Print.js.git#08d002d43a9c383cc26fedbae3c8a6f597666917" and use import printjs from 'print-js/src/index'

LukasKlement commented 1 year ago

@j2L4e my bad, I pushed a new version and tested it. It's working now.

ChrisMeye commented 1 year ago

Seems like the PR is merged into main now but sadly npm didnt get an update...

redtailedhawk23 commented 1 year ago

How can I include this fix in the print.min.js code? I have a PHP site that calls this file, and I'm unfamiliar with how to turn the updated source code into a new print.min.js.

redtailedhawk23 commented 1 year ago

Nevermind, I was able to manually add those few lines with some modifications to print.min.js.

FayP commented 1 year ago

@crabbly any news on when we can expect the fix for this to be released?

rhonibaer commented 1 year ago

@LukasKlement thank you for providing that patch. Hopefully @crabbly will provide an "official" patch for the issue 😄

chewlim commented 1 year ago

Anyone know the release date of the new version with this fix?

cedricfortin commented 1 year ago

I imagine that the PR was missing package.json modification to update the version.

honzahana commented 1 year ago

+1

ezzaffa88 commented 1 year ago

+1

cedx commented 1 year ago

Duplicate of #655 ?

Maddumage commented 1 year ago

any updates on this?

Mudassarali222 commented 1 year ago

I have the same issue. It works fine in Chrome and Edge but doesn't work in Firefox (114.0.1 (64-bit) on Windows 10). anybody can u tell me its firefox issue or print.js

pumano commented 1 year ago

@Mudassarali222 issue in lib, for workaround check https://www.npmjs.com/package/print-js-updated

Mudassarali222 commented 1 year ago

@pumano Thanks, Its working but docs is not properly managed. I changed docs with proper implementation. My partner zsubzwary created a PR for properly manage docs.

danilobreda commented 1 year ago

Resolved using https://www.npmjs.com/package/print-js-updated

zhuzhumu commented 9 months ago

System version win11 Browser version 119 Print PDF white screen problem

Mudassarali222 commented 9 months ago

@zhuzhumu chrome version 119 ?