Question

I'm trying to export a page in my rails app to a pdf using wkhtmltopdf/wickedpdf (both the latest version, so is rails). However, external images from facebook (obviously with an absolute url) are not displayed : I got the classic empty box with a '?' when pictures are missing. The HTML version is just fine.

I tried with other pictures from other sources, and it worked as expected. Only fb pictures are causing troubles. However I absolutely need those.

Any ideas? Thanks for your time!

Was it helpful?

Solution 2

Ok so it looks like I was using a bad version of wkhtmltopdf. Had to try several before getting to the right, this is the one that did the trick for me.

@Hoang's answer is another possible solution.

OTHER TIPS

You should download the image into the app and use absolute path for image in pdf template, like

"#{RAILS_ROOT}/public/path-to-fb-image}"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top