Bringing Best-in-class PDF and MS Office Capabilities to Salesforce
As a commercial PDF SDK vendor, we have several clients developing web apps for the Salesforce platform. And one commonly mentioned frustration was the challenge of embedding PDF & MS Office viewing, editing, and annotating functionalities. This has historically proven difficult due to most web document solutions being dependent upon server-side technology while requiring MS Office licenses.
Working with these clients we therefore developed a Salesforce-specific build of the PDFTron WebViewer SDK, a pure client-side JavaScript library to view, edit, and annotate documents without needing MS Office licenses. This Salesforce-specific build of WebViewer easily integrates into your application as a Lightning Web Component, and is optimized for Salesforce’s 5MB static resource file-size limit.
Working around Lighting Web Component (LWC) Restrictions
While Salesforce includes a few PDF offerings, clients have found these less than optimal, often due to Salesforce restrictions on what, where, and how files are hosted within the LWC framework.
What: Salesforce requires that code used in Lightning Components be made up of only HTML/CSS/JavaScript, not native code.
Where: LWC can only use files hosted on the Salesforce platform, not on third-party servers.
How: Files hosted on Salesforce must be less than 5 MB in size, yet PDFs are commonly much larger and thus need to be broken into smaller chunks.
Designing a Salesforce-specific Document Solution
WebViewer is uniquely suited to Salesforce in that it runs entirely inside the modern desktop browser. As pure client-side JavaScript, it does not rely on external servers -- or deprecated plugins available only on older browsers. And as a WebAssembly/Asm.js port of the commercial PDFTron SDK (in C++) WebViewer SDK delivers almost all the same native document functionality, including document editing, redaction, conversion, and more.
The result is that you can open, view, annotate, and save PDF and MS Office (DOCX, XLXS, and PPTX) documents entirely within your Salesforce app without anyone requiring MS Office software or MS Office licenses.
Indeed, since WebViewer uses the PDFTron SDK, it uses the same high-quality rendering engine; you can display documents in all browsers accurately and fast. Likewise, you have access to hundreds of unique PDF SDK features. This along with WebViewer’s open-source UI means you’re free to customize the functionality, behavior, and appearance of the viewer as much as you’d like.
Lastly, WebViewer comes with a built-in optimization script to break up large documents into chunks to get around the 5MB limit on hosted files and ensure overall improved performance.
We are committed to helping Salesforce developers bring best-in-class document experiences to all their users through modern web technologies. And that’s why we’re a proud sponsor of Cactusforce 2020, where you’ll be able to meet with our team and receive a personalized demonstration of the PDFTron WebViewer. For more information on our Salesforce WebViewer integration, check out the documentation and accompanying guide.
See you in Phoenix!