Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a485b30
994201-ej2: Started working with EJ2 PDF library.
sameerkhan001 Nov 20, 2025
cea9621
994201-ej2: Completed 3 md files.
sameerkhan001 Nov 21, 2025
bdce0d6
WIP:994201-ej2: Added working with EJ2 document md file.
sameerkhan001 Nov 21, 2025
9b7bf39
994201-ej2: Updated key features.
sameerkhan001 Nov 21, 2025
6299916
994201-ej2: completed document md working page md.
sameerkhan001 Nov 21, 2025
907765a
994201-ej2: Added working with text md file.
sameerkhan001 Nov 24, 2025
47b7697
994201-ej2: Added image md file.
sameerkhan001 Nov 24, 2025
fe49a9c
994201-ej2: Added shape md file.
sameerkhan001 Nov 24, 2025
66d8cdd
994201-ej2: Added annotation md file.
sameerkhan001 Nov 26, 2025
ad0bf65
994201-ej2: Added 2 md files hyperlink and text extraction.
sameerkhan001 Nov 26, 2025
655ded5
994201-ej2: Added templates md file for EJ2 PDF.
sameerkhan001 Nov 27, 2025
49c223a
994201-ej2: Added 3 md files.
sameerkhan001 Nov 27, 2025
cb4182e
994201-ej2: Added form fields md file
sameerkhan001 Nov 27, 2025
e60ed75
994201-ej2: Completed the form fields md file.
sameerkhan001 Nov 28, 2025
ed97d5a
994201-ej2: Added digital signature md files.
sameerkhan001 Nov 28, 2025
f272f1a
994201-ej2: Resolved the CI failures.
sameerkhan001 Nov 28, 2025
e9d2d17
994201-ej2: Resolved CI failures.
sameerkhan001 Nov 28, 2025
62d5683
994201-ej2: Added supported and unsupported EJ2 features.
sameerkhan001 Dec 1, 2025
103bf7e
994201-ej2: Changed proper name.
sameerkhan001 Dec 1, 2025
d4e3d1b
994201-ej2: Added redaction md files
sameerkhan001 Dec 1, 2025
28e433c
Merge branch 'hotfix/hotfix-v31.2.12' of https://github.com/syncfusio…
sameerkhan001 Dec 1, 2025
f5d5230
994201-ej2: Added toc file and list md file.
sameerkhan001 Dec 2, 2025
f7dcd11
994201-ej2: Added proper changes and code.
sameerkhan001 Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2447,6 +2447,31 @@
#ReplaceUsingAutomation-https://github.com/syncfusion-content/flutter-docs/tree/master/Flutter/pdf#
</ul>
</li>
<li>
<a href="/document-processing/pdf/pdf-library/javascript-es6/Overview">JavaScript (ES6)</a>
<ul>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Overview">Overview</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Getting-started">Getting Started</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Open-and-save-PDF-files">Loading and Saving</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-PDF-document">Working with document</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-PDF-Pages">Working with pages</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Text">Working with Text</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Lists">Working with Lists</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Images">Working with Images</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-PDF-Templates">Working with PDF Templates</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Shapes">Working with Shapes</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Annotations">Working with Annotations</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-forms">Working with Forms</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-DigitalSignature">Working with Digital Signature</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Bookmarks">Working with Bookmarks</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-HyperLinks">Working with Hyperlinks</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Layers">Working with Layers</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Named-Destination"> Working with Named-Destination</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Text-Extraction">Working with Text Extraction</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Working-with-Redaction">Working with redaction</a></li>
<li><a href="/document-processing/pdf/pdf-library/javascript-es6/Supported-and-Unsupported-Features">Supported and Unsupported Features</a></li>
</ul>
</li>
</ul>
</li>
<li>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
layout: post
title: Getting started with JavaScript PDF library | Syncfusion
description: Learn how to set up and use the Syncfusion JavaScript PDF library using the EJ2 quickstart, including local resource configuration and module injection.
platform: document-processing
control: PDF
documentation: ug
domainurl: ##DomainURL##
---

# Getting started with JavaScript PDF library

