Book your 1:1 Demo
  • Industries
    • Healthcare
    • Finance
    • Legal
    • Non-Profit
    • Education
    • Technology
    • E-Commerce
  • Product
    • Build Forms
    • Generate Docs
    • Manage Contracts
    • Sign Agreements
    • Create Portals
    • Collect Feedback
    • Automate Processes
  • Pricing
  • Learn
    • Blog
    • Knowledge Base
    • Titan Academy
    • Webinars
    • Integrations
    • Compliance
  • Connect
    • Customer Success
    • Support
  • Company
    • About Us
    • Contact Us
    • Partners
    • Careers
  • Sign In
MENU
  • Solutions
        • Featured Success Story

          Salesforce Health Cloud:
          Patient Intake Forms
        • By Product

          • Build Forms
          • Create Portals
          • Generate Docs
          • Sign Agreements
          • Collect Feedback
          • Streamline Files
          • Manage Contracts
          • Automate Processes
        • By Industry

          • Healthcare
          • Finance
          • Nonprofit
          • Education
          • Technology
          • eCommerce
          • Insurance
        • All Industries
        • By Use Case

          • Financial Services Portal
          • Event Registration
          • Education Portal
          • Accreditation Processes
          • Patient Intake Forms
          • W-9 Tax Forms
          • Point-and-Click Quotes
  • Pricing
  • Resource Center
        • Healthcare Solutions for Salesforce

          Learn what Titan has to offer for the Healthcare Industry
        • Learn

          Blog

          Discover the latest Titan product and company news

          Titan 101

          Getting started with Titan, Best Practices, and Use Cases!

          Titan Academy

          Sign up for interactive courses to learn Titan

          Webinars

          Watch Titan Previous Webinars

          Support Documentation

          Check out Titan’s latest release notes and product documentation

          Integrations

          Learn all about Titan's Integrations

          Compliance

          Learn all about Titan's Certifications

        • Connect

          Customer Success

          Read all about Customer Success Stories

          Professional Services

          Let Titan experts help you take the project to a new level

          Titan X Lab

          Have a feature request? This is the right place to post and vote for other ideas

  • Company
    • About Us
    • Contact Us
    • Professional Services
    • Titan Partners
    • Careers
  • Sign In

Generate a PDF in Salesforce

5 min read
Nikki
Nikita R.

Media-savvy content creator, with a curiosity for all Salesforce experiences.

Updated: Jan 9th, 2025

Many organizations choose to generate their documents as PDFs in Salesforce so that all their content across teams is standardized and looks professional. Documents that are great candidates for PDFs include quotes, invoices, sales proposals, and even data reports.

Choosing to use Salesforce to generate PDFs will keep all your document data accurate and all your files consistent with regards to appearance, layout, and themes.

PDF Generation
PDF Generation

How to Generate a PDF in Salesforce: 3 Effective Ways

There are many ways to generate a PDF out of Salesforce. The exact method you choose will heavily rely on your Salesforce setup, your integration tools, and your specific use case requirements. To get you started, we found three approaches to explain how to export a PDF from Salesforce.

Visualforce Pages

Salesforce provides a framework called Visualforce that can help you create user interfaces. Take your Visualforce pages to the next level and use the “renderAs” attribute to generate the page as a PDF.

Salesforce Lightning Components

Salesforce lets you use Lightning components and the lightning:container component to generate PDFs in Salesforce Lightning. How it works is that the lightning:container component allows you to write code for rendering PDFs outside of a Lightning component framework. In order to use this approach, you must add an external library that supports generating PDFs.

This approach is more flexible than Visualforce but requires more coding knowledge to implement successfully.

Apex

Your third approach could be to use the Apex programming language to generate PDFs. Many administrators use third-party libraries in their Apex code to assist with generating PDFs. Some useful third-party libraries include PDFBox or Flying Saucer.

Using Apex code to generate PDFs gives your business teams more customization options as they can control the structure and content of a generated PDF.

Customization Options
Customization Options

JavaScript Salesforce PDF Generator for Salesforce

