Skip to content

Commit 331de89

Browse files
committed
999358-ug: Partially completed the md files.
1 parent 375a3d0 commit 331de89

11 files changed

Lines changed: 500 additions & 308 deletions

File tree

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

Lines changed: 67 additions & 18 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ document.destroy();
3434

3535
{% endhighlight %}
3636
{% highlight javascript tabtitle="JavaScript" %}
37+
3738
// Create a new PDF document
3839
var document = new ej.pdf.PdfDocument();
3940
// Add page
@@ -52,49 +53,6 @@ document.destroy();
5253
{% endhighlight %}
5354
{% endtabs %}
5455

55-
## Adding Bookmarks in an existing PDF document
56-
57-
This example demonstrates how to add bookmarks to an existing PDF document using the `PdfBookmark` class. This allows you to enhance navigation in already created PDF document.
58-
59-
{% tabs %}
60-
{% highlight javascript tabtitle="TypeScript" %}
61-
import {PdfDocument, PdfPage, PdfBookmarkBase, PdfDestination} from '@syncfusion/ej2-pdf';
62-
63-
// Load an existing PDF document
64-
let document: PdfDocument = new PdfDocument(data);
65-
// Get page
66-
let page: PdfPage = document.getPage(0);
67-
// Get the bookmarks
68-
let bookmarks: PdfBookmarkBase = document.bookmarks;
69-
// Gets the bookmark at the specified index
70-
let bookmark: PdfBookmark = bookmarks.at(0) as PdfBookmark;
71-
// Set the destination
72-
bookmark.destination = new PdfDestination(page, { x: 100, y: 200 });
73-
// Save the document
74-
document.save('Output.pdf');
75-
// Close the document
76-
document.destroy();
77-
78-
{% endhighlight %}
79-
{% highlight javascript tabtitle="JavaScript" %}
80-
// Load an existing PDF document
81-
var document = new ej.pdf.PdfDocument(data);
82-
// Get page
83-
var page = document.getPage(0);
84-
// Get the bookmarks
85-
var bookmarks = document.bookmarks;
86-
// Get the bookmark at the specified index
87-
var bookmark = bookmarks.at(0);
88-
// Set the destination
89-
bookmark.destination = new ej.pdf.PdfDestination(page, { x: 100, y: 200 });
90-
// Save the document
91-
document.save('Output.pdf');
92-
// Close the document
93-
document.destroy();
94-
95-
{% endhighlight %}
96-
{% endtabs %}
97-
9856
## Inserting Bookmarks in an existing PDF
9957

10058
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.
@@ -109,7 +67,7 @@ let document: PdfDocument = new PdfDocument(data);
10967
let page: PdfPage = document.getPage(0) as PdfPage;
11068
// Get the bookmarks
11169
let bookmarks: PdfBookmarkBase = document.bookmarks;
112-
// Add a new outline to the PDF document
70+
// Add a new bookmark at the specified page index
11371
let bookmark: PdfBookmark = bookmarks.add('Introduction', 1);
11472
// Sets destination to the bookmark
11573
bookmark.destination = new PdfDestination(page, { x: 100, y: 200 });
@@ -120,13 +78,14 @@ document.destroy();
12078

12179
{% endhighlight %}
12280
{% highlight javascript tabtitle="JavaScript" %}
81+
12382
// Load an existing PDF document
12483
var document = new ej.pdf.PdfDocument(data);
12584
// Get the first page
12685
var page = document.getPage(0);
12786
// Get the bookmarks
12887
var bookmarks = document.bookmarks;
129-
// Add a new outline to the PDF document
88+
// Add a new bookmark at the specified page index
13089
var bookmark = bookmarks.add('Introduction', 1);
13190
// Set destination to the bookmark
13291
bookmark.destination = new ej.pdf.PdfDestination(page, { x: 100, y: 200 });
@@ -160,6 +119,7 @@ document.destroy();
160119

161120
{% endhighlight %}
162121
{% highlight javascript tabtitle="JavaScript" %}
122+
163123
// Load an existing PDF document
164124
var document = new ej.pdf.PdfDocument(data);
165125
// Get the first page
@@ -199,6 +159,7 @@ document.destroy();
199159

200160
{% endhighlight %}
201161
{% highlight javascript tabtitle="JavaScript" %}
162+
202163
// Load an existing PDF document
203164
var document = new ej.pdf.PdfDocument(data);
204165
// Get the first page
@@ -238,6 +199,7 @@ document.destroy();
238199

239200
{% endhighlight %}
240201
{% highlight javascript tabtitle="JavaScript" %}
202+
241203
// Load an existing PDF document
242204
var document = new ej.pdf.PdfDocument(data);
243205
// Get the bookmarks
@@ -275,6 +237,7 @@ document.destroy();
275237

276238
{% endhighlight %}
277239
{% highlight javascript tabtitle="JavaScript" %}
240+
278241
// Load an existing PDF document
279242
var document = new ej.pdf.PdfDocument(data);
280243
// Get bookmarks

0 commit comments

Comments
 (0)