Products
Document Generation
Generate any doc from Salesforce in 1 click
Template Editor
Conditional Logic
Batch Processing
Native E-Signature
Dochly Storage
Connect cloud storage to any Salesforce record automatically
Industries
🏥
Healthcare
HIPAA native
🏦
Financial Services
🏛️
Government
💻
Technology
🏭
Manufacturing
View all 9 industries →
Departments
📈
Sales
Close deals faster
⚙️
Business Operations
💬
Customer Service
👥
Human Resources
📍
Field Service
View all 8 departments →
Resources
Blog
Case Studies
About Dochly
Help Centre
Contact Us
Dochly Storage Pricing Start Free Trial
How to Generate PDFs From Salesforce: The Complete Guide (2026)
How to generate PDFs from Salesforce: complete guide to native PDF generation from CRM records
How-To Guide PDF Generation Document Automation Salesforce Native

How to Generate PDFs From Salesforce: The Complete Guide (2026)

Generating a PDF from Salesforce should be one of the fastest things your team does. Your CRM already holds every piece of data that belongs in the document: the client name, the deal value, the product details, the payment terms. Converting that data into a finished, formatted PDF should take seconds.

For most Salesforce teams, it takes far longer — because Salesforce does not include a native PDF generator as a core platform feature. Generating a PDF from Salesforce requires a document generation tool, and choosing the right one determines whether your data stays inside your org or gets sent to an external server every time a document is produced.

This guide covers exactly how to generate PDFs from Salesforce, the methods available, the difference between native and integration-based approaches, and the complete step-by-step process. For a broader overview of document generation in Salesforce, see our guide on how to generate documents in Salesforce step by step.

Does Salesforce have a built-in PDF generator?

Salesforce does not have a built-in PDF generator as a core platform feature. Visualforce pages can be rendered as PDFs and some Salesforce features generate basic PDF outputs, but these are not usable as a general document generation solution for business documents like contracts, invoices, and proposals.

To generate PDFs from Salesforce at the quality and flexibility required for business use, you need a dedicated document generation app installed in your org. These apps are available on the Salesforce AppExchange and range from integration-based tools that process PDFs on external servers to fully native apps built on Apex and Lightning that generate PDFs entirely inside your Salesforce trust boundary.

Native vs integration-based PDF generation from Salesforce

The most important decision when choosing how to generate PDFs from Salesforce is whether the tool processes documents inside your org or routes data to an external server.

Integration-based PDF generation works by extracting data from your Salesforce org via API, sending it to the tool’s own cloud server, generating the PDF there, and returning it to Salesforce. Every time a user generates a PDF, your CRM data leaves your Salesforce security boundary. For teams in regulated industries, this creates compliance exposure. For all teams, it creates an integration dependency that breaks every time Salesforce releases a major update.

Native PDF generation runs entirely inside your Salesforce org using Apex. The data never leaves the platform. The PDF is generated inside your org and stored as a Salesforce File attached to the originating record. Field-level security applies automatically because the generation process runs as the triggering Salesforce user, with full respect for your sharing rules and permission sets.

Salesforce PDF generation: native vs integration-based approach — architectural comparison of data flow

Native PDF generation processes documents inside your Salesforce trust boundary. Integration-based tools route your data through an external server on every generation event.

FactorIntegration-basedNative (Dochly)
Where PDF is generatedExternal cloud serverInside your Salesforce org
Data leaves SalesforceYes — on every generationNever
Field-level securityRequires separate configAutomatic — uses Salesforce model
Breaks on SF releasesAPI maintenance requiredNative managed package
DPA / compliance overheadRequiredNot required
Audit trail in SalesforceExternal records onlyFull trail inside your org

Read more: What Is Salesforce Document Generation? The Complete Guide (2026)

How to generate a PDF from a Salesforce record: step by step

Generating a PDF from a Salesforce record follows six steps: install a document generation app, build a PDF template, connect it to a Salesforce object, add a generation button, generate and verify the PDF, then distribute or send for signature. Most teams complete their first working PDF generation within a few hours of setup.

