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
_LSDsl__LSDsl_ 

How to include image from external site in page that render as pdf

It is image (<apex:image> or <img>) in Visualforce page. When I tried render it as pdf, image is corrupted (image doesn't load...). It's bug??

 

How to insert external image in VFP that render as pdf??

Best Answer chosen by Admin (Salesforce Developers) 
dchasmandchasman
We added in support for external images awhile back - 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

All Answers

dchasmandchasman
We added in support for external images awhile back - 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
This was selected as the best answer
IPIP

Thanks a lot for the solution :)

rmahantarmahanta

My requirement is to use google chart in a PDF file. As mentioned above , I have added the remote site within setup for 'https://developers.google.com' . However while accessing the url, the chat is not displaying in the PDF .Its works fine for normail VF page . 

 

here is the code for your ref: tried with both the options mentioned below. 

1. 

<apex:image url="//chart.googleapis.com/chart?chxt=y&chbh=a&chs=300x225&cht=bvg&chco=8ED145,3D7930,FF9900&chds=0,1111,0,2222,0,3333&chd=t:1111|2222|3333&chg=0,20&chtt=Vertical+bar+chart" width="300" height="225" alt="Vertical bar chart" />

 

2. 

<img src="//chart.googleapis.com/chart?chxt=y&chbh=a&chs=300x225&cht=bvg&chco=8ED145,3D7930,FF9900&chds=0,1111,0,2222,0,3333&chd=t:1111|2222|3333&chg=0,20&chtt=Vertical+bar+chart" width="300" height="225" alt="Vertical bar chart" />

 

Any help will much appreciated !