PDF Files Creation via Free JavaScript API

Open Source Pure JavaScript Library supports PDF Documents generation and Manipulation for Node and web browser.

PDFMake is a powerful open source JavaScript library that enables software developers to handle tasks related to PDF documents generation and manipulation using JavaScript commands. The great thing about the library is that you can easily specify the data for PDF generation using a document definition object format.

PDFmake library has incorporated support for several important features related to PDF document handling such as adding images and text content to PDF documents, line wrapping, text alignment, inserting and managing tables, using styles, adding page headers and footers, page orientation, and margin support, font, and graphics embedding, tables of content generation, page break support and many more.

The library is stable and can be easily used on the client as well as server-side. It is runnable in the browser and in Node.js. It supports several popular browsers such as Internet Explorer 10+, Edge 12+, Firefox, Chrome, Opera, Safari, and so on.

Previous Next

Getting Started with PDFMake

PDFMake is available at npm, You can easily download it and install it on your machine. Please use the following command for smooth installation.

Install PDFMake using bower

bower install pdfmake

Generate PDF Files using JavaScript Library

The Open source JavaScript library PDFMake makes it easy for software programmers to generate PDF documents inside their own applications using JavaScript code. The library has given a complete set of features for working with PDF files, such as choosing fonts types with size, color, and formatting, add a new page, insert columns, add and apply styles, inserting tables, delete unwanted pages, and many more

Add Headers & Footers to PDF File

Headers and footers are useful parts of PDF documents and can be used to include that part of the content that users want to appear on e page of a document such as an author name, document title, page numbers, logo, and much more. The JavaScript library PDFMake has provided complete support for adding and modifying headers & footers to a PDF document. It supports features like adding repetitive header/footer, insert images in a header/footer, add page numbers, and much more.

Inserting Images to PDF Files

The Open source JavaScript library PDFMake has provided complete support for adding as well as modifying images inside PDF files using JavaScript commands. The library has provided features for setting image width and height, fit an image inside a rectangle, calling an image via URLs, scale the image proportionally, image stretching. If you want to use the same image in multiple nodes, you need to put it in the image dictionary and just call it by its name.

Page Orientation and Margin Support

The free JavaScript library PDFMake has included support setting page size, page orientation as well as page margins inside JavaScript apps. To set the page size you need to provide the wide and height of the new page. By default, the library uses portrait page orientation but can easily set it to landscape with one-liner code. It also provides support for setting page margins and allows users to dynamically control page breaks. It supports left, top, right, bottom as well as horizontal, vertical margins.