The PDF Butler Lightning Quick Action Previewer opens a generated document from an action on a Salesforce record. An Aura component supplies the DocConfig and preview settings, and a record-level Quick Action launches it for the current record.
What you’ll need
- PDF Butler and the separate Lightning Previewer component package installed.
- A DocConfig that generates a PDF for the object where you’ll add the action.
- Access to Developer Console, the object’s actions, and its page layouts.
If you need the Lightning Previewer component package, contact support@pdfbutler.com and have your Salesforce administrator install it.
The video covers the Aura component, Quick Action, page layout, and preview settings. It uses Opportunity records; follow the same process for your chosen object.
Step 01: Create an Aura Component for the Quick Action #
1. Open the DocConfig you want the action to run. Confirm that it generates a PDF for the type of record where the action will be used.
2. Copy the DocConfig’s Salesforce record ID from the browser URL.
3. From the Salesforce Setup gear menu, open Developer Console. Select File > New > Lightning Component.

4. Enter a descriptive component name and click Submit.

5. In the opening <aura:component> tag, implement force:lightningQuickActionWithoutHeader and force:hasRecordId.
- force:lightningQuickActionWithoutHeader opens the component as a Quick Action without the standard header.
- force:hasRecordId gives it access to the current record’s ID.

6. Inside the component, add <aura:attribute name=”recordId” type=”String” />.
Salesforce supplies the current record ID when the action opens. Keep the recordId binding rather than entering a fixed record ID.

Step 02: Configure Document Generation and Preview Behavior #
7. Inside the Aura component, add <c:PDFButler_LightningConvert>. Set recordId to {!v.recordId}.

8. Set docConfigId to the DocConfig record ID you copied.

9. Configure the preview and automatic download settings.
- doShowPreviewAfterGenerate=”true” displays the generated document in the Previewer.
- doDownloadAfterGenerate=”true” also downloads the file. Use false if you only want the preview.

10. Set boxHeight to the viewer height in pixels. The sample below uses 500.

11. Set deliveryOverwrite for the file delivery behavior you need.
- FILES saves the generated document to Salesforce Files.
- BASE64 returns it for preview without saving it through this delivery setting.

12. Use the complete markup below for a preview without automatic downloading or saving to Salesforce Files. Replace YOUR_DOCCONFIG_ID with your DocConfig record ID.
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId">
<aura:attribute name="recordId" type="String" />
<c:PDFButler_LightningConvert
recordId="{!v.recordId}"
docConfigId="YOUR_DOCCONFIG_ID"
doShowPreviewAfterGenerate="true"
doDownloadAfterGenerate="false"
boxHeight="500"
deliveryOverwrite="BASE64"
/>
</aura:component>
13. Save the Aura component.
Step 03: Create the Lightning Quick Action #
14. In Salesforce Setup, open Object Manager and select the object where the action will appear.
15. Open Buttons, Links, and Actions, then click New Action.

16. Set Action Type to Lightning Component.

17. In Lightning Component, select the Aura component you created.

18. Set the action’s Height to give the viewer enough room. For example, start with 600px for a component boxHeight of 500.
boxHeight controls the viewer inside the action. The action’s Height controls the surrounding dialog. Adjust both if the preview is cut off or has unnecessary scrollbars.
19. Enter a descriptive Label and check the generated Name.

20. Click Save. On Action Detail, check the selected Lightning Component and Height.

Step 04: Add the Quick Action to the Page Layout #
21. In Object Manager, open your object’s Page Layouts. Select the layout used by the intended users.
22. In the layout editor, select Mobile & Lightning Actions and find your new action.

23. Drag the action into Salesforce Mobile and Lightning Experience Actions.

24. Click Save in the page layout editor.

25. Return to a record that uses the updated layout and refresh the page.
If the action is missing, confirm that the record uses the layout you edited and that the Lightning page’s action configuration displays its layout actions.
Step 05: Test and Adjust the Previewer #
26. Click your new action in the record header or open it from the action menu.

27. Check that the generated PDF opens in the action dialog and contains data from the current record.

28. Review the pages using the preview controls. Check that automatic downloads and Salesforce file storage match your component settings.
29. If needed, adjust the component’s preview or download settings. Save the Aura component and test the action again.