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
N> And ensure the application includes an `openjpeg` folder under `wwwroot` (or a publicly accessible static path). This folder must contain the `openjpeg.js` and `openjpeg.wasm` files, along with the PDF file to extract images. Keep these in the same static content area as `ej2.min.js`.
42
+
And ensure the application includes an `openjpeg` folder under `wwwroot` (or a publicly accessible static path). This folder must contain the `openjpeg.js` and `openjpeg.wasm` files, along with the PDF file to extract images. Keep these in the same static content area as `ej2.min.js`.
43
43
44
44
Step 6: **Create a PDF document** : Add the script in `~/Views/Home/Index.cshtml` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-mvc.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,11 @@ Step 5: **Add script reference** : Add the required scripts using the CDN inside
36
36
{% endhighlight %}
37
37
{% endtabs %}
38
38
39
-
N> And ensure the application includes an `openjpeg` folder under `Scripts` (or a publicly accessible static path). This folder must contain the `openjpeg.js` and `openjpeg.wasm` files, along with the PDF file to extract images. Keep these in the same static content area as `ej2.min.js`.
39
+
N> Check out the following topics for including script references in an ASP.NET MVC application to enable PDF creation using the Syncfusion<sup>®</sup> JavaScript PDF library:
And ensure the application includes an `openjpeg` folder under `Scripts` (or a publicly accessible static path). This folder must contain the `openjpeg.js` and `openjpeg.wasm` files, along with the PDF file to extract images. Keep these in the same static content area as `ej2.min.js`.
40
44
41
45
Step 6: **Create a PDF document** : Add the script in `~/Views/Home/Index.cshtml` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-javascript.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,11 @@ Step 3: Create a HTML page (index.html) in `my-app` location and add the CDN lin
39
39
{% endhighlight %}
40
40
{% endtabs %}
41
41
42
+
N> For the JavaScript platform, place the **openjpeg** folder in the same location as your `index.html` file. Ensure that your application includes an `openjpeg` folder under `Scripts` (or any publicly accessible static path). This folder must contain the following:
43
+
*`openjpeg.js`
44
+
*`openjpeg.wasm`
45
+
Along with the PDF file from which you want to extract images. Keep these files in the same static content area as `ej2.min.js` to ensure proper loading.
46
+
42
47
Step 4: **Create a PDF document** : Add the script in `index.html` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
43
48
44
49
{% tabs %}
@@ -73,12 +78,6 @@ Step 4: **Create a PDF document** : Add the script in `index.html` by creating a
73
78
{% endhighlight %}
74
79
{% endtabs %}
75
80
76
-
N> For the JavaScript platform, place the **openjpeg** folder in the same location as your `index.html` file. Ensure that your application includes an `openjpeg` folder under `Scripts` (or any publicly accessible static path). This folder must contain the following:
77
-
*`openjpeg.js`
78
-
*`openjpeg.wasm`
79
-
80
-
Along with the PDF file from which you want to extract images. Keep these files in the same static content area as `ej2.min.js` to ensure proper loading.
81
-
82
81
By executing the program, you will get the PDF document as follows.
83
82
84
83

