Use Advanced PDF to Render Visualforce Pages as PDF Files (Pilot)

Advanced PDF renders Visualforce pages as PDF files with broader support for modern HTML standards, such as CSS3, JavaScript, and HTML5. This change applies to both Lightning Experience and Salesforce Classic.
Note

Note

We provide Advanced PDF to selected customers through a pilot program that requires agreement to specific terms and conditions. To be nominated to participate in the program, contact Salesforce. Pilot programs are subject to change, and we can’t guarantee acceptance. Advanced PDF isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

To use Advanced PDF, set renderAs="advanced_pdf" in the <apex:page> tag of a Visualforce page with API version 40.0 or later. This process is similar to the existing process for rendering a Visualforce page as a standard PDF file.

PDF pages rendered with Advanced PDF are subject to the same limitations as legacy PDF pages, including the maximum page size and limited number of fetched resources. Advanced PDF pages also time out after rendering for 2 minutes, which includes asynchronous processing time.

Preview Your Pages

Because Advanced PDF is built on Chromium, it’s easy to preview your Visualforce pages in Google Chrome. To preview a page, from Chrome, select File | Print.

Preserve Background Colors and Images

Because the rendered PDF is optimized for printed pages, by default it does not preserve background colors and images. To preserve background colors and images, add a line to your page’s CSS.
@media print { body {-webkit-print-color-adjust: exact;} }

Customize the PDF Output

Advanced PDF supports the CSS Paged Media specification. Use these standards to set the paper size, margins, and other attributes. To learn more about CSS Paged Media, see the W3C’s website.