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

image in image tag appearing as question mark.! #650

Closed UjjualUSspericorn closed 2 years ago

UjjualUSspericorn commented 2 years ago

It was working fine till few weeks ago .Now the image appears like this. I have checked whether the url is valid.

image

@alexbor

smaculan commented 2 years ago

I have the same issue

IsaevTimur commented 2 years ago

Same problem, but from my Heroku instance. Locally on the dev server it's ok.

Does not solve the issue on my side. localUrlAccess: true

I have remote images from CDN, instead of them I see "?" question marks.

Probably relates more to phantomJS/Node version. Any advice on where to dig it?

Rohitpa7824 commented 2 years ago

I am facing the same issue. My html-pdf package is locked at 2.1.0

Tudodesk commented 2 years ago

I have the same issue does anyone have a resolve for this?

ashishmadeti commented 2 years ago

This might be linked to the recent expiry of letsencrypt root certificate. In our experiments, we found out that using request.get() with node version v6.10.0 was throwing the error certificate has expired but it was working fine with node version v14.17.1. I believe that older version of node might be using some old certificates.

For a quick fix, you can set phantomArgs to --ignore-ssl-errors=yes in the config object passed to create().

bweston92 commented 2 years ago

@ashishmadeti be prepared for a lot of thumbs up 👍

TrumanRu commented 2 years ago

For a quick fix, you can set phantomArgs to --ignore-ssl-errors=yes in the config object passed to create().

@ashishmadeti I really appreciate you for you tip. It helped me in my case.

But update to Node v14.18.0 didn't help me. Only --ignore-ssl-errors=yes saved my day.

Tudodesk commented 2 years ago

@TrumanRu where do we add this can you show some code?

Tudodesk commented 2 years ago

"phantomArgs": [], // array of strings used as phantomjs args e.g. ["--ignore-ssl-errors=yes"]

TrumanRu commented 2 years ago

@TrumanRu where do we add this can you show some code?

htmlPdf.create(html, {
            type: 'png',
            quality: 75,
            zoomFactor: 0.5,
            timeout: 120000,
            phantomArgs: ['--ignore-ssl-errors=yes'],
});
Felwin commented 2 years ago

This might be linked to the recent expiry of letsencrypt root certificate. In our experiments, we found out that using request.get() with node version v6.10.0 was throwing the error certificate has expired but it was working fine with node version v14.17.1. I believe that older version of node might be using some old certificates.

For a quick fix, you can set phantomArgs to --ignore-ssl-errors=yes in the config object passed to create().

Saved our day

UjjualUSspericorn commented 2 years ago

It worked.!

alexjs87 commented 10 months ago

It worked! +1