Using PDFNetJS to View and Edit PDFs Inside a Salesforce App

1,138 views
Skip to first unread message

Aaron

unread,
Jul 7, 2017, 7:18:34 PM7/7/17
to PDFTron WebViewer
At PDFTron, we have a number of clients developing Salesforce apps.  Salesforce provides a full-featured app framework that enables development of web-based apps that build on the wealth of information stored in Salesforce databases.

But a number of our clients have mentioned one roadblock they have trouble overcoming --- displaying and editing PDF documents within their Salesforce apps.  While Salesforce includes a few PDF offerings, our clients have found that existing approaches quite problematic.  (It seems that one can either create a "hybrid" Salesforce app, which is considered insecure; or one can host a PDF viewer in an external environment.  It seems neither approach is optimal.)

Working with those clients, we've been able to create a Salesforce-specific build of PDFNetJS.  For reference --- PDFNetJS is our pure JavaScript PDF viewing and editing toolkit.  PDFNetJS runs entirely inside the modern desktop browser.  You can find out more at the following:


Our Salesforce-specific build of PDFNetJS is crafted to work around issues hosting libraries with Salesforce.  The end result is that you can open, view, edit, and save PDF documents entirely within your Salesforce app.  And since PDFNetJS uses PDFNet's high-quality rendering, you can display PDFs in all browsers consistently and correctly.  (See https://blog.pdftron.com/2015/11/24/pdf-js-incorrect-rendering/ for more about the dangers of relying on browsers to render PDFs.)

We've posted a developer preview of the Salesforce-ready build of PDFNetJS, downloadable from the following:


We're eager to hear any feedback, good or bad, from Salesforce developers.  So please give it a try and let us know what you think.  Thanks!

Gabe Wonders

unread,
Feb 6, 2018, 4:16:39 PM2/6/18
to PDFTron WebViewer
This sounds like exactly what I am looking for within Salesforce. Does PDFNetJS allow you to save the modified PDF directly back into Salesforce?

Matt Parizeau

unread,
Feb 7, 2018, 1:31:50 PM2/7/18
to PDFTron WebViewer
See here for how you can get the PDF file data as a blob from WebViewer: https://groups.google.com/d/msg/pdfnet-webviewer/w-X7_A_eAcU/qU5TfJT2AQAJ

Then you should be able to use this Salesforce API with the blob data: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm

Matt Parizeau
Software Developer
PDFTron Systems Inc.
Reply all
Reply to author
Forward
0 new messages