For your convenience we have provided two examples of JavaScript libraries that you can use to generate PDFs from Salesforce.

LibraryDescriptionCode Example
jsPDF LibraryYou can use this popular JavaScript library to create PDF documents dynamically in Salesforce by adding it to your Lightning Component’s static resources. Then, use the basic jsPDF code on the right to generate a PDF within a Salesforce Lightning Component.// Lightning Component Controller

({

generatePDF: function(component, event, helper) {

var pdf = new jsPDF();pdf.text(20, 20, “Hi, let’s generate a Salesforce PDF with jsPDF!’); 

var pdfOutput = pdf.output();var pdfBlob = new Blob([pdfOutput], { type: ‘applictaion/pdf’ });

var pdfURL = URL.createObjectURL(pdfBlob); 

// Use pdfURL to display or download the PDF 

component.set(“v.pdfURL“, pdfURL);
}
})
Visualforce PageYou can generate PDFs in Salesforce on Visualforce pages with the renderAs attribute. This is a simple option, and you don’t need to write any direct JavaScript code to get it to work. Use the basic code provided in the column on the right to get Salesforce to render the content of a Visualforce page as a PDF. When you test your code, notice that the content within the apex:page tag generates a PDF.htmlCopy code<apex:page renderAs=”pdf”>
<h1>Create a PDF from my page!</h1>
<p>My PDF generated from a Visualforce page.</p>
</apex:page>

How to Generate a PDF Link in Salesforce

There are two common ways that you can generate a PDF link in Salesforce. The first method is by using Visualforce pages, and the second is to use Lightning Components. We will discuss both approaches in this article. Let us know which dynamic PDF generator suits your requirements better.

Visualforce Pages to Generate PDF Link

We already discussed how you could use Visualforce to create custom user interfaces and generate PDFs from contents on a page. However, you can also use this framework to generate a PDF and a link to that page. To replicate this example on your side, follow the steps below:

1. Use the following code to generate a PDF. The renderAs attribute will get Salesforce to display the content of your page as a PDF. Keep in mind that the content inside the tag can be replaced with the content you want:

<apex:page renderAs=”pdf”>
<h1>Your PDF Content Goes Here</h1>
<p>This is an example PDF generated using Visualforce.</p>
</apex:page>

2. The next step would be to generate a link to the Visualforce page, which can be implemented with the code below. You can also replace “YourVisualforcePageName“ with the name of your Visualforce page.

<a href=”{!URLFOR($Page.YourVisualforcePageName)}” target=”_blank”>Generate my PDF</a>

Lightning Components to Generate PDF Link

If you are looking for a flexible approach to generating a PDF link, then you want to use Lightning components in Salesforce. Follow the steps below to generate a PDF link using Lightning components:

1. Create a Lightning component that generates a PDF with the code below:

