pdf-lib

pdf-lib

pdf-lib.js.org

1

About this website

pdf-lib is a pure JavaScript library for creating and modifying PDF documents in any JavaScript runtime environment, including Node.js, the browser, Deno, and React Native. Created by Andrew Dillon, it distinguishes itself from other PDF libraries by requiring no native dependencies, no server-side processing, and no external tools like wkhtmltopdf or headless browsers. This makes it ideal for both server-side batch processing and client-side PDF generation in web applications. The library provides a comprehensive API for manipulating PDF documents at both the high-level and low-level levels. High-level capabilities include: creating new PDF documents from scratch, adding and configuring pages with custom sizes (supporting standard sizes like A4, Letter, Legal, Tabloid, and custom dimensions), embedding fonts (supporting Standard 14 PDF fonts like Helvetica and Times Roman, as well as custom TrueType, OpenType, and TTC fonts), drawing text with precise positioning, font size, and line height control, drawing vector graphics (lines, rectangles, circles, ellipses, polygons, and custom Bezier paths), embedding images (JPEG, PNG, and JPG formats), filling and stroking paths with RGB, CMYK, or grayscale colors, setting opacity and blending modes, adding hyperlinks and clickable annotations, merging multiple PDF documents into one, splitting PDFs into separate pages, rotating pages, adding watermarks and overlays, and flattening form fields. Low-level access allows direct manipulation of PDF objects, streams, dictionaries, and cross-reference tables. As of 2026, pdf-lib has over 7,000 GitHub stars and is licensed under the MIT license.

Tags & Categories

Categories

Tags

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!