Some test text!
Welcome to PDFTron. This guide will help you integrate a free trial of WebViewer into Salesforce Lightning Components. It will help you clone the Salesforce sample repository and show you how to integrate WebViewer as a lightning web component. Your free trial includes unlimited trial usage and support from solution engineers.
To fulfill these prerequisites, follow the Salesforce DX Setup Guide.
Download WebViewer and extract it.
Navigate into the extracted folder and run:
npm run optimize
You will encounter the following prompts, which you should answer y/n as indicated:
Do you want us to backup your files before optimizing? [y/n]: y Will you be using the new UI? [y/n]: y Will you be using WebViewer Server? See https://www.pdftron.com/documentation/web/guides/wv-server/ for more info. [y/n]: n Will you be converting all your documents to XOD? See https://www.pdftron.com/documentation/web/guides/optimize-lib-folder for more info. [y/n]: n Do you need client side office viewing support? [y/n]: y Do you need the full PDF API? See https://www.pdftron.com/documentation/web/guides/optimize-lib-folder for more info (most users dont need this option). [y/n]: n Do you need to deploy to Salesforce? See https://www.pdftron.com/documentation/web/guides/optimize-lib-folder for more info (most users dont need this option). [y/n]: y
After answering these prompts, answer y to the final confirmation prompt and the script will optimize and zip the source code you’ll need later to a new
Note that this optimization produces .zip files of no more than 5 mb in size -- small enough for safe upload to the Salesforce platform.
Next clone the
git clone https://github.com/PDFTron/webviewer-salesforce.git
.zip files that were output by the optimizing script in the
webviewer-salesforce folder to the
force-app/main/default/staticresources folder of the cloned project.
Make sure you are in the cloned project directory and authenticate with your hub org and provide it with an alias (DevHub in the command below) from your command line:
sfdx force:auth:web:login --setdefaultdevhubusername --setalias DevHub
Enter your Dev Hub org credentials in the browser that opens. (You can close the browser after you log in successfully).
Create a scratch org using the
config/project-scratch-def.json file, set the username as your default, and assign it an alias:
sfdx force:org:create --setdefaultusername -f config/project-scratch-def.json --setalias my-scratch-org
Push the app to your scratch org:
sfdx force:source:push -f
Make sure you are still in the cloned project. Open the scratch org:
A browser will open where you should click the app launcher icon, and select
You should see the application start up:
Get the answers you need: Support
Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.
Select a platform to get started with your free trial.
Unlimited usage. No email address required.
PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital PartnersLearn more