You need to sign in to do that
Don't have an account?

Recommendation for partners regarding images in PDF view of Visualforce page
We are developing/deploying solutions leveraging Visualforce pages. Our pages contain image references to external URL sites. When the page is rendered online, it works as expected. However, when I apply the renderAs="pdf" attribute to our pages, the images appear as broken image links in the pdf. I have read somewhere that we should be using static resources. Granted that does work but it becomes a maintanence nightmare for partners when deploying solutions to many customer orgs. Instead of maintaining the resources on our own server for many customer orgs, we would have to touch each customer org to deploy patches or upgrades.
We would like to receive some advice from Salesforce regarding this approach and discuss if this may even be a bug.
Code sample:
We would like to receive some advice from Salesforce regarding this approach and discuss if this may even be a bug.
Code sample:
Code:
<!-- All of these images render fine without the renderAs="pdf" attribute --> <apex:page renderAs="pdf"> <h1>Congratulations</h1> This is your new Page: ImageTest <p/> <!-- Doesn't render in pdf --> <apex:image style="border:thin solid black" value="http://www.google.com/intl/en_ALL/images/logo.gif"></apex:image> <p/> <!-- Oddly enough renders in pdf --> <apex:image style="border:thin solid black" value="http://www.salesforce.com/common/assets/images/logo_hm_summ_nosoftware.gif"></apex:image> <p/> <!-- Renders in pdf (obviously if you have the resource "vheader" defined for your org --> <apex:image style="border:thin solid black" url="{!$Resource.vheader}"></apex:image> <p/> </apex:page>
I verified (you should be able to create a page with the markup below in your own org and have it render as PDF correctly) that you can leverage our new Sites feature to publish a publicly accessible static resource to work around this limitation. Basically this works because accessing a public static resource does not require leaving the "cloud" as far as the salesforce servers are concerned. Just create a site with anonymous access and host your static resources there. You then access this shared resource like this:
Message Edited by dchasman on 01-02-2009 10:37 AM
We would be interested in a solution that leverages the whitelist for external callouts. For now, it seems we will have to solve this one customer requirement outside of the Visualforce framework.
Message Edited by dchasman on 01-04-2009 03:38 PM