function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OzymandiasOzymandias 

Images are broken when rendered as PDF even after adding Remote Site

My company stores a bunch of consultant records in Salesforce (think of them as the products that we "sell"), and I'm trying to generate a visualforce page that shows their image along with the other details. The consultant headshots are stored outside Salesforce but I'm able to create an image field and display them in the browser with no problem. When it comes to rendering the page as pdf though, the images come out broken.

 

I've already added the server that houses the images in the Remote Site Settings, but still no success. I'm wondering if it's because the site i'm connecting to is an https site, or should it still work regardless of that? Another thing is that the image URLs we're using have a blank character (e.g. https://foo.bar.com/HR/Image%20Library/foobar.jpg). Would that have any effect?

 

Here's a snippet of my vf page in case any of you can point out what I'm doing wrong:

 

 

<apex:page controller="myController" renderAs="pdf">	
...
...
<apex:pageBlock >
<apex:pageBlockTable value="{!consultants}" var="cons">
<apex:column headerValue="Image">
<apex:image value="{!cons.Image_URL__c}"/>
</apex:column>
<apex:column value="{!cons.Name}"/>
...
...
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 

 

aballardaballard

You may need to open a support case on this... if the server is in youtr Remote Sites it should work ok.