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
mohammadd ismailmohammadd ismail 

images in visual force generated PDf's

How to use images in Visualforce generated PDFs which are not static resources?Can someone help me on how to achieve this.

 
Best Answer chosen by mohammadd ismail
NagendraNagendra (Salesforce Developers) 
Hi Ismail,

This should be possible: we do this in FinancialForce Accounting via the servlet.fileDownload URL that salesforce provides for downloading documents to include company logos on PDF financial documents.

The trick is that any external URLs you want salesforce to make a HTTP(s) call to need to be defined under Setup > Security Controls > Remote Site Settings. Make sure the protocol (HTTP vs HTTPS) matches the image link!

A followup edit that it appears that the older PDF rendering engine (pre APIv24?) does not pass a session ID when requesting images from salesforce documents. I made the image externally available and it worked - note that this changes the URL from servlet.FileDownload to servlet.ImageServer as well. V25 seems to pass the session ID as expected so far.

Please mark this as solved if it helps.

Best Regards,
Nagendra.P