You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/javascript/Redaction.md
+43-12Lines changed: 43 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,11 @@ N> For redaction features, you need to install the `@syncfusion/ej2-pdf-data-ext
14
14
## Removing sensitive content from the PDF document
15
15
16
16
Redaction permanently removes confidential or sensitive information from a PDF. The `PdfRedactor` and `PdfRedactionRegion` classes allow you to mark specific areas and apply irreversible redaction to the document.
17
-
> **Note:**
18
-
> When calling `redact(callback)`, the callback is executed to render each redaction region on a canvas before the content is permanently removed. This allows customizing the final appearance of the redacted area.
19
17
20
18
{% tabs %}
21
19
{% highlight typescript tabtitle="TypeScript" %}
22
20
import { PdfDocument } from '@syncfusion/ej2-pdf';
23
-
import { PdfRedactor, PdfRedactionRegion } from '@syncfusion/ej2-pdf-data-extract';
21
+
import { PdfRedactor, PdfRedactionRegion, ApplicationPlatform } from '@syncfusion/ej2-pdf-data-extract';
24
22
25
23
// Load the document
26
24
let document: PdfDocument = new PdfDocument(data);
@@ -30,8 +28,13 @@ let redactor: PdfRedactor = new PdfRedactor(document);
N> The `PdfRedactor.redact(callback)` method allows you to customize redaction appearance through a canvas callback and supports removing both **text and images**. In contrast, `PdfRedactor.redactSync()` performs faster synchronous redaction but can remove **only text**, and does not support image redaction or custom drawing.
69
+
60
70
## Fill color on the redacted area
61
71
62
72
You can apply a solid fill color to cover the redacted content. This is the most common approach for redaction.
63
73
64
74
{% tabs %}
65
75
{% highlight typescript tabtitle="TypeScript" %}
66
76
import { PdfDocument } from '@syncfusion/ej2-pdf';
67
-
import { PdfRedactor, PdfRedactionRegion} from '@syncfusion/ej2-pdf-data-extract';
77
+
import { PdfRedactor, PdfRedactionRegion, ApplicationPlatform } from '@syncfusion/ej2-pdf-data-extract';
68
78
69
79
// Load an existing PDF document
70
80
let document: PdfDocument = new PdfDocument(data);
0 commit comments