# hopding/pdf-lib

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hopding-pdf-lib).**

8,515 stars · 894 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/Hopding/pdf-lib
- Homepage: https://pdf-lib.js.org
- awesome-repositories: https://awesome-repositories.com/repository/hopding-pdf-lib.md

## Description

pdf-lib is a JavaScript PDF manipulation library used for creating, modifying, and editing PDF documents programmatically. It functions as a cross-runtime tool compatible with Node, Browser, Deno, and mobile JavaScript environments.

The library provides a programmatic interface for document editing and form generation. It supports building interactive PDF forms, populating existing fields with custom data, and flattening forms into static content.

Its broader capabilities include generating new documents from scratch, rearranging or copying pages between files, and managing document metadata. It also allows for drawing visual content such as text, images, and vector graphics, as well as embedding custom fonts and attaching external files.

## Tags

### Content Management & Publishing

- [PDF Document Generation](https://awesome-repositories.com/f/content-management-publishing/pdf-document-generation.md) — Provides a programmatic interface for creating new PDF files from scratch by defining their binary structure. ([source](https://github.com/hopding/pdf-lib#readme))
- [PDF Form Filling](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/content-management-platforms/enterprise-specialized-systems/document-management-systems/pdf-form-filling.md) — Detects and populates existing fillable PDF form fields with custom data. ([source](https://github.com/hopding/pdf-lib#readme))
- [Page Insertion](https://awesome-repositories.com/f/content-management-publishing/page-insertion.md) — Allows adding, removing, and inserting pages at specific positions within a PDF document structure. ([source](https://github.com/hopding/pdf-lib#readme))
- [PDF Binary Encoders](https://awesome-repositories.com/f/content-management-publishing/pdf-binary-encoders.md) — Directly implements the binary PDF specification for encoding content streams and structural elements.
- [PDF Content Editing](https://awesome-repositories.com/f/content-management-publishing/pdf-content-editing.md) — Provides programmatic capabilities to modify text and images within existing PDF files. ([source](https://github.com/hopding/pdf-lib#readme))
- [PDF Document Management](https://awesome-repositories.com/f/content-management-publishing/pdf-document-management.md) — Offers a comprehensive toolkit for generating, editing, and manipulating PDF pages and metadata. ([source](https://github.com/hopding/pdf-lib#readme))
- [PDF Manipulation Libraries](https://awesome-repositories.com/f/content-management-publishing/pdf-manipulation-libraries.md) — Provides a low-level JavaScript library for modifying PDF byte streams and manipulating document structures.
- [Automated Document Workflows](https://awesome-repositories.com/f/content-management-publishing/automated-document-workflows.md) — Automates the generation and editing of PDF documents within application workflows.
- [Form Flattening](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/content-management-platforms/enterprise-specialized-systems/document-management-systems/pdf-form-filling/form-flattening.md) — Converts interactive PDF form fields into static content to prevent further editing. ([source](https://github.com/hopding/pdf-lib#readme))
- [PDF Editors](https://awesome-repositories.com/f/content-management-publishing/content-processing-transformation/document-processing-conversion/document-processing-tools/pdf-manipulation-utilities/pdf-editors.md) — Offers a programmatic interface to modify PDF metadata, embed fonts, and adjust document content.
- [Incremental PDF Updates](https://awesome-repositories.com/f/content-management-publishing/incremental-pdf-updates.md) — Modifies PDF files by appending new data to the end of the file to maintain structural integrity.

### Data & Databases

- [PDF Object Graph Representations](https://awesome-repositories.com/f/data-databases/custom-data-fields/custom-data-object-definitions/object-representation-mapping/pdf-object-graph-representations.md) — Maintains a graph of unique PDF objects and cross-reference tables to allow non-destructive editing.

### Software Engineering & Architecture

- [Cross-Platform Runtimes](https://awesome-repositories.com/f/software-engineering-architecture/cross-platform-runtimes.md) — Ensures consistent PDF processing logic across diverse environments including Node, Browser, Deno, and React Native.

### User Interface & Experience

- [Form Creators](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interactive-pdf-form-fields/form-creators.md) — Supports building interactive PDF forms with buttons, checkboxes, and dropdowns from scratch. ([source](https://github.com/hopding/pdf-lib#readme))
- [PDF Form and Annotation Tools](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/pdf-form-and-annotation-tools.md) — Combines the ability to build interactive form fields and manage PDF document content for data collection.
- [Custom Font Loading](https://awesome-repositories.com/f/user-interface-experience/font-management/dynamic-font-loading/custom-font-loading.md) — Loads and registers external font data from memory streams for use in PDF rendering. ([source](https://github.com/hopding/pdf-lib#readme))
- [Font Subsetting Engines](https://awesome-repositories.com/f/user-interface-experience/styling-theming-systems/typography-and-iconography/font-processing/font-subsetting-engines.md) — Extracts only the characters used in a document from font files to optimize the final file size.

### Part of an Awesome List

- [PDF Metadata Managers](https://awesome-repositories.com/f/awesome-lists/data/metadata-and-file-analysis/pdf-metadata-managers.md) — Provides tools for reading and editing the internal property fields and viewer preferences of PDF documents. ([source](https://github.com/hopding/pdf-lib#readme))
- [Document Processing](https://awesome-repositories.com/f/awesome-lists/devtools/document-processing.md) — Creation and modification of PDF documents.

### DevOps & Infrastructure

- [Cross-Platform PDF Engines](https://awesome-repositories.com/f/devops-infrastructure/execution-environments/cross-platform-pdf-engines.md) — Implements a PDF engine that executes consistently across Node.js, Browser, Deno, and mobile environments.

### Graphics & Multimedia

- [PDF Vector Graphics](https://awesome-repositories.com/f/graphics-multimedia/pdf-vector-graphics.md) — Enables drawing text, images, and vector graphics directly onto PDF pages for custom visual layouts. ([source](https://github.com/hopding/pdf-lib#readme))
