Seem that when I try to use printJS on chrome it print a blank page with nothing inside.
This affect in all format PDF, Image and also the demo on website too.
Note: On safari is work properly.
Hey @jukbot , I just updated Chrome to v62.x and everything works just fine.
What is your OS version?
I'm using macOS Sierra 10.12.6
Here is my screenshot of your demo.

besides, maybe it's from my browser. LoL
Strange. I have the Sierra 10.12, which works fine.
The issue may be related to the 10.12.6 version.
I'll update my system whenever I have a chance, test it again and post the result here.
I updated my system to v10.12.6.
So far, I have no problem printing from Chrome (v62.0.3202.89).
Not sure what could be causing this issue for you. Have you tried printing the whole page without the library, and checked if the preview is not blank?
@jukbot Do you have any updates on this? I can't replicate the issue.
I'll close this for now. I believe the issue you are having is not directly related to the library. If you have more information please post here. Thx
I am currently having this same issue with Chrome 64.0.3282.167 on Windows 7 64-bit.
When either using the library directly in a web application or interacting with the demos on printjs.crabbly.com, Chrome is simply printing a single blank page in all cases.
This issue does not appear when testing the same apps/demos with either Firefox 58.0.2 or Electron.
@r-pluss When you say "all cases", are you getting the same blank page when printing HTML, Images and JSON as well?
@crabbly Yes, that's correct, single blank page for each of the HTML, image, json, and PDF demos on the website.
Also was able to reproduce the issue with Chrome Canary 66.0.3353.0, for whatever it's worth.
Got it. I'm using Chrome v64.0.3282.186 on a Mac and everything works fine. I'll test it in Windows whenever I have a chance.
latest version of chrome 65.0.3325.146, same issue
I am getting the blank print preview screen on Chrome 67.0.3396.62, Windows 10 Pro when I try to print an image being served up from an amazon ec2 instance and the image has a naturalWidth. Adding a timeout in the else block of print.js loadIframeImages fixes this for my specific case. Maybe this is something worth considering adding to the library?
Hey @klhiggins , thank you for the info.
Adding a timeout here isn't a good generic solution since image sizes will be different for each use case.
It looks like the "image loaded" hook isn't working when using Chrome in Windows.
Maybe we can change how the library preload the images where we don't rely on the image "loaded state".
I will play around with this and post an update here once I push something up.
The latest version in npm fixed a bug found when handling images preload.
If you were having issues when printing images, please run npm update print-js to get the latest package. Thx.