AVAILABLE NOW: Spring 2025 Release
By Isaac Maw | 2025 May 28
5 min
Tags
salesforce
For teams that work directly in Salesforce, switching between platforms to work with documents can slow down productivity and lead to versioning issues. Apryse’s WebViewer library for Salesforce enables developers to embed robust document viewing, editing, and more in a lightning web component.
In this article, let’s go over how to apply secure redactions to documents in Salesforce with WebViewer. Whether you use WebViewer in Salesforce today or are considering the benefits, here’s just one example of the document processing features this integration brings to the leading CRM.
Try the WebViewer in Salesforce Demo
Document redaction may seem simple, but it takes more than a black box over text to ensure the data is irretrievably hidden. In legal documents or for privacy compliance, failing to securely redact data and accidentally revealing it can have significant consequences.
Apryse enables secure, permanent deletion of sensitive data from PDFs, images, Microsoft Office files, and more, so users can handle documents of any type and complexity without compromising sensitive information.
Secure redaction is essential in:
Check out the WebViewer redaction demo in our showcase here.
WebViewer is a pure client-side JavaScript library to annotate, view, and edit documents. The Salesforce-specific build of WebViewer can be easily integrated into your application as a Lightning Web Component and is optimized for Salesforce's 5MB static resource file size limit.
To start a free trial, download WebViewer source files here or watch this video tutorial for deploying WebViewer to Salesforce using a Low Code method.
This guide will help you utilize all of Apryse's Redaction capabilities in Webviewer alongside Salesforce Lightning Components.
In your LWC where you initialize WebViewer (you can check out pdftronWvInstance.js in our sample repository). This shows you how to enable redaction:
//snipped for brevity
const viewerElement = this.template.querySelector('div');
const viewer = new PDFTron.WebViewer({
path: libUrl,
custom: JSON.stringify(myObj),
config: myfilesUrl + '/config_apex.js',
fullAPI: true // this must be set to true
enableRedaction: true, // this must be set to true
// l: 'YOUR_LICENSE_KEY_HERE',
}, viewerElement);
Note: You need to use the pdf_full.zip file in your /staticresources/ folder to access full API, which is required for redaction.
You can use search to highlight single or all occurences of a search term. You may also use regular expressions, which allows to target e-mail addresses, phone numbers, credit card numbers, etc. See more in our searching documents guide.
When performing your search, add a searchListener that marks your search results for redaction like so:
const searchListener = (searchTerm, options, results) => {
// add redaction annotation for each search result
const newAnnotations = results.map(result => {
const annotation = new Annotations.RedactionAnnotation();
annotation.PageNumber = result.pageNum;
annotation.Quads = result.quads.map(quad => quad.getPoints());
annotation.StrokeColor = new Annotations.Color(136, 39, 31);
return annotation;
});
annotManager.addAnnotations(newAnnotations);
annotManager.drawAnnotationsFromList(newAnnotations);
};
instance.addSearchListener(searchListener);
You can also create redactions programmatically. Check out our documentation for a guide.
You can review the Salesforce PDF App to showcase an end-to-end example of search, and how you can leverage it for redaction and content replacing on our Github repository. For more information, contact sales or reach out to us on Discord.
Tags
salesforce
Isaac Maw
Technical Content Creator
Share this post
PRODUCTS
Platform Integrations
End User Applications
Popular Content