This guide explains how to create the PDF library component and configure its features in TypeScript using the Essential JS 2 [quickstart](https://github.com/SyncfusionExamples/ej2-quickstart-webpack-) seed repository.

> This application is integrated with a webpack configuration (`webpack.config.js`) and uses the latest version of the [webpack-cli](https://webpack.js.org/api/cli/#commands). It requires Node.js `v14.15.0` or higher. For more information, refer to the [webpack getting started guide](https://webpack.js.org/guides/getting-started/).

## Dependencies

The following list of dependencies are required to use the `EJ2 PDF library` component in your application.

```javascript
|-- @syncfusion/ej2-compression
|-- @syncfusion/ej2-base
|-- @syncfusion/ej2-file-utils

```

## Add Syncfusion JavaScript packages

Syncfusion JavaScript (Essential JS 2) packages are available on the [npmjs.com](https://www.npmjs.com/~syncfusionorg) public registry. Install all EJ2 controls with the [@syncfusion/ej2](https://www.npmjs.com/package/@syncfusion/ej2) meta package or install individual control packages.

The quickstart application is preconfigured with [@syncfusion/ej2](https://www.npmjs.com/package/@syncfusion/ej2) in `~/package.json`. Use the following command to install dependencies:

{% tabs %}
{% highlight bash tabtitle="NPM" %}

npm install

{% endhighlight %}
{% endtabs %}

## Create EJ2 PDF with local resources

This example demonstrates how to create a PDF document directly using Syncfusion EJ2 PDF library. A button is provided to trigger the PDF creation process.

{% tabs %}
{% highlight ts tabtitle="index.ts" %}

// Create and render button
let button: Button = new Button();
button.appendTo('#normalbtn');

// Handle click event
button.element.onclick = async () => {
console.log('Start PDF Creation');
createPdf();
};

// Function to create PDF
function createPdf() {
// Create a new PDF document
let document: PdfDocument = new PdfDocument();
// Add a page
const page = document.addPage();
// Get graphics from the page
let graphics = page.graphics;
// Set font
font: PdfStandardFont = new PdfStandardFont(PdfFontFamily.helvetica, 10);
// Draw text
graphics.drawString('Hello World!!!', font, [70, 10, 200, 50], new PdfPen([255, 0, 0], 1), new PdfBrush([0, 0, 255]));
// Save the document
document.save('Output.pdf');
// Close the document
document.destroy();
}

{% endhighlight %}
{% highlight html tabtitle="index.html" %}

<div class="row">
<button id="normalbtn">Create PDF</button>
</div>

{% endhighlight %}
{% endtabs %}

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

![Output EJ2 PDF document](EJ2-images/Helloworld.png)

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
layout: post
title: Open and save PDF files in JavaScript PDF library | Syncfusion
description: Learn to load and save PDFs in Syncfusion JavaScript PDF library using URLs, base64 strings, or byte arrays with server-backed services.
platform: document-processing
control: PDF
documentation: ug
domainurl: ##DomainURL##
---

# Open and save PDF files in JavaScript PDF library

## Opening an existing PDF document

Open an existing PDF document using the `PdfDocument` class with the specified string data.

```javascript
// Load an existing PDF document from string data
let document: PdfDocument = new PdfDocument("Input.pdf");

```

## Opening an existing PDF document from a byte array

Open an existing PDF document using the `PdfDocument` class with the specified byte array.

```javascript
// Load the PDF data from a file
const inputPDFByteArray: Uint8Array = new Uint8Array(fs.readFileSync('Input.pdf'));
// Create a new PdfDocument instance using the byte array
const loadedDocument = new PdfDocument(inputPDFByteArray);
```

## Opening an Encrypted PDF document

Open an encrypted PDF document using the `PdfDocument` class by providing the correct password.

```javascript
// Load an existing PDF document from string data
let document: PdfDocument = new PdfDocument("Input.pdf", "password");
```

## Opening an Encrypted PDF document from a byte array

Open an encrypted PDF document from a byte array using the `PdfDocument` class by providing the correct password.

```javascript
// Load the PDF data from a file
const inputPDFByteArray: Uint8Array = new Uint8Array(fs.readFileSync('Input.pdf'));
// Load an existing PDF document from string data
let document: PdfDocument = new PdfDocument(inputPDFByteArray, "password");
```

## Saving a PDF document

Save the manipulated PDF document using the `Save` method of `PdfDocument` class with the specified string data.

```javascript
// Load an existing PDF document from string data
let document: PdfDocument = new PdfDocument("Input.pdf");
//To-Do some manipulation
//To-Do some manipulation
// Save the PDF document
document.save('Output.pdf');
```

## Saving a PDF Document from a byte array

Open an existing PDF document using the `PdfDocument` class with the specified byte array.

```javascript
// Load the PDF data from a file
const inputPDFByteArray: Uint8Array = new Uint8Array(fs.readFileSync('Input.pdf'));
// Create a new PdfDocument instance using the byte array
const loadedDocument = new PdfDocument(inputPDFByteArray);
//To-Do some manipulation
//To-Do some manipulation
// Save the document
let data: Uint8Array = document.save();
```

## Closing a document

After the document manipulation and save operation are completed, you should close the instance of `PdfDocument`, in order to release all the memory consumed by PDF DOM. The following code example illustrates how to destroy a `PdfDocument` instance.

```javascript
// Load an existing PDF document from string data
let document: PdfDocument = new PdfDocument("Input.pdf");
//To-Do some manipulation
//To-Do some manipulation
// Save the PDF document
document.save('Output.pdf');
// Destroy the document
document.destroy();
```
35 changes: 35 additions & 0 deletions Document-Processing/PDF/PDF-Library/Javascript-es6/Overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: post
title: Overview of the JavaScript PDF Library Component | Syncfusion
description: Learn about the Syncfusion JavaScript PDF library component, its key capabilities, and supported platforms.
platform: document-processing
control: PDF
documentation: ug
domainurl: ##DomainURL##
---

# Overview of the JavaScript PDF library control

The Essential<sup>&reg;</sup> JavaScript PDF library is a feature-rich and high-performance non-UI PDF library that is written natively in JavaScript. It enables you to seamlessly incorporate robust PDF functionalities into your JavaScript applications. The library allows users to read and manipulate PDF documents without requiring Adobe Acrobat.

## Key features

The following are the key features of this library.

* Create PDF documents from scratch with ease.
* Load, edit, and save existing PDF files.
* Open and manipulate password-protected PDF documents.
* Enhance PDFs by adding text, images, shapes, and other graphical elements.
* Add and manage interactive components such as bookmarks, annotations, and form fields.
* Flatten form fields and annotations for a finalized document.
* Import and export form field data and annotations seamlessly.
* Merge multiple PDFs or split a document into separate files.
* Apply text watermarks, image watermarks, and watermark annotations.
* Insert hyperlinks for both web and document navigation.
* Add, remove, or modify bookmarks for better document organization.
* Create, remove, and flatten layers within PDFs.
* Design and apply templates for consistent layouts and branding.
* Digitally sign PDF documents for secure authentication.
* Extract or redact text from PDF files.
* Extract images from PDF documents.
* Redact shapes to protect sensitive graphical content.
Loading