Skip to content

Commit bea1790

Browse files
committed
Merge branch '994201-dev' of https://github.com/syncfusion-content/document-processing-docs into 994201-dev
2 parents c33b8fc + bedd70b commit bea1790

11 files changed

+416
-1188
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ import { PdfDocument, PdfPage, PdfStandardFont, PdfPen, PdfBrush } from '@syncfu
7070

7171
document.getElementById('normalButton').onclick = (): void => {
7272
// Create a new PDF document
73-
var pdf = new PdfDocument();
73+
const document = new PdfDocument();
7474
// Add a new page
75-
var page = pdf.addPage();
75+
const page: PdfPage = document.addPage();
7676
// Get graphics from the page
77-
let graphics = page.graphics;
77+
const graphics: PdfGraphics = page.graphics;
7878
// Set font
79-
var font = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, pdf.PdfFontStyle.regular);
79+
const font: PdfStandardFont = document.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
8080
// Create a new black brush
81-
var brush = new pdf.PdfBrush({r: 0, g: 0, b: 0});
81+
const brush = new PdfBrush({r: 0, g: 0, b: 0});
8282
// Draw text
8383
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
8484
// Save and download PDF
85-
pdf.save('Output.pdf');
85+
document.save('Output.pdf');
8686
// Destroy the PDF document instance
87-
pdf.destroy();
87+
document.destroy();
8888
});
8989
};
9090

@@ -101,6 +101,4 @@ ng serve --open
101101

102102
By executing the program, you will get the PDF document as follows.
103103

104-
![Output PDF document](Getting_started_images/Output.png)
105-
106-
104+
![Output PDF document](Getting_started_images/Output.png)

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
layout: post
3-
title: Create or Generate PDF file in ASP.NET Core | Syncfusion
3+
title: Create or Generate PDF in ASP.NET Core | Syncfusion
44
description: Learn how to create or generate a PDF file in ASP.NET Core applications with easy steps using Syncfusion JavaScript PDF library without depending on Adobe.
55
platform: document-processing
66
control: PDF
77
documentation: ug
88
keywords: .net core create pdf, edit pdf, merge, pdf form, fill form, digital sign, table, javascript, dotnet core pdf, asp generate pdf, aspx generate pdf
99
---
1010

11-
# Create or Generate PDF file in ASP.NET Core
11+
# Create or Generate PDF in ASP.NET Core
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, forms, and secure PDF files.
1414

