PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
ComPDF Salesforce SDK enables you to open files from your local machine, Salesforce, or an external URL. First of all, ensure that you have deployed the ComPDF Salesforce SDK to your existing project.
Open a file in Salesforce in one of the following ways:
For more information on uploading documents to Salesforce, see the Salesforce documentation.
You can open files using the built-in UI from your local machine, Salesforce or an external URL.
In the top-left corner, open the App Launcher and select ComPDF. 
Click browse to upload local PDF files, or open a file from Salesforce. 
In the top-right corner, click "Edit Page" in the setup menu. 
Select the ComPDF Viewer section and fill in the PDF URL in the default configuration options on the right. 
Click "Save" and "Activation". Exit the editing page.
As a result, ComPDF Viewer will default to opening a document with PDF URL.
Check the Access-Control-Allow-Origin response header from the server that serves the file, and ensure that Salesforce is allowed to load the file.
In the ./force-app/main/default/lwc/compdfViewer/compdfViewer.js file, add the URL of the file to be opened to the PDF URL attribute value.
pdfUrl = 'https://example.com/source.pdf'Deploy the application to the organization again.