1

Install a document generation app from the AppExchange

Search the Salesforce AppExchange for a document generation app that supports native PDF generation. Install it into your Salesforce org and complete the post-installation configuration steps. For a native tool like Dochly, the setup process takes under 30 minutes for a standard implementation.

2

Build a PDF template

Create a template that defines the layout and content of the PDF. Insert merge fields wherever Salesforce data should appear: account name, contact details, product line items, pricing, dates, and any custom fields specific to your business. For documents with variable-length sections like invoice line items, add a repeat block to generate one row per child record.

3

Connect the template to a Salesforce object

In the template settings, specify which Salesforce object the template generates PDFs from. Set the output format to PDF, configure the file naming convention using merge fields, and set the storage destination to attach the generated PDF to the originating record automatically.

4

Add a PDF generation button to the record page

Add a custom button or action to the Salesforce page layout for the relevant object. Configure the button to call the document generation action with the correct template. When a user clicks the button on a record, the tool generates a PDF from that record’s data using the connected template.

5

Generate and verify the PDF

Open a Salesforce record and click the generation button. The tool reads the record’s field values, merges them into the template, generates the PDF, and attaches it to the record in the Files related list. Open the generated PDF and verify that every merge field resolved correctly and the formatting matches the template.

6

Distribute or send for signature

Once the PDF is attached to the Salesforce record, it can be emailed directly from the record, shared via link, downloaded, or sent for e-signature. If your document generation tool includes native e-signature, the signing workflow can be initiated directly from the generation step without any separate login or platform switch.

Generate PDF from Salesforce record: the generation button on the page layout and the resulting PDF attached to the record

After clicking the generation button, the finished PDF attaches automatically to the Salesforce record’s Files related list — named correctly, no manual upload required.

Generating PDFs automatically from Salesforce Flows

Manual PDF generation works well for individual records. For recurring, high-volume PDF creation, automation through Salesforce Flow eliminates manual triggers entirely.

A record-triggered Flow fires when a specific condition is met on a Salesforce record: an Opportunity moved to Closed Won, a contract record approved, an invoice record created, a case marked resolved. The Flow calls the document generation action as one of its steps, passing the template ID and the record ID. The PDF generates, attaches to the record, and the Flow continues with the next steps — emailing the PDF to the client, sending a notification, or triggering a signing workflow.

For recurring batch PDF generation — monthly invoice runs, quarterly renewal notices, annual compliance letters — a scheduled Flow fires at a set time. It queries the relevant records, loops through each one, and triggers PDF generation for the entire batch. The PDFs generate asynchronously so the Flow does not time out on large batches.

Salesforce PDF automatic generation from Flow: record-triggered and scheduled Flows generating PDFs without manual action

A record-triggered Flow generates a PDF automatically when an Opportunity moves to Closed Won — no user action required.

A scheduled Flow set to run on the first of each month can generate all monthly invoices, attach them to the correct records, and trigger delivery to recipients before anyone on the team has started their day.

Generating PDFs in bulk from a Salesforce list view

Bulk PDF generation from a list view is the manual version of batch generation. Select multiple records from a list view, click the bulk generation button, choose the template, and confirm. The tool generates a separate PDF for each selected record using that record’s live Salesforce data, and attaches each PDF to the correct record automatically.

A batch of 200 invoices that would take hours to produce one at a time typically completes in a few minutes of background processing. Bulk list view generation does not require any admin configuration beyond the initial template setup. Any user with the generate documents permission can run a bulk generation job from any list view the template is associated with.

For a detailed look at how bulk generation works and the time it saves at scale, see our guide on bulk document generation in Salesforce.

PDF quality and formatting considerations

The quality of the generated PDF depends on both the template quality and the generation method.

Formatting fidelity. Native tools that generate PDFs inside Salesforce using Apex-based rendering produce more consistent formatting than integration-based tools that rely on external conversion services. Complex layouts with headers, footers, multi-column sections, and precise image positioning render more accurately with native generation.