@@ -53,15 +53,15 @@ This guide explains how to integrate the JavaScript PDF library into an ASP.NET
5353
<script>
5454
document.getElementById('btnCreatePdf').addEventListener('click', function () {
5555
// Create a new PDF document
56-
var pdf = new ej.pdf.PdfDocument();
56+
let pdf = new ej.pdf.PdfDocument();
5757
// Add a new page
58-
var page = pdf.addPage();
58+
let page: ej.pdf.PdfPage = document.addPage();
5959
// Get graphics from the page
60-
let graphics = page.graphics;
60+
let graphics: ej.pdf.PdfGraphics = page.graphics;
6161
// Set font
62-
var font = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
62+
let font: ej.pdf.PdfStandardFont = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
6363
// Create a new black brush
64-
var brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
64+
let brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
6565
// Draw text
6666
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
6767
// Save and download PDF

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ This guide explains how to integrate the JavaScript PDF library into an ASP.NET
5353
<script>
5454
document.getElementById('btnCreatePdf').addEventListener('click', function () {
5555
// Create a new PDF document
56-
var pdf = new ej.pdf.PdfDocument();
56+
let pdf = new ej.pdf.PdfDocument();
5757
// Add a new page
58-
var page = pdf.addPage();
58+
let page: ej.pdf.PdfPage = document.addPage();
5959
// Get graphics from the page
60-
let graphics = page.graphics;
60+
let graphics: ej.pdf.PdfGraphics = page.graphics;
6161
// Set font
62-
var font = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
62+
let font: ej.pdf.PdfStandardFont = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
6363
// Create a new black brush
64-
var brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
64+
let brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
6565
// Draw text
6666
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
6767
// Save and download PDF

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ The Essential JS 2 for JavaScript (global script) is an ES5 formatted pure JavaS
5757
<script>
5858
document.getElementById('btnCreatePdf').addEventListener('click', function () {
5959
// Create a new PDF document
60-
var pdf = new ej.pdf.PdfDocument();
60+
let pdf = new ej.pdf.PdfDocument();
6161
// Add a new page
62-
var page = pdf.addPage();
62+
let page: ej.pdf.PdfPage = document.addPage();
6363
// Get graphics from the page
64-
let graphics = page.graphics;
64+
let graphics: ej.pdf.PdfGraphics = page.graphics;
6565
// Set font
66-
var font = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
66+
let font: ej.pdf.PdfStandardFont = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
6767
// Create a new black brush
68-
var brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
68+
let brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
6969
// Draw text
7070
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
7171
// Save and download PDF
@@ -81,5 +81,4 @@ The Essential JS 2 for JavaScript (global script) is an ES5 formatted pure JavaS
8181

8282
By executing the program, you will get the PDF document as follows.
8383

84-
![Output PDF document](Getting_started_images/Output.png)
85-
84+
![Output PDF document](Getting_started_images/Output.png)

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ keywords: javascript, pdf, script, react
1010

1111
# Create or Generate PDF file in React
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, fill 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

15-
This guide explains how to integrate the Javascript PDF library into an React application.
15+
This guide explains how to integrate the JavaScript PDF library into an React application.
1616

1717
## Add script reference
1818

@@ -21,12 +21,12 @@ This guide explains how to integrate the Javascript PDF library into an React ap
2121
```
2222
<head>
2323
...
24-
<!-- Syncfusion Javascript PDF Library (CDN) -->
24+
<!-- Syncfusion JavaScript PDF Library (CDN) -->
2525
<script src="https://cdn.syncfusion.com/ej2/31.2.15/dist/ej2.min.js"></script>
2626
</head>
2727
```
2828

29-
**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.
29+
**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.
3030

3131
{% tabs %}
3232
{% highlight c# tabtitle="~/App.jsx" %}
@@ -36,15 +36,15 @@ import React from 'react';
3636
export default function App() {
3737
const createPdf = () => {
3838
// Create a new PDF document
39-
var pdf = new window.ej.pdf.PdfDocument();
39+
let pdf = new ej.pdf.PdfDocument();
4040
// Add a new page
41-
var page = pdf.addPage();
41+
let page: ej.pdf.PdfPage = document.addPage();
4242
// Get graphics from the page
43-
let graphics = page.graphics;
43+
let graphics: ej.pdf.PdfGraphics = page.graphics;
4444
// Set font
45-
var font = pdf.embedFont(window.ej.pdf.PdfFontFamily.helvetica, 36,window.ej.pdf.PdfFontStyle.regular);
45+
let font: ej.pdf.PdfStandardFont = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
4646
// Create a new black brush
47-
var brush = new window.ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
47+
let brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
4848
// Draw text
4949
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
5050
// Save and download PDF

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ import { PdfDocument, PdfPage, PdfStandardFont, PdfPen, PdfBrush } from '@syncfu
5858
{% highlight html tabtitle="index.ts" %}
5959

6060
document.getElementById('normalButton').onclick = (): void => {
61-
// Create a new PDF document
62-
var pdf = new pdf.PdfDocument();
61+
// Create a new PDF document
62+
let pdf = new PdfDocument();
6363
// Add a new page
64-
var page = pdf.addPage();
64+
let page: PdfPage = document.addPage();
6565
// Get graphics from the page
66-
let graphics = page.graphics;
66+
let graphics: PdfGraphics = page.graphics;
6767
// Set font
68-
var font = pdf.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
68+
let font: PdfStandardFont = pdf.embedFont(PdfFontFamily.helvetica, 36, PdfFontStyle.regular);
6969
// Create a new black brush
70-
var brush = new pdf.PdfBrush({r: 0, g: 0, b: 0});
70+
let brush = new PdfBrush({r: 0, g: 0, b: 0});
7171
// Draw text
7272
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
7373
// Save and download PDF
@@ -89,5 +89,4 @@ npm start
8989

9090
By executing the program, you will get the PDF document as follows.
9191

92-
![Output PDF document](Getting_started_images/Output.png)
93-
92+
![Output PDF document](Getting_started_images/Output.png)

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ export default {
6363
methods: {
6464
createPdf() {
6565

66-
// Create a new PDF document
67-
const pdf = new window.ej.pdf.PdfDocument();
68-
// Add a new page
69-
const page = pdf.addPage() as PdfPage;
70-
// Get graphics from the page
71-
const graphics = page.graphics;
72-
// Set font (Syncfusion EJ2 API)
73-
const font = new PdfStandardFont(window.ej.pdf.PdfFontFamily.helvetica, 36, window.ej.pdf.PdfFontStyle.regular);
74-
// Create a new black brush (RGB array)
75-
const brush = new window.ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
76-
// Draw text inside a rectangle [x, y, width, height]
77-
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
78-
// Save and download PDF
79-
pdf.save('Output.pdf');
80-
// Destroy the PDF document instance
81-
pdf.destroy();
66+
// Create a new PDF document
67+
const pdf = new ej.pdf.PdfDocument();
68+
// Add a new page
69+
const page: ej.pdf.PdfPage = document.addPage();
70+
// Get graphics from the page
71+
const graphics: ej.pdf.PdfGraphics = page.graphics;
72+
// Set font
73+
const font: ej.pdf.PdfStandardFont = pdf.embedFont(ej.pdf.PdfFontFamily.helvetica, 36, ej.pdf.PdfFontStyle.regular);
74+
// Create a new black brush
75+
const brush = new ej.pdf.PdfBrush({r: 0, g: 0, b: 0});
76+
// Draw text
77+
graphics.drawString('Hello World!!!', font, {x: 20, y: 20, width: graphics.clientSize.width - 20, height: 60}, brush);
78+
// Save and download PDF
79+
pdf.save('Output.pdf');
80+
// Destroy the PDF document instance
81+
pdf.destroy();
8282

8383
}
8484
}

0 commit comments

Comments
 (0)