External images broken in chrome-pdf
-
Hello, Any idea why I'm getting a 403 when using image URLs? I'm using Cloudinary to host my images. Is it a cloudinary access issue? I'm able to get the images to show if I switch the recipe from chrome-pdf to html-to-browser-client
Playground: https://playground.jsreport.net/w/anon/vVA6ndvZ
Thanks in advance for the help!
-
Cloudinary is likely preventing bots, like chrome, running in headless mode from reaching the image.
Maybe there is some option to make the image fully public.
-
I'm going to see if Cloudinary is preventing access. We have a lot of images that we're using to create a report with, so if they're blocking the tool, we will need to have them allow it for all the images. Thanks for the response!
-
Is there a way to add cloudinary credentials to jsreport's studio? Perhaps that might work
-
How do you actually obtain that image url? https://s3.img-b.com/image/private/t_base,c_lpad,f_auto,dpr_auto,w_55,h_55/product/kohler/kohler-30812-0-new.jpg
I've tried Cloudinary upload/Copy original url and it works fine
https://res.cloudinary.com/dpg67qehx/image/upload/v1722272620/Snímek_obrazovky_2024-07-02_190347_p8ez16.png
-
It's routed through our server. Do you think that server is blocking access to it?
-
Is there a way to set a custom user-agent in JsReport?
-
Is there a way to set a custom user-agent in JsReport?
Currently, no.
It's routed through our server. Do you think that server is blocking access to it?
You can try it without routing and see...
-
have you been able to resolve this? im having the same issue actually. When the output is rendered as html you can see the img but using chrome-pdf it doesn't work
-
as example from running it locally:
this is when im rendering it as html:
it also seems like its not making the call to the server even, it does when i render it as an html though
-
@candy-man try to check the profile tab for the chrome logs..
One of the reasons could be that the image route is authenticated and your browser holds the auth cookie so it works with html, but the background chrome doesn't have the auth cookie so it doesn't load the image.
-
The images we are using are routed through an internal web server. Since JsReport uses headless chrome, the requests from the local server were getting blocked by our company's firewall since they were unidentified. Once we push to production, the images should show up. Check to see if you have a firewall blocking your images requested through a local headless chrome