* Confirm that there is an 'openjpeg' directory within your public directory, if you extracting images from PDF.
33
-
* Validate that your server has been configured to utilize the Content-Type: application/wasm MIME type. Additional information can be found in the [Troubleshooting](./troubleshooting/troubleshooting) section.
32
+
* Validate that your server has been configured to utilize the Content-Type: application/wasm MIME type.
34
33
35
34
**Create a PDF document** : Add the script in `App.jsx` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-typescript.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,21 @@ The Syncfusion<sup>®</sup> TypeScript PDF library is used to create, read, a
14
14
15
15
This guide explains how to integrate the TypeScript PDF library into an TypeScript application.
16
16
17
+
## Installing Syncfusion<sup>®</sup> JavaScript PDF package
18
+
19
+
All the available JS 2 packages are published in `npmjs.com` registry.
20
+
21
+
* To install PDF component, use the following command.
22
+
23
+
```bash
24
+
npm install @syncfusion/ej2-pdf --save
25
+
```
26
+
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
27
+
For the TypeScript platform, place the **openjpeg** folder in the same location as your `index.html` file. Ensure that your application includes an `openjpeg` folder under `Scripts` (or any publicly accessible static path). This folder must contain the following:
28
+
*`openjpeg.js`
29
+
*`openjpeg.wasm`
30
+
Along with the PDF file from which you want to extract images.
31
+
17
32
## Dependencies
18
33
19
34
The following list of dependencies are required to use the `TypeScript PDF library` component in your application.
@@ -40,12 +55,6 @@ The following list of dependencies are required to use the `TypeScript PDF libra
40
55
{% endhighlight %}
41
56
{% endtabs %}
42
57
43
-
N> For the TypeScript platform, place the **openjpeg** folder in the same location as your `index.html` file. Ensure that your application includes an `openjpeg` folder under `Scripts` (or any publicly accessible static path). This folder must contain the following:
44
-
*`openjpeg.js`
45
-
*`openjpeg.wasm`
46
-
47
-
Along with the PDF file from which you want to extract images. Keep these files in the same static content area as `ej2.min.js` to ensure proper loading.
48
-
49
58
* Include the following namespaces in `index.ts` file.
* Confirm that there is an 'openjpeg' directory within your public directory, if you extracting images from PDF.
57
-
* Validate that your server has been configured to utilize the Content-Type: application/wasm MIME type. Additional information can be found in the [Troubleshooting](./troubleshooting/troubleshooting) section.
56
+
* Validate that your server has been configured to utilize the Content-Type: application/wasm MIME type.
58
57
59
58
***Create a PDF document** : Add the script in `App.vue` by creating a button and attaching a click event that uses the JavaScript PDF API to generate a PDF document.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/javascript/Redaction.md
+52-28Lines changed: 52 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ documentation: UG
9
9
10
10
Redacting a PDF is the process of permanently removing sensitive or confidential information from PDF documents. Syncfusion<sup>®</sup> PDF library provides an easy way to redact PDF documents.
11
11
12
-
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
12
+
N> For redaction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on. Please verify the platform's actual root directory where the `openjpeg` file is extracted. Depending on the platform, the root path may vary. Check which root folder is being used by reviewing the path referenced in the [Getting Started](https://help.syncfusion.com/document-processing/pdf/pdf-library/javascript/create-pdf-document-asp-net-core) page.
13
13
14
14
## Removing sensitive content from the PDF document
15
15
16
-
Redaction permanently removes confidential or sensitive information from a PDF. The `PdfRedactionAnnotation` class allows you to define areas to redact, ensuring the underlying text or image data is completely deleted from the document.
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
17
18
18
{% tabs %}
19
19
{% highlight typescript tabtitle="TypeScript" %}
@@ -27,7 +27,6 @@ let redactor: PdfRedactor = new PdfRedactor(document);
@@ -67,6 +65,8 @@ import { PdfRedactor, PdfRedactionRegion} from '@syncfusion/ej2-pdf-data-extract
67
65
68
66
// Load an existing PDF document
69
67
let document: PdfDocument = new PdfDocument(data);
68
+
// Add redactions to the collection
69
+
let redactions: PdfRedactionRegion[] = [];
70
70
// Initialize a new instance of the `PdfRedactor` class
71
71
let redactor: PdfRedactor = new PdfRedactor(document);
72
72
// Initialize a new instance of the `PdfRedactionRegion` class.
@@ -86,6 +86,8 @@ document.destroy();
86
86
{% highlight javascript tabtitle="JavaScript" %}
87
87
// Load an existing PDF document
88
88
var document = new ej.pdf.PdfDocument(data);
89
+
// Add redactions to the collection
90
+
var redactions = [];
89
91
// Initialize a new instance of the `PdfRedactor` class
90
92
var redactor = new ej.pdfdataextract.PdfRedactor(document);
91
93
// Initialize a new instance of the `PdfRedactionRegion` class.
@@ -104,54 +106,76 @@ document.destroy();
104
106
{% endhighlight %}
105
107
{% endtabs %}
106
108
107
-
## Redaction appearance fill color
109
+
## Text appearance on the redacted area
108
110
109
-
Customize the appearance of the redacted area by applying specific fill colors. This helps maintain a consistent design or highlight redacted sections in a visually appealing way.
111
+
Customize the redacted region by drawing text or graphics over it, using `PdfRedactionRegion` and `PdfRedactor` to define the area and apply a custom visual appearance to the redaction.
110
112
111
113
{% tabs %}
112
114
{% highlight typescript tabtitle="TypeScript" %}
113
115
import { PdfDocument } from '@syncfusion/ej2-pdf';
114
116
import { PdfRedactor, PdfRedactionRegion } from '@syncfusion/ej2-pdf-data-extract';
115
117
116
118
// Load an existing PDF document
117
-
let document: PdfDocument = new PdfDocument(data, password);
119
+
let document= new PdfDocument(data);
118
120
// Add redactions to the collection
119
-
let redactions: PdfRedactionRegion[] = [];
120
-
// Initialize a new instance of the `PdfRedactor` class
121
-
let redactor: PdfRedactor = new PdfRedactor(document);
122
-
// Initialize a new instance of the `PdfRedactionRegion` class.
123
-
let redaction: PdfRedactionRegion = new PdfRedactionRegion(0, {x: 40, y: 41.809, width: 80, height: 90});
124
-
// Sets the fill color used to fill the redacted area.
125
-
redaction.fillColor = {r: 255, g: 0, b: 0};
121
+
let redactions = [];
122
+
let region = { x: 40, y: 43.620000000000005, width: 80, height: 20 };
123
+
// Initialize a new redaction region with custom appearance
124
+
let redaction = new PdfRedactionRegion(0, { x: 0, y: 0, width: 80, height: 20 }, true);
125
+
let font = document.embedFont(PdfFontFamily.helvetica, 10, PdfFontStyle.regular);
126
+
redaction.appearance.normal.graphics.drawString(
127
+
'Redacted Text',
128
+
font,
129
+
{ x: 0, y: 0, width: 80, height: 20 },
130
+
new PdfBrush({ r: 255, g: 0, b: 0 })
131
+
);
126
132
redactions.push(redaction);
127
-
// Add redactions with specified options.
133
+
// Add another redaction region (example region coordinates)
0 commit comments