6

When referencing an external image in a Visualforce PDF rendered image, the image is displaying a broken link. It works perfectly without the renderAs="PDF".

1 Answer 1

14

I just figured this out after 30 minutes of Googling and thought a concise post may help others in future. It was not documented in the SFDC documentation but was on an different post from 2012.

Is it possible to use images in Visualforce generated PDFs which are not static resources?

The issue was that the PDF rendering engine runs under the same security restrictions as Apex. In other words, the external URL must be allowed in the remote site settings to be used by the renderer.

3
  • yes exactly ...
    – Ratan Paul
    May 5, 2016 at 14:07
  • Remote Site Settings totally worked for me since the images are hosted on AWS S3. Thank you for the tip.
    – Tyler
    Jul 13, 2017 at 21:14
  • For me using <image src= didn't work but using <apex:image value= did (with the remote site setting set).
    – Keith C
    Jan 6 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .