Skip to content

Save a PDF to Salesforce

Currently, you can save files back to Salesforce if one of the following conditions is satisfied:

  • The file is a PDF that you opened using the built-in user interface (UI) from your local machine or Salesforce.
  • The file is a PDF that you opened programmatically from Salesforce.

First of all, ensure that you have deployed the ComPDF Salesforce SDK to your existing project.

Save a file back to Salesforce in one of the following ways:

For more information on uploading documents to Salesforce, see the Salesforce documentation.

Save a file using the built-in UI

  1. In the top-left corner, open the App Launcher and select ComPDF. ComPDF App

  2. Click browse to upload local PDF files, or open a file from Salesforce. WebViewer

  3. Make changes to the document.

  4. In the top-right corner, click the Save Document icon.

Save a file programmatically

  1. In your text editor, open the ./force-app/main/default/staticresources/compdf_boot/config.js file.

  2. Open a file programmatically or use the UI.loadDocument() method.

  3. After the documentloaded event is loaded. Change the PDF file programmatically using the capabilities of the ComPDF Salesforce SDK. For example, add an annotation.

  4. After making the changes, call the saveDocument() method.