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
| Component | Best used when | Output |
| Lightning PDF Generator (Aura) | You add the generator inside your own custom Lightning Aura component. | |
| PDF Downloader (LWC) | You want to place a PDF download button directly on a Lightning page in App Builder. | |
| 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.
| Property | Type | Required | What it does and how to set it |
| whatDownload | String | Yes | Controls 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). |
| fileName | String | Yes | The 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. |
| buttonLabel | String | Yes | The text shown on the button users click to start the download, for example Download PDF. Keep it short and action-oriented. |
| componentIndex | Integer | No | Used 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. |
| cssSelector | String | No | Used 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. |
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)
| Name | lightningPDFGeneratorLwc | Label | PDF Downloader(LWC) |
| Namespace Prefix | clpdf | Description | Downloads 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.
| Property | Type | Required | What it does and how to set it |
| whatDownload | String | Yes | Controls 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). |
| fileName | String | Yes | The 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. |
| buttonLabel | String | Yes | The text shown on the button users click to start the download, for example Download PDF. Keep it short and action-oriented. |
| componentIndexes | String | No | Used 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. |
| cssSelector | String | No | Used 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) 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)
| Name | lightningImageGeneratorLwc | Label | Image Downloader(LWC) |
| Namespace Prefix | clpdf | Description | Downloads 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.
| Property | Type | Required | What it does and how to set it |
| whatDownload | String | Yes | Controls 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). |
| fileName | String | Yes | The 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. |
| buttonLabel | String | Yes | The text shown on the button users click to start the download, for example Download Image. Keep it short and action-oriented. |
| componentIndexes | String | No | Used 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. |
| cssSelector | String | No | Used 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) 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.
| ID | Feature | Property it affects | Who Benefits |
| S-31 | Multi-Component PDF Compiler | componentIndexes (and whatDownload) | Administrators and End Users |
| S-30 | Dynamic File Naming via Merge Fields | fileName | Administrators and Service Agents |
| Example fileName value | Result |
| {{ObjectApiName.CaseNumber}}_Summary | File name includes the Case Number |
| {{ObjectApiName.AccountName}}_Snapshot | File 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
| Property | Aura | PDF LWC | Image LWC |
| whatDownload | Required | Required | Required |
| fileName | Required | Required | Required |
| buttonLabel | Required | Required | Required |
| componentIndex / componentIndexes | Optional (componentIndex, Integer) | Optional (componentIndexes, String) | Optional (componentIndexes, String) |
| cssSelector(s) | Optional | Optional (cssSelectors, String) | Optional (cssSelectors, String) |
Knowledge Article Number: KA-00202