Xportability / css-to-pdf

Convert any HTML page or region to PDF - supports CSS, SVG, embedded XML objects, and more..
http://www.cloudformatter.com/CSS2Pdf
206 stars 78 forks source link

Images not coming in the generated PDF #84

Open MeenalW opened 5 years ago

MeenalW commented 5 years ago

Hi Team,

I want to convert the HTML present on a SharePoint page to PDF for which i am using your plugin. I can see the image on my page but it is not getting loaded in the PDF. I have used embedLocalImages : 'true' as well. The image is stored in a SharePoint Library and I have given the absolute path in the image source.

Can you please help me with this issue?

kbrown01 commented 5 years ago

What is the URL itself? What does it look like on the image tag in the HTML in the browser?

You should inspect the image using Developer’s tools and copy the HTML that is the image and try and past here as code so we can examine what the URL is.

Kevin

From: MeenalW [mailto:notifications@github.com] Sent: Thursday, December 13, 2018 12:39 AM To: Xportability/css-to-pdf css-to-pdf@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Xportability/css-to-pdf] Images not coming in the generated PDF (#84)

Hi Team,

I want to convert the HTML present on a SharePoint page to PDF for which i am using your plugin. I can see the image on my page but it is not getting loaded in the PDF. I have used embedLocalImages : 'true' as well. The image is stored in a SharePoint Library and I have given the absolute path in the image source.

Can you please help me with this issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Xportability/css-to-pdf/issues/84 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAsJo8qVKv2PqpS_huv_NErsr8SB_76fks5u4hIsgaJpZM4ZRKVv . https://github.com/notifications/beacon/AAsJo7qnS7hMlH5RU0ArUjZPDrYeShiJks5u4hIsgaJpZM4ZRKVv.gif

kbrown01 commented 5 years ago

However, that said … the rendering server is never going to find the absolute path of a local image to your server on it’s server.

The @src you must use must be available to the world as the formatting server must reach back through the internet to get the image to include in the PDF.

A local reference such as “c:\foo\bar\myimage.png” will never work unless that exact path and image existed on the formatting server @cloudformatter.

Normally someone would need some proxy or server that could do something like this:

http://www.myserver.com/getimage?myimage.png

So that @cloudformatter can go to that image link and get the image during the format.

Kevin

From: MeenalW [mailto:notifications@github.com] Sent: Thursday, December 13, 2018 12:39 AM To: Xportability/css-to-pdf css-to-pdf@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Xportability/css-to-pdf] Images not coming in the generated PDF (#84)

Hi Team,

I want to convert the HTML present on a SharePoint page to PDF for which i am using your plugin. I can see the image on my page but it is not getting loaded in the PDF. I have used embedLocalImages : 'true' as well. The image is stored in a SharePoint Library and I have given the absolute path in the image source.

Can you please help me with this issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Xportability/css-to-pdf/issues/84 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAsJo8qVKv2PqpS_huv_NErsr8SB_76fks5u4hIsgaJpZM4ZRKVv . https://github.com/notifications/beacon/AAsJo7qnS7hMlH5RU0ArUjZPDrYeShiJks5u4hIsgaJpZM4ZRKVv.gif

mwalcott commented 5 years ago

I am having the same issue. I have tried on my local server and staging servers and everything I run this it gives me "Failed to load resource: Frame load interrupted". If I remove the image there are no issues. Take a look and let me know what you think. Here is the page https://boraamindustries.dev-mustang.com/boraam/misty-folding-chair/. If you scroll down below the huge image you will see a text link for sell sheet. I am at a loss for this. Any help would be greatly appreciated.

kbrown01 commented 5 years ago

I do not see any link to execute and debug on that page. One question would be, are you using https or http in the Javascript for the formatting server and other assets? If you are using http and your images are https, they cannot be loaded.

Salem-Abderaouf commented 2 years ago

@MeenalW I have similair issue I had to convert my image to base64 and its worked !