Generating PDFs

Published on February 23, 2026 Lightning PDF Generator



Generating PDFs

This guide shows how to generate a PDF once Lightning PDF Generator is on your page, and what the output looks like for each use case. For full setup instructions — adding the component, setting the file name and button label, and configuring CSS selectors — see the Lightning PDF Generator setup article.


Step 1: Configure the Component

In Lightning App Builder, set the component's File Name, Button Label, and — if you want to capture something other than the visible screen — a CSS selector for the target content. Save the page once configured.


Step 2: Generate the PDF

Open the record page and click the button with your custom label. The PDF downloads automatically using the file name you set.


Example Outputs

The examples below show the same component configured three different ways.


Window snapshot — captures only what's currently visible on screen, without scrolling content below the fold:

PDF output showing a window snapshot of the visible screen

PDF output from a window-snapshot capture.


Full-page capture — includes the entire page, including content that would otherwise require scrolling:

PDF output showing a full-page capture

PDF output from a full-page capture.


CSS-selector extraction — pulls only the specific element or component targeted by the selector, leaving the rest of the page out:

PDF output showing content extracted via a CSS selector

PDF output using a CSS selector to extract a single component.


Additional example PDF output using a CSS selector

A second example of CSS-selector extraction, targeting a different section of the page.


Tips


Knowledge Article Number: KA-00203

View more articles in the knowledge base