Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-pdf-export

Package Overview
Dependencies
Maintainers
0
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-pdf-export

Syncfusion TypeScript Component


Version published
Weekly downloads
111K
increased by3.53%
Maintainers
0
Weekly downloads
 
Created

What is @syncfusion/ej2-pdf-export?

@syncfusion/ej2-pdf-export is a comprehensive library for creating and manipulating PDF documents in JavaScript. It provides a wide range of functionalities including text, image, and table insertion, as well as support for various PDF features like annotations, bookmarks, and form fields.

What are @syncfusion/ej2-pdf-export's main functionalities?

Create a PDF Document

This feature allows you to create a new PDF document, add a page to it, and draw text on the page. The document is then saved as 'output.pdf'.

const { PdfDocument, PdfPage, PdfGraphics, PdfTextElement } = require('@syncfusion/ej2-pdf-export');

let document = new PdfDocument();
let page = document.pages.add();
let graphics = page.graphics;
let textElement = new PdfTextElement('Hello, World!');
textElement.draw(graphics, { x: 10, y: 10 });
document.save('output.pdf');
document.destroy();

Add Images to PDF

This feature allows you to add images to a PDF document. The image is drawn on the specified coordinates on the page.

const { PdfDocument, PdfPage, PdfGraphics, PdfBitmap } = require('@syncfusion/ej2-pdf-export');

let document = new PdfDocument();
let page = document.pages.add();
let graphics = page.graphics;
let image = new PdfBitmap('path/to/image.jpg');
graphics.drawImage(image, { x: 10, y: 10, width: 100, height: 100 });
document.save('output_with_image.pdf');
document.destroy();

Create Tables in PDF

This feature allows you to create tables within a PDF document. You can define the number of columns and rows, and set the values for each cell.

const { PdfDocument, PdfPage, PdfGrid } = require('@syncfusion/ej2-pdf-export');

let document = new PdfDocument();
let page = document.pages.add();
let grid = new PdfGrid();
grid.columns.add(3);
grid.headers.add(1);
let header = grid.headers.getHeader(0);
header.cells.getCell(0).value = 'Column 1';
header.cells.getCell(1).value = 'Column 2';
header.cells.getCell(2).value = 'Column 3';
let row = grid.rows.addRow();
row.cells.getCell(0).value = 'Row 1, Cell 1';
row.cells.getCell(1).value = 'Row 1, Cell 2';
row.cells.getCell(2).value = 'Row 1, Cell 3';
grid.draw(page, { x: 10, y: 10 });
document.save('output_with_table.pdf');
document.destroy();

Other packages similar to @syncfusion/ej2-pdf-export

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc