Skip to content

Commit 3c6556c

Browse files
committed
999358-hotfix: Added proper link and code changes in JavaScript UG.
1 parent bfda323 commit 3c6556c

28 files changed

+934
-1054
lines changed

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

Lines changed: 131 additions & 23 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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ All the available JS 2 packages are published in `npmjs.com` registry.
4444
npm install @syncfusion/ej2-pdf --save
4545
```
4646
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
47+
* Copy the contents of the openjpeg folder from ./node_modules/@syncfusion/ej2-pdf-data-extract/dist to the public directory using the command:
48+
```bash
49+
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/js/openjpeg
50+
```
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.
4753

4854
## Create a PDF document using TypeScript
4955

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ N> Check out the following topics for including script references in an ASP.NET
3939
* [CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference)
4040
* [NPM Package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm)
4141
* [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)
42-
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`.
4343

4444
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

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ Step 5: **Add script reference** : Add the required scripts using the CDN inside
3636
{% endhighlight %}
3737
{% endtabs %}
3838

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>&reg;</sup> JavaScript PDF library:
40+
* [CDN](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references)
41+
* [NPM Package](https://ej2.syncfusion.com/aspnetmvc/documentation/common/adding-script-references#node-package-manager-npm)
42+
* [CRG](https://ej2.syncfusion.com/aspnetmvc/documentation/common/custom-resource-generator)
43+
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`.
4044

4145
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.
4246

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ Step 3: Create a HTML page (index.html) in `my-app` location and add the CDN lin
3939
{% endhighlight %}
4040
{% endtabs %}
4141

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+
4247
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.
4348

4449
{% tabs %}
@@ -73,12 +78,6 @@ Step 4: **Create a PDF document** : Add the script in `index.html` by creating a
7378
{% endhighlight %}
7479
{% endtabs %}
7580

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-
8281
By executing the program, you will get the PDF document as follows.
8382

8483
![Output PDF document](Getting_started_images/Output.png)

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,17 @@ All the available JS 2 packages are published in `npmjs.com` registry.
2424
npm install @syncfusion/ej2-pdf --save
2525
```
2626
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
27-
2827
* Copy the contents of the openjpeg folder from ./node_modules/@syncfusion/ej2-pdf-data-extract/dist to the public directory using the command:
2928
```bash
3029
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/openjpeg
3130
```
3231
* 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.
3433

3534
**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.
3635

3736
{% tabs %}
38-
{% highlight jsx tabtitle="~/App.jsx" %}
37+
{% highlight html tabtitle="~/App.jsx" %}
3938
import React from 'react';
4039

4140
export default function App() {

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ The Syncfusion<sup>&reg;</sup> TypeScript PDF library is used to create, read, a
1414

1515
This guide explains how to integrate the TypeScript PDF library into an TypeScript application.
1616

17+
## Installing Syncfusion<sup>&reg;</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+
1732
## Dependencies
1833

1934
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
4055
{% endhighlight %}
4156
{% endtabs %}
4257

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-
4958
* Include the following namespaces in `index.ts` file.
5059

5160
{% tabs %}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,17 @@ All the available JS 2 packages are published in `npmjs.com` registry.
4848
npm install @syncfusion/ej2-pdf --save
4949
```
5050
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
51-
5251
* Copy the contents of the openjpeg folder from ./node_modules/@syncfusion/ej2-pdf-data-extract/dist to the public directory using the command:
5352
```bash
5453
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/js/openjpeg
5554
```
5655
* 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.
5857

5958
* **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.
6059

6160
{% tabs %}
62-
{% highlight vue tabtitle="~/App.vue" %}
61+
{% highlight html tabtitle="~/App.vue" %}
6362
<script>
6463
export default {
6564
name: 'App',

0 commit comments

Comments
 (0)