marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

My image appears on HTML, but not when the PDF is generated. #630

Open victoramorimm opened 3 years ago

victoramorimm commented 3 years ago

Hi guys, my issue is that i'm passing a path to an image and it works when i run the archive like HTML, but when i run like EJS and the pdf is generated he doesn't "compile" the image, some idea what is occuring?

sunrise828 commented 3 years ago

Please use any hosting image or data:image uri.

victoramorimm commented 3 years ago

@sunrise828 to solve my problem I published my archive on s3, and inside of the html i use the src with the image url.

sunrise828 commented 3 years ago

if it's not working, then plase use data:image url. Like this.

 .card {
        background-image: url("data:image/png;base64,iVBORw ....")
  }
dlamprey commented 2 years ago

In case it helps someone else... I was running into this problem and found that when I used a hosted image with a file extension (.jpg), it worked.