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
Sourabh Tayal 14Sourabh Tayal 14 

Display images in <img src="" /> tag dynamically on vf page(using renderas="pdf") using FTP urls.

Hi,

I have to display/show images in <img src="" /> tag dynamically on vf page(using renderas="pdf") using FTP urls but it is not displaying image.
Once i remove renderas="pdf" attribute then it is showing image on vf page.

Any idea how can i display image on pdf file by using FTP server url dynamically?
Please help me regarding this.
 
Sagar PareekSagar Pareek
Hi Sourabh,

FTP server means your images are hosted on another server not on salesforce.com? If yes -

You just need to add the site(s) to your remote site whitelist (same thing you use to specify allowed endpoints for apex code callouts). You can find this under Setup | Security Controls | Remote Site Settings
 
James LoghryJames Loghry
As long as the image is publicly accessible (e.g. I can type the URL into a browser and the browser will display the image), it should work okay with Visualforce.  That being said, hosting images over an FTP connnection is a little odd.  If possible, you should upload them to salesforce and host them as a static resource, for instance.