Best Practices for Rendering PDF Files

Rendering a Visualforce page as a PDF file is a great way to share information about your Salesforce organization. Here are some best practices for you to consider.

For better performance when rendering Visualforce pages, reference static image and style sheet resources through the $Resource global variable.

Warning

Warning

Referencing static resources on a remote server increases the time it takes to render a Visualforce page as a PDF file. Add remote servers to your permitted Remote Sites list: From Setup, enter Remote Sites Settings in the Quick Find box, then select Remote Sites Settings. You can’t reference remote resources when using Visualforce to render PDF files in an Apex trigger. Doing so results in an exception.

Previous
Next