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

Spring 13 PDF engine does not render images when img src is a url

With the Spring 13 updates to the PDF engine, our visualforce PDFs no longer render images correctly.  We reference static resources by their absolute url as follows:



<apex:page renderAs="PDF">
<!-- this is a dummy url to a static resource --> <img src="" /> </apex:page>


(Yes I know we can use the $Resource syntax, but we've had issues with that in managed packages).


The above code results in a PDF that displays the "broken image" graphic.


I can also get it to work by disabling the PDF engine critical update for Spring 13.  This is only temporary, however, as the updated will get automatically applied.


Can the engine be fixed so that we don't have to change all of our code to use static resources?  Thanks.





Best Answer chosen by Admin (Salesforce Developers) 

We've resolved the issue by removing everything in the url except for the path:


<apex:page renderAs="PDF">
  <!-- this is a dummy url to a static resource -->
  <img src="/resource/1268256191000/MyImage" />