Font embedding. When building Word-based templates, use fonts that are standard or widely available. Unusual fonts that are not embedded in the PDF may render incorrectly on the recipient’s device. System fonts like Calibri, Arial, and Times New Roman are safe choices.

Image resolution. Logos and images in PDF templates should be high resolution but optimised in file size. A 300 DPI PNG or vector SVG produces a sharp logo. A low-resolution JPEG produces a blurry one. Large unoptimised images slow PDF generation and produce oversized output files.

Test on multiple devices. Always open generated PDFs on at least two different devices or PDF readers before deploying a template to production. Formatting that looks correct in one reader may render differently in another, particularly for complex multi-column layouts or embedded fonts.

Storing generated PDFs in Salesforce

With a native document generation tool, generated PDFs are stored as Salesforce Files on the record they were generated from. Every PDF is accessible from the Files related list on the record, searchable in Salesforce, and subject to your existing record access and sharing settings.

No manual file management is required. The PDF does not need to be downloaded, renamed, and re-uploaded. It is already in Salesforce, already named correctly using the naming convention configured in the template, and already associated with the correct record.

For teams that also need PDFs stored in external systems — Google Drive, OneDrive, Dropbox, or SharePoint — native document generation tools with a storage connector can push generated PDFs to those locations simultaneously while keeping a copy in Salesforce. Dochly Storage supports Google Drive, OneDrive, and Dropbox connectors that sync generated documents automatically without any manual export step.

Frequently asked questions about generating PDFs from Salesforce

Can Salesforce generate a PDF automatically without a user clicking a button?
Yes. When a native document generation tool is connected to a Salesforce Flow, PDFs can be generated automatically based on any record event without any user action. A PDF can be generated when an Opportunity moves to Closed Won, when a contract is approved, when an invoice record is created, or at a scheduled time each month for recurring documents.
Does generating a PDF from Salesforce send data outside the org?
It depends on the tool. Integration-based document generation tools extract data from Salesforce via API, send it to an external server, generate the PDF there, and return it. Your Salesforce data leaves the org on every PDF generation event. Native tools like Dochly process PDF generation entirely inside Salesforce using Apex. Your data never leaves the org.
How do I attach a generated PDF to a Salesforce record?
With a native document generation tool, generated PDFs are attached to the originating record automatically as Salesforce Files. No manual step is required. The document appears in the Files related list on the record the moment generation completes. With integration-based tools, check the storage settings in your template configuration to confirm where generated PDFs are saved.
Can I generate PDFs from Salesforce in bulk?
Yes. Document generation tools that support bulk processing allow you to select multiple records from a Salesforce list view and generate a separate PDF for each record simultaneously. Each PDF is populated from its own record’s data and attached to that record automatically. The batch processes asynchronously so it does not lock the browser or time out on large runs.
How long does it take to generate a PDF from a Salesforce record?
With a native tool, a single PDF typically generates in two to five seconds from the moment the user triggers generation. Bulk generation of a 200-record batch typically completes in a few minutes of background processing. Integration-based tools may take longer because the data has to travel to an external server and back. Generation speed also depends on template complexity and the number of related records being included.

Generating PDFs from Salesforce is straightforward once the right tool is in place. The architecture of that tool — whether it processes PDFs natively inside Salesforce or routes data through an external server — determines your compliance posture, maintenance overhead, and long-term cost.

For the full document generation picture, see our guide on how to generate documents in Salesforce step by step, or visit Dochly document generation to see what native PDF generation looks like inside a fully native Salesforce app.

Umer Balaj
11x Salesforce Certified Developer and Architect
Umer Balaj is an 11x Salesforce Certified Developer and Architect with 11,000+ hours of Salesforce delivery on Upwork (Top Rated Plus, 100% Job Success). He built Dochly as a 100% native Salesforce document generation and e-signature app. Umer specialises in Apex, LWC, Flows, and complex integrations across Health Cloud, Financial Services Cloud, Sales Cloud, and Service Cloud.