({

generatePDF : function(component, event, helper) {

window.p[er(‘/apex/YourVisualforcePageName’, ‘_blank’);

}

})

2. The “generatePDF“ function will generate your content, and will open the PDF in a new window with the “window.open“ method.
3. Remember to replace “YourVisualforcePageName” with your Visualforce page name.
4. Add the Lightning component to your Lightning app or page.

Export PDF Tool Options for Salesforce

As you can see from our article, to generate a PDF report from Salesforce requires some coding and technical knowledge. If you are looking for a third-party application to assist you with exporting PDFs from Salesforce, then we recommend checking out these Salesforce document generation tools.

Third-party Applications
Third-party Applications

For starters, you can find Titan for dynamic PDF generation on the Salesforce AppExchange. With Titan’s Word Add-in, you can preview and download your interactive documents in a PDF after configuring your templates with data from Salesforce. If you would like to learn more about this topic, read our Word Add-in – Preview PDF article in our support center.

For an objective view, we have also selected four reliable third-party tools that integrate with Salesforce for PDF exports.

Conga Composer

With Conga Composer, teams can automate processes to create and generate PDFs with Salesforce data. Many companies trust Conga Composer to generate PDFs from Salesforce for contracts, quotes, and proposals.

DocuSign

DocuSign is more than just a third-party Salesforce PDF generation tool. When you choose to integrate DocuSign with Salesforce, your employees can add and manage Salesforce e-signatures in PDF documents. Organizations that regularly work with records that need to be signed and shared choose to use DocuSign.

WebMerge

This third-party tool for Salesforce can populate templates with data from your CRM platform so you can generate a PDF for export. Many organizations choose WebMerge to generate invoices, contracts, and reports as PDFs.

Drawloop

Previously known as Nintex Document Generation, Drawloop works well with Salesforce. Your teams can use Drawloop to create PDFs with data pulled from your Salesforce records.

Titan Docs

Titan Docs for Salesforce Document Generation propels deals to success and automates any process using absolutely no code.

With Titan, you can generate a Word document from Salesforce and create PDFs pre-filled with dynamic data from the #1 CRM. Merge and convert files in seconds using any format you choose. We give you complete flexibility.

PDF Creation
PDF Creation

FAQ

Are you looking for more content? Here are a few more questions we pulled from our Titan archives regarding PDFs and Salesforce.

How do I create a PDF using Apex in Salesforce?

First, use the PageReference. getContentAsPDF() Apex method. This method will render your Visualforce page as PDF data. Now, use Apex code to convert your PDF data to a document, such as PDF.

Can Salesforce generate documents?

Yes, Salesforce can generate the documents you have in your CRM platform. Keep in mind that the types of documents you can generate depend on your unique integrations.

Can you upload a PDF to Salesforce?

Yip! Salesforce supports all file types, such as PDF files, PowerPoint presentations, Excel spreadsheets, image files, and more. Use Titan Files to create, modify and organize files in Salesforce.

Create, Generate, and Share Professional Documents

Thank you for reading our article. We hope you found it engaging and were able to follow along with the guides to export a PDF. If you want to create flexible Salesforce documents, look no further than Titan.

Titan is a no-code digital experiences platform with many features to help make the most of your Salesforce account, including document generation. Titan offers static and dynamically generated documents with a simple button click. Let your employees create documents with multiple specific details and records pulled directly from Salesforce. You also get the option to download your attached documents or attach them to records in Salesforce!

Sound interesting?

Contact us today!

  • Twitter
  • Facebook
  • YouTube
  • LinkedIn
Salesforce AppExchange
Titan Website

Disclaimer: The comparisons listed in this article are based on information provided by the companies online and online reviews from users. If you found a mistake, please contact us.

You might be interested in these article too

Salesforce Document Generation for Reports and Dashboards

Salesforce Document Generation for Reports and Dashboards

5 min read
Compliance Documentation Generated with Salesforce

Compliance Documentation Generated with Salesforce

5 min read
Salesforce Document Generation for Letters and Correspondence

Salesforce Document Generation Software for Letters and Correspondence

4 min read

Do you like these Titan solutions for Document Generation?

Discover Salesforce document generation solutions by scheduling a demo with Titan today!

Start Live Chat No Slack account required

Related

  • Salesforce Document Generation for Certificates and Licenses
  • Document Generation for Salesforce Onboarding and Creating Training Materials
  • Salesforce Document Generation for Marketing Collateral Creation
Book your 1:1 Demo
TITAN logo

A powerful, patents pending, zero code platform for Salesforce Forms, Document Generation, Web Applications, Surveys, Flows and more. HIPAA, GDPR, SOC 2 and other compliances are supported as well.

© 2015-2025 Titan | Multiple Patents Pending

Solutions

  • Titan Docs
  • Titan Sign
  • Titan Forms
  • Titan Survey
  • Titan Web
  • Titan Flow

Platform

  • Pricing
  • About Us
  • Terms of Use
  • Compliance
  • Privacy Policy
  • Cookie Policy
  • Accessibility Statement

Support

  • Sign In
  • Contact Us
  • Request Demo
  • Help Center
  • Titan Academy
  • Salesforce AppExchange
  • User Sitemap
  • Privacy policy
  • Terms of conditions
  • black Facebook logo
  • greyscale YoutTube logo