Advanced Configuration

Published on February 23, 2026 Lightning PDF Generator


Lightning PDF (Image) Generator: How to Configure Each Component

This guide explains how to configure the three components of the Lightning PDF (Image) Generator (v1.9), property by property, so users can download a page, a component or a section of a page as a PDF or an image.

In this guide: (1) Before you start, (2) Aura Component: Lightning PDF Generator, (3) PDF Downloader (LWC), (4) Image Downloader (LWC), (5) Dynamic file naming and multi-component PDFs, (6) Quick reference.

1) Before You Start

ComponentBest used whenOutput
Lightning PDF Generator (Aura)You add the generator inside your own custom Lightning Aura component.PDF
PDF Downloader (LWC)You want to place a PDF download button directly on a Lightning page in App Builder.PDF
Image Downloader (LWC)You want to place an image download button directly on a Lightning page in App Builder.Image
Tip: All three components share the same core properties: whatDownload, fileName and buttonLabel are required, while componentIndex(es) and cssSelector(s) are optional.

2) Lightning PDF Generator (Aura)

Use this component when you want to embed the generator inside your own custom Lightning Aura component.

Step 1: Add the component. Add Light PDF Generator to your custom Lightning Aura component markup or Lightning Record Page.

Step 2: Set the public properties. Configure each property as described below.

PropertyTypeRequiredWhat it does and how to set it
whatDownloadStringYesControls what is captured in the download: the full page, a single component on the page (identified by its index), or the part of the page matched by a CSS selector. Choose the option that matches the content you want in the file, then fill in the matching property below (if needed).
fileNameStringYesThe name given to the downloaded file. Enter plain text (for example, Case_Summary) or, from v1.9, use Salesforce merge fields so each file is named after the record, such as {{ObjectApiName.CaseNumber}}_Summary. If left at the default, every file is named page.pdf.
buttonLabelStringYesThe text shown on the button users click to start the download, for example Download PDF. Keep it short and action-oriented.
componentIndexIntegerNoUsed when you capture a single component by its position on the page. Enter the component number as a whole number. Leave blank for a full-page or CSS selector download.
cssSelectorStringNoUsed when you want to capture one specific area of the page. Enter a CSS selector that matches that area (for example, a class such as .slds-card). Leave blank when downloading the full page or a component by index.
Note: whatDownload, fileName and buttonLabel are required. The component will not work as expected without them.

Aura component properties

Example of the Aura component with public properties configured.

Step 3: Save and test. Save your Aura component, open the page that uses it and click the button. Confirm the downloaded file name and content are what you expect.

3) PDF Downloader (LWC)

NamelightningPDFGeneratorLwcLabelPDF Downloader(LWC)
Namespace PrefixclpdfDescriptionDownloads the page, a component or a CSS selector as a PDF.

Step 1: Open Lightning App Builder. Edit the Lightning record, app or home page where users need the download.

Step 2: Add the component. Drag PDF Downloader(LWC) from the Custom - Managed list onto the page.

Step 3: Set the properties in the properties panel on the right.

PropertyTypeRequiredWhat it does and how to set it
whatDownloadStringYesControls what is captured in the download: the full page, a single component on the page (identified by its index), or the part of the page matched by a CSS selector. Choose the option that matches the content you want in the file, then fill in the matching property below (if needed).
fileNameStringYesThe name given to the downloaded file. Enter plain text (for example, Case_Summary) or, from v1.9, use Salesforce merge fields so each file is named after the record, such as {{ObjectApiName.CaseNumber}}_Summary. If left at the default, every file is named page.pdf.
buttonLabelStringYesThe text shown on the button users click to start the download, for example Download PDF. Keep it short and action-oriented.
componentIndexesStringNoUsed when you capture components by position. Enter the index of the component to capture. In v1.9 you can enter several indexes, separated by commas, to merge those components in order into one PDF (Multi-Component PDF Compiler). Leave blank for a full-page or CSS selector download.
cssSelectorStringNoUsed when you want to capture one(or several) specific areas of the page. Enter CSS selectors separated by comma that matches that area(s) (for example, a class such as .slds-card). Leave blank when downloading the full page or a component by index.
Multi-component tip: To combine several sections (for example Case Details, Activity Feed and Knowledge Snippets) into one PDF, enter multiple values in componentIndexes. The sections are merged in order into a single document without full-page clutter.

PDF Downloader LWC

PDF Downloader (LWC) configured on a Lightning page.

Step 4: Save and activate. Save the page, activate it if prompted, then open a record and click the button to test.

4) Image Downloader (LWC)

NamelightningImageGeneratorLwcLabelImage Downloader(LWC)
Namespace PrefixclpdfDescriptionDownloads the page, a component or a CSS selector as an Image.

Step 1: Open Lightning App Builder and edit the page where users need the image download.

Step 2: Add the component. Drag Image Downloader(LWC) from the Custom - Managed list onto the page.

Step 3: Set the properties in the properties panel.

PropertyTypeRequiredWhat it does and how to set it
whatDownloadStringYesControls what is captured in the download: the full page, a single component on the page (identified by its index), or the part of the page matched by a CSS selector. Choose the option that matches the content you want in the file, then fill in the matching property below (if needed).
fileNameStringYesThe name given to the downloaded file. Enter plain text (for example, Case_Summary) or, from v1.9, use Salesforce merge fields so each file is named after the record, such as {{ObjectApiName.CaseNumber}}_Summary. If left at the default, every file is named page.pdf.
buttonLabelStringYesThe text shown on the button users click to start the download, for example Download Image. Keep it short and action-oriented.
componentIndexesStringNoUsed when you capture components by position. Enter the index of the component (or several indexes separated by commas) to capture. Leave blank for a full-page or CSS selector download.
cssSelectorStringNoUsed when you want to capture one specific area (or several areas) of the page. Enter CSS selectors separated by comma that matches that area (for example, a class such as .slds-card). Leave blank when downloading the full page or a component by index.

Image Downloader LWC

Image Downloader (LWC) configured on a Lightning page.

Step 4: Save and activate, then click the button on a record page to confirm the image downloads correctly.

5) Dynamic File Naming and Multi-Component PDFs (v1.9)

LPG v1.9 was released on 2026-10-18 as a General Availability (GA) release with two features that affect how you set the properties above.

*Please ensure the field is loaded and displayed on screen before clicking Download. If the field is not visible, the Dynamic File Name will not apply, and the file name will default to the fallback name.

IDFeatureProperty it affectsWho Benefits
S-31Multi-Component PDF CompilercomponentIndexes (and whatDownload)Administrators and End Users
S-30Dynamic File Naming via Merge FieldsfileNameAdministrators and Service Agents
Example fileName valueResult
{{ObjectApiName.CaseNumber}}_SummaryFile name includes the Case Number
{{ObjectApiName.AccountName}}_SnapshotFile name includes the Account Name
Benefit: Downloaded files are automatically named with unique record details such as Case Number or Account Name, so no manual renaming is needed. Merge fields work in Lightning App Builder and in custom Aura wrappers (clpdf:CL_LightPDFGenerator).

6) Quick Reference

PropertyAuraPDF LWCImage LWC
whatDownloadRequiredRequiredRequired
fileNameRequiredRequiredRequired
buttonLabelRequiredRequiredRequired
componentIndex / componentIndexesOptional (componentIndex, Integer)Optional (componentIndexes, String)Optional (componentIndexes, String)
cssSelector(s)OptionalOptional (cssSelectors, String)Optional (cssSelectors, String)

Knowledge Article Number: KA-00202

View more articles in the knowledge base