Skip to content

Commit 970c011

Browse files
committed
999358-hotfix: Resolved the all feedback.
1 parent 881f245 commit 970c011

20 files changed

+267
-268
lines changed

Document-Processing/PDF/PDF-Library/javascript/Annotations.md

Lines changed: 96 additions & 101 deletions
Large diffs are not rendered by default.

Document-Processing/PDF/PDF-Library/javascript/Bookmarks.md

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ documentation: UG
77
---
88
# Bookmarks in JavaScript PDF library
99

10-
Syncfusion<sup>&reg;</sup> PDF provides support to insert, remove and modify the bookmarks in the PDF Document.
10+
Syncfusion<sup>&reg;</sup> PDF provides support to insert, remove, and modify the bookmarks in the PDF Document.
1111

12-
## Adding Bookmarks in a PDF
12+
## Adding bookmarks to a PDF
1313

1414
This example demonstrates how to add bookmarks to a PDF document using the `PdfBookmark` class. Bookmarks provide an easy way to navigate through different sections of a PDF file.
1515

1616
{% tabs %}
17-
{% highlight javascript tabtitle="TypeScript" %}
18-
import {PdfDocument, PdfPage, PdfBookmarkBase, PdfDestination} from '@syncfusion/ej2-pdf';
17+
{% highlight typescript tabtitle="TypeScript" %}
18+
import {PdfDocument, PdfPage, PdfBookmarkBase, PdfBookmark, PdfDestination} from '@syncfusion/ej2-pdf';
1919

2020
// Create a new PDF document
2121
let document: PdfDocument = new PdfDocument();
22-
// Add page
22+
// Add a page
2323
let page: PdfPage = document.addPage();
2424
// Get the bookmarks
2525
let bookmarks: PdfBookmarkBase = document.bookmarks;
26-
// Add a new outline to the PDF document
26+
// Add a new bookmark to the PDF document
2727
let bookmark: PdfBookmark = bookmarks.add('Introduction');
2828
// Sets destination to the bookmark
2929
bookmark.destination = new PdfDestination(page, { x: 100, y: 200 });
3030
// Save the document
31-
document.save('Output.pdf');
31+
document.save('output.pdf');
3232
// Close the document
3333
document.destroy();
3434

@@ -37,42 +37,42 @@ document.destroy();
3737

3838
// Create a new PDF document
3939
var document = new ej.pdf.PdfDocument();
40-
// Add page
40+
// Add a page
4141
var page = document.addPage();
4242
// Get the bookmarks
4343
var bookmarks = document.bookmarks;
44-
// Add a new outline to the PDF document
44+
// Add a new bookmark to the PDF document
4545
var bookmark = bookmarks.add('Introduction');
4646
// Set destination to the bookmark
4747
bookmark.destination = new ej.pdf.PdfDestination(page, { x: 100, y: 200 });
4848
// Save the document
49-
document.save('Output.pdf');
49+
document.save('output.pdf');
5050
// Close the document
5151
document.destroy();
5252

5353
{% endhighlight %}
5454
{% endtabs %}
5555

56-
## Inserting Bookmarks in an existing PDF
56+
## Inserting bookmarks into an existing PDF
5757

5858
This example demonstrates how to insert bookmarks at a specific position in an existing PDF document using the `PdfBookmark` class. This feature allows precise control over bookmark order.
5959

6060
{% tabs %}
61-
{% highlight javascript tabtitle="TypeScript" %}
62-
import {PdfDocument, PdfPage, PdfBookmarkBase, PdfDestination} from '@syncfusion/ej2-pdf';
61+
{% highlight typescript tabtitle="TypeScript" %}
62+
import {PdfDocument, PdfPage, PdfBookmark, PdfBookmarkBase, PdfDestination} from '@syncfusion/ej2-pdf';
6363

6464
// Load an existing PDF document
6565
let document: PdfDocument = new PdfDocument(data);
6666
// Get the first page
6767
let page: PdfPage = document.getPage(0) as PdfPage;
6868
// Get the bookmarks
6969
let bookmarks: PdfBookmarkBase = document.bookmarks;
70-
// Add a new bookmark at the specified page index
70+
// Add a new bookmark at the specified bookmark index
7171
let bookmark: PdfBookmark = bookmarks.add('Introduction', 1);
7272
// Sets destination to the bookmark
7373
bookmark.destination = new PdfDestination(page, { x: 100, y: 200 });
7474
// Save the document
75-
document.save('Output.pdf');
75+
document.save('output.pdf');
7676
// Close the document
7777
document.destroy();
7878

