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.
The steps to redact PDFs are as follows:
Create Redaction Annotations: A user applies to redact annotations that specify the pieces or regions of content that should be removed. This step marks the regions where redaction changes will be applied. These redaction annotations can be modified or deleted before applying redaction changes, without removing content from the document.
Apply Redaction Changes: After marking the areas for complete content removal, apply redaction changes. The content within the regions of the redaction annotations will be irreversibly deleted.
Through these two steps, you can thoroughly remove sensitive data from the document.
You can use the addAnnotations function to create redaction annotations.
Based on the function of ciphertext annotations, they can be divided into two types:
In addition, redaction annotations can be modified or deleted at this stage. Note that once redaction annotations have been applied, their appearance cannot be changed. This is because the redaction annotations will become non-editable, non-modifiable, static content instead of an interactive ciphertext annotation after it has been applied.
This sample shows how to create redaction annotations:
// create a redaction annotation to fill black.
docViewer.addAnnotations({
type: 'redact',
pageIndex: 0,
rect: {
left: 60,
top: 180,
right: 220,
bottom: 260
},
fillColor: 'rgb(0, 0, 0)',
erasure: false // When this attribute is not specified, the default value is false.
});
// create a redaction annotation to fill white.
docViewer.addAnnotations({
type: 'redact',
pageIndex: 0,
rect: {
left: 60,
top: 60,
right: 220,
bottom: 130
},
erasure: true
});The ComPDFKit SDK ensures that if text, images, or vector graphics are included in the region marked by a redaction annotation, the corresponding image or path data in that portion will be completely removed and cannot be restored.
Apply redaction annotations through the applyRedactions function. Supported parameters:
all: All newly added redaction annotations in the application document annotations;This sample shows how to apply redaction annotations:
docViewer.applyRedactions('all');