Visualforce PDF Rendering Considerations and Limitations

It is essential to consider these limitations when designing Visualforce pages that will be rendered to PDF. Always verify the formatting and appearance of the PDF version of your page before putting it into production.

The following are some limitations of the Visualforce PDF rendering service

  1. Limitations of the Visualforce PDF rendering service include the following.
  2. PDF is the only supported rendering service.
  3. The PDF rendering service renders PDF version 1.4 and CSS versions up to 2.1.
  4. Rendering a Visualforce page as a PDF file is intended for pages designed and optimized for print.
  5. A Visualforce page rendered as a PDF file displays either in the browser or is downloaded, depending on the browser’s settings. Specific behavior depends on the browser, version, and user settings, and is outside the control of Visualforce.
  6. The PDF rendering service renders the markup and data on your page, but it might not render formatting contained within the contents of rich text area fields added to the page.
  7. Long lines of text that don’t have break points, such as a space or dash, can’t be wrapped by the PDF rendering service. This scenario most commonly happens with long URLs, registry entries, and so on. When these lines are wider than the page, they increase the width of the page’s content beyond the edge of the PDF page. Content then “flows” off the side of the page and is cut off.
  8. Don’t use standard components that aren’t easily formatted for print, or form elements such as inputs or buttons, or any component that requires JavaScript to be formatted.
  9. PDF rendering doesn’t support JavaScript-rendered content.
  10. PDF rendering isn’t supported for pages in the Salesforce mobile app.
  11. The font used on the page must be available on the Visualforce PDF rendering service. Web fonts aren’t supported.
  12. If you use inline CSS styles, set the API version to 28.0 or later. Also set <apex:page applyBodyTag="false">, and add static, valid <head> and <body> tags to your page, as in the previous example.
  13. The maximum response size when creating a PDF file must be less than 15 MB before being rendered as a PDF file. This limit is the standard limit for all Visualforce requests.
  14. The maximum file size for a generated PDF file is 60 MB.
  15. The maximum total size of all images included in a generated PDF is 30 MB.
  16. PDF rendering doesn’t support images encoded in the data: URI scheme format.
  17. PDF rendering doesn’t support WebP images or SVG markup.
  18. The following components don’t support double-byte fonts when rendered as PDF.<apex:pageBlock> <apex:sectionHeader> These components aren’t recommended for use in pages rendered as PDF.
  19. If an <apex:dataTable> or <apex:pageBlockTable> has no <apex:column> components that are rendered, rendering the page as PDF fails. To work around this issue, set the table component’s rendered attribute to false if none of its child <apex:column> components are rendered.


Comments

Popular posts from this blog

Introduction to Salesforce Agent Script: Build Predictable AI Agents

Anti-Patterns in Salesforce Agentforce: What to Avoid When Building AI Agents

MCP vs. Traditional APIs: Choosing the Right Integration Approach