@@ -85,23 +85,23 @@ var document = new ej.pdf.PdfDocument(data);
8585
var page = document.getPage(0);
8686
// Get the bookmarks
8787
var bookmarks = document.bookmarks;
88-
// Add a new bookmark at the specified page index
88+
// Add a new bookmark at the specified bookmark index
8989
var bookmark = bookmarks.add('Introduction', 1);
9090
// Set destination to the bookmark
9191
bookmark.destination = new ej.pdf.PdfDestination(page, { x: 100, y: 200 });
9292
// Save the document
93-
document.save('Output.pdf');
93+
document.save('output.pdf');
9494
// Close the document
9595
document.destroy();
9696

9797
{% endhighlight %}
9898
{% endtabs %}
9999

100-
## Removing Bookmarks from an existing PDF
100+
## Removing bookmarks from an existing PDF
101101

102102
This example demonstrates how to remove bookmarks from an existing PDF document using the `PdfBookmark` class.
103103
{% tabs %}
104-
{% highlight javascript tabtitle="TypeScript" %}
104+
{% highlight typescript tabtitle="TypeScript" %}
105105
import {PdfDocument, PdfPage, PdfBookmarkBase} from '@syncfusion/ej2-pdf';
106106

107107
// Load an existing PDF document
@@ -113,7 +113,7 @@ let bookmarks: PdfBookmarkBase = document.bookmarks;
113113
// Remove specified bookmark from the document.
114114
bookmarks.remove('Introduction');
115115
// Save the document
116-
document.save('Output.pdf');
116+
document.save('output.pdf');
117117
// Close the document
118118
document.destroy();
119119

@@ -129,31 +129,29 @@ var bookmarks = document.bookmarks;
129129
// Remove specified bookmark from the document
130130
bookmarks.remove('Introduction');
131131
// Save the document
132-
document.save('Output.pdf');
132+
document.save('output.pdf');
133133
// Close the document
134134
document.destroy();
135135

136136
{% endhighlight %}
137137
{% endtabs %}
138138

139-
## Removing Bookmark from the document at the specified index
139+
## Removing a bookmark from the document at a specified index
140140

141141
This example demonstrates how to remove bookmarks from the document at the specific index using the `PdfBookmark` class.
142142

143143
{% tabs %}
144-
{% highlight javascript tabtitle="TypeScript" %}
145-
import {PdfDocument, PdfPage, PdfBookmarkBase} from '@syncfusion/ej2-pdf';
144+
{% highlight typescript tabtitle="TypeScript" %}
145+
import {PdfDocument, PdfBookmarkBase} from '@syncfusion/ej2-pdf';
146146

147147
// Load an existing PDF document
148148
let document: PdfDocument = new PdfDocument(data);
149-
// Get the first page
150-
let page: PdfPage = document.getPage(0) as PdfPage;
151149
// Get the bookmarks
152150
let bookmarks: PdfBookmarkBase = document.bookmarks;
153151
// Remove the bookmark from the document at the index 1.
154152
bookmarks.remove(1);
155153
// Save the document
156-
document.save('Output.pdf');
154+
document.save('output.pdf');
157155
// Close the document
158156
document.destroy();
159157

@@ -162,26 +160,24 @@ document.destroy();
162160

163161
// Load an existing PDF document
164162
var document = new ej.pdf.PdfDocument(data);
165-
// Get the first page
166-
var page = document.getPage(0);
167163
// Get the bookmarks
168164
var bookmarks = document.bookmarks;
169165
// Remove the bookmark from the document at index 1
170166
bookmarks.remove(1);
171167
// Save the document
172-
document.save('Output.pdf');
168+
document.save('output.pdf');
173169
// Close the document
174170
document.destroy();
175171

176172
{% endhighlight %}
177173
{% endtabs %}
178174

179-
## Removing all the Bookmark from the collection
175+
## Removing all bookmarks from the collection
180176

181-
This example demonstrates how to removes all the bookmarks from the collection using the `PdfBookmark` class.
177+
This example demonstrates how to removes all bookmarks from the collection using the `PdfBookmark` class.
182178

183179
{% tabs %}
184-
{% highlight javascript tabtitle="TypeScript" %}
180+
{% highlight typescript tabtitle="TypeScript" %}
185181
import {PdfDocument, PdfBookmarkBase} from '@syncfusion/ej2-pdf';
186182

187183
// Load an existing PDF document
@@ -190,10 +186,10 @@ let document: PdfDocument = new PdfDocument(data);
190186
let bookmarks: PdfBookmarkBase = document.bookmarks;
191187
// Remove all the bookmark from the collection.
192188
bookmarks.clear();
193-
// Get count after removal of all outlines.
189+
// // Get the count after removal of all bookmarks
194190
let count: number = bookmarks.count;
195191
// Save the document
196-
document.save('Output.pdf');
192+
document.save('output.pdf');
197193
// Destroy the document
198194
document.destroy();
199195

@@ -206,32 +202,34 @@ var document = new ej.pdf.PdfDocument(data);
206202
var bookmarks = document.bookmarks;
207203
// Remove all the bookmarks from the collection
208204
bookmarks.clear();
209-
// Get count after removal of all outlines
205+
// // Get the count after removal of all bookmarks
210206
var count = bookmarks.count;
211207
// Save the document
212-
document.save('Output.pdf');
208+
document.save('output.pdf');
213209
// Destroy the document
214210
document.destroy();
215211

216212
{% endhighlight %}
217213
{% endtabs %}
218214

219-
## Bookmark page index in an existing PDF document
215+
## Getting a bookmark's page index in an existing PDF document
220216

221217
This example demonstrates how to retrieve the page index associated with a bookmark in an existing PDF document using the `PdfBookmark` class. This helps identify the exact location of the bookmark.
222218

223219
{% tabs %}
224-
{% highlight javascript tabtitle="TypeScript" %}
220+
{% highlight typescript tabtitle="TypeScript" %}
225221
import {PdfDocument, PdfBookmarkBase} from '@syncfusion/ej2-pdf';
226222

227223
// Load an existing PDF document
228224
let document: PdfDocument = new PdfDocument(data);
229225
// Get bookmarks
230-
let bookmarks: PdfBookmarkBase = document.bookmarks;
231-
// Get bookmark at the specified index
232-
let pageIndex: number = bookmarks.destination.pageIndex;
226+
let bookmarks: PdfBookmarkBase = document.bookmarks;
227+
// Get the first bookmark (or any specific one)
228+
let bookmark = bookmarks.at(0);
229+
// Get the page index of the bookmark's destination
230+
let pageIndex: number = bookmark.destination.pageIndex;
233231
// Save the document
234-
document.save('Output.pdf');
232+
document.save('output.pdf');
235233
// Close the document
236234
document.destroy();
237235

@@ -247,7 +245,7 @@ var bookmark = bookmarks.at(0);
247245
// Get the page index of the bookmark's destination
248246
var pageIndex = bookmark.destination.pageIndex;
249247
// Save the document
250-
document.save('Output.pdf');
248+
document.save('output.pdf');
251249
// Close the document
252250
document.destroy();
253251

Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-angular.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ documentation: ug
88
keywords: angular create pdf, angular generate pdf, angular pdf library, ej2 pdf angular, JavaScript
99
---
1010

11-
# Create or Generate PDF file in Angular application
11+
# Create or generate PDF file in Angular application
1212

1313
The Syncfusion<sup>&reg;</sup> JavaScript PDF library is used to create, read, and edit PDF documents. This library also offers functionality to merge, split, stamp, fill forms, and secure PDF files.
1414

@@ -23,7 +23,7 @@ To install the latest Angular CLI globally use the following command.
2323
npm install -g @angular/cli
2424
```
2525

26-
N> Use the command **npm install --save @angular/cli@12.0.2** to install the Angular CLI version 12.0.2
26+
N> To install a specific Angular CLI version, use: **npm install --save @angular/cli@12.0.2**
2727

2828
## Create an Angular Application
2929

@@ -36,7 +36,7 @@ cd my-app
3636

3737
## Installing Syncfusion<sup>&reg;</sup> JavaScript PDF package
3838

39-
All the available JS 2 packages are published in `npmjs.com` registry.
39+
All Syncfusion<sup>&reg;</sup> JS 2 packages are published in `npmjs.com` registry.
4040

4141
* To install PDF component, use the following command.
4242

@@ -46,12 +46,12 @@ npm install @syncfusion/ej2-pdf --save
4646
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
4747
* Copy the contents of the openjpeg folder from ./node_modules/@syncfusion/ej2-pdf-data-extract/dist to the public directory using the command:
4848
```bash
49-
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/js/openjpeg
49+
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg ./src/assets/openjpeg
5050
```
51-
* Confirm that there is an 'openjpeg' directory within your public directory, if you extracting images from PDF.
52-
* Validate that your server has been configured to utilize the Content-Type: application/wasm MIME type.
51+
* Confirm that there is an `openjpeg` directory within your src/assets directory if you are extracting images from PDFs.
52+
* Ensure your server serves .wasm files with the Content-Type: application/wasm MIME type (Angular dev server handles this by default; configure your production server accordingly).
5353

54-
## Create a PDF document using TypeScript
54+
## Create a PDF document
5555

5656
* Add a simple button to `app.component.html` and attach a click handler that uses the TypeScript PDF API to create a new PDF document.
5757

@@ -72,7 +72,7 @@ cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/js/op
7272

7373
{% tabs %}
7474
{% highlight ts tabtitle="~/app.component.ts" %}
75-
import { PdfDocument, PdfPage, PdfStandardFont, PdfBrush } from '@syncfusion/ej2-pdf';
75+
import { PdfDocument, PdfGraphics, PdfPage, PdfFontFamily, PdfFontStyle, PdfFont, PdfBrush } from '@syncfusion/ej2-pdf';
7676
{% endhighlight %}
7777
{% endtabs %}
7878

@@ -88,7 +88,7 @@ document.getElementById('normalButton').onclick = (): void => {
8888
// Get graphics from the page
8989
const graphics: PdfGraphics = page.graphics;
9090
// Set font
91-
const font: PdfStandardFont = document.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
91+
const font: PdfFont = document.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
9292
// Create a new black brush
9393
const brush = new PdfBrush({r: 0, g: 0, b: 0});
9494
// Draw text
@@ -105,7 +105,7 @@ document.getElementById('normalButton').onclick = (): void => {
105105

106106
Use the following command to run the application in browser.
107107

108-
```javascript
108+
```bash
109109
ng serve --open
110110
```
111111

Document-Processing/PDF/PDF-Library/javascript/Create-PDF-document-asp-net-core.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ keywords: .net core create pdf, edit pdf, merge, pdf form, fill form, digital si
1010

1111
# Create or Generate PDF in ASP.NET Core
1212

13-
The Syncfusion<sup>&reg;</sup> JavaScript PDF library is used to create, read, and edit PDF documents. This library also offers functionality to merge, split, stamp, forms, and secure PDF files.
13+
The Syncfusion<sup>&reg;</sup> JavaScript PDF library is used to create, read, and edit PDF documents. This library also offers functionality to merge, split, stamp, fill forms, and secure PDF files.
1414

1515
This guide explains how to integrate the JavaScript PDF library into an ASP.NET Core application.
1616

17-
## Integrate PDF library into an ASP.NET Core application
17+
## Integrate the PDF library into an ASP.NET Core application
1818

1919
Step 1: Start Visual Studio and select **Create a new project**.
2020
Step 2: In the **Create a new project** dialog, select **ASP.NET Core Web App**.
@@ -24,7 +24,7 @@ Step 3: In the **Configure your new project** dialog, enter the project name and
2424
Step 4: In the **Additional information** dialog, select a .NET LTS version (for example, **.NET 8.0 (Long-term Support)**) and then select **Create**.
2525
![ASP.NET Core PDF creation3](Getting_started_images/Asp-net-core-creation3.png)
2626

27-
Step 5: **Add script reference** : Add the required scripts using the CDN inside the `<head>` of `~/Views/Shared/_Layout.cshtml` as follows:
27+
Step 5: **Add script reference**: Add the required scripts using the CDN inside the `<head>` of `~/Views/Shared/_Layout.cshtml` as follows:
2828

2929
{% tabs %}
3030
{% highlight cshtml tabtitle="~/_Layout.cshtml" %}
@@ -41,10 +41,10 @@ N> Check out the following topics for including script references in an ASP.NET
4141
* [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)
4242
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`.
4343

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.
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.
4545

4646
{% tabs %}
47-
{% highlight cshtml tabtitle="~/Index.cshtml" %}
47+
{% highlight cshtml tabtitle="~/Views/Home/Index.cshtml" %}
4848
<div class="container py-4">
4949
<h1 class="h4 mb-3">Create PDF document</h1>
5050
<p class="text-muted">Click the button to generate and download a PDF.</p>
@@ -66,7 +66,7 @@ Step 6: **Create a PDF document** : Add the script in `~/Views/Home/Index.cshtml
6666
// Draw text
6767
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
6868
// Save and download PDF
69-
pdf.save('Output.pdf');
69+
pdf.save('output.pdf');
7070
// Destroy the PDF document instance
7171
pdf.destroy();
7272
});
@@ -75,9 +75,9 @@ Step 6: **Create a PDF document** : Add the script in `~/Views/Home/Index.cshtml
7575
{% endhighlight %}
7676
{% endtabs %}
7777

78-
step 7: **Build the project** : Click on Build > Build Solution or press Ctrl + Shift + B to build the project.
78+
step 7: **Build the project**: Click on Build > Build Solution or press Ctrl + Shift + B to build the project.
7979

80-
Step 8: **Run the project** : Click the Start button (green arrow) or press F5 to run the app.
80+
Step 8: **Run the project**: Click the Start button (green arrow) or press F5 to run the app.
8181

8282
By executing the program, you will generate the following PDF document.
8383

0 commit comments

Comments
 (0)