Skip to content

Commit ac7e951

Browse files
SF2381sameerkhan001
authored andcommitted
PDF contents updated
1 parent 4bb0e8e commit ac7e951

File tree

7 files changed

+73
-36
lines changed

7 files changed

+73
-36
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,23 @@ import { PdfDocument, PdfPage, PdfStandardFont, PdfPen, PdfBrush } from '@syncfu
8282
{% tabs %}
8383
{% highlight ts tabtitle="app.component.ts" %}
8484
document.getElementById('normalButton').onclick = (): void => {
85-
// Create a new PDF document
86-
const document = new PdfDocument();
87-
// Add a new page
88-
const page: PdfPage = document.addPage();
89-
// Get graphics from the page
90-
const graphics: PdfGraphics = page.graphics;
91-
// Set font
92-
const font: PdfStandardFont = document.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
93-
// Create a new black brush
94-
const brush = new PdfBrush({r: 0, g: 0, b: 0});
95-
// Draw text
96-
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
97-
// Save and download PDF
98-
document.save('Output.pdf');
99-
// Destroy the PDF document instance
100-
document.destroy();
101-
};
85+
// Create a new PDF document
86+
const document = new PdfDocument();
87+
// Add a new page
88+
const page: PdfPage = document.addPage();
89+
// Get graphics from the page
90+
const graphics: PdfGraphics = page.graphics;
91+
// Set font
92+
const font: PdfStandardFont = document.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
93+
// Create a new black brush
94+
const brush = new PdfBrush({r: 0, g: 0, b: 0});
95+
// Draw text
96+
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
97+
// Save and download PDF
98+
document.save('Output.pdf');
99+
// Destroy the PDF document instance
100+
document.destroy();
101+
};
102102
{% endhighlight %}
103103
{% endtabs %}
104104

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,18 @@ Step 5: **Add script reference** : Add the required scripts using the CDN inside
3434
</head>
3535
{% endhighlight %}
3636
{% endtabs %}
37-
37+
38+
N> Check out the following topics for including script references in an ASP.NET Core application to enable PDF creation using the Syncfusion<sup style="font-size:70%">®</sup> JavaScript PDF library:
39+
* [CDN](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#cdn-reference)
40+
* [NPM Package](https://ej2.syncfusion.com/aspnetcore/documentation/common/adding-script-references#node-package-manager-npm)
41+
* [CRG](https://ej2.syncfusion.com/aspnetcore/documentation/common/custom-resource-generator)
42+
43+
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`.
44+
***
45+
46+
Would you like me to **reformat this into a proper Syncfusion documentation style note block** (with icons and emphasis), or **convert it into a step-by-step guide for adding script references**?
47+
48+
3849
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.
3950

4051
{% tabs %}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ Step 5: **Add script reference** : Add the required scripts using the CDN inside
3333
<!-- Syncfusion JavaScript PDF Library (CDN) -->
3434
<script src="https://cdn.syncfusion.com/ej2/31.2.15/dist/ej2.min.js"></script>
3535
</head>
36-
3736
{% endhighlight %}
3837
{% endtabs %}
39-
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`.
40+
4041
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.
4142

4243
{% tabs %}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ Step 4: **Create a PDF document** : Add the script in `index.html` by creating a
7474
{% endhighlight %}
7575
{% endtabs %}
7676

77+
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:
78+
* `openjpeg.js`
79+
* `openjpeg.wasm`
80+
81+
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.
82+
7783
By executing the program, you will get the PDF document as follows.
7884

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

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

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

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

17-
## Add script reference
17+
## Installing Syncfusion<sup>&reg;</sup> JavaScript PDF package
1818

19-
* Add the required scripts using the CDN inside the `<head>` of `public/index.html` using the following code.
19+
All the available JS 2 packages are published in `npmjs.com` registry.
2020

21-
```javascript
22-
<head>
23-
<!-- Syncfusion JavaScript PDF Library (CDN) -->
24-
<script src="https://cdn.syncfusion.com/ej2/31.2.15/dist/ej2.min.js"></script>
25-
</head>
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+
28+
* Copy the contents of the openjpeg folder from ./node_modules/@syncfusion/ej2-pdf-data-extract/dist to the public directory using the command:
29+
```bash
30+
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/openjpeg
2631
```
32+
* 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.
2734

2835
**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.
2936

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ The following list of dependencies are required to use the `TypeScript PDF libra
4040
{% endhighlight %}
4141
{% endtabs %}
4242

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+
4349
* Include the following namespaces in `index.ts` file.
4450

4551
{% tabs %}

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,23 @@ When creating a new project, choose the option `Default ([Vue 2] babel, es-lint)
3838

3939
Once the `quick start` project is set up with default settings, proceed to add Syncfusion<sup style="font-size:70%">&reg;</sup> components to the project.
4040

41-
* **Add script reference** : Add the required scripts using the CDN inside the `<head>` of `index.html` as follows:
41+
* **Installing Syncfusion<sup>&reg;</sup> JavaScript PDF package**
4242

43-
{% tabs %}
44-
{% highlight html tabtitle="~/index.html" %}
45-
<head>
46-
<!-- Syncfusion EJ2 PDF Library (CDN) -->
47-
<script src="https://cdn.syncfusion.com/ej2/31.2.15/dist/ej2.min.js"></script>
48-
</head>
43+
All the available JS 2 packages are published in `npmjs.com` registry.
4944

50-
{% endhighlight %}
51-
{% endtabs %}
45+
* To install PDF component, use the following command.
46+
47+
```bash
48+
npm install @syncfusion/ej2-pdf --save
49+
```
50+
N> For data extraction features, you need to install the `@syncfusion/ej2-pdf-data-extract` package as an add-on.
51+
52+
* Copy the contents of the openjpeg folder from ./node_modules/@syncfusion/ej2-pdf-data-extract/dist to the public directory using the command:
53+
```bash
54+
cp -R ./node_modules/@syncfusion/ej2-pdf-data-extract/dist/openjpeg public/js/openjpeg
55+
```
56+
* 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.
5258

5359
* **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.
5460

0 commit comments

Comments
 (0)