🌐
Mozilla
mozilla.github.io › pdf.js
PDF.js - Home
A general-purpose, web standards-based platform for parsing and rendering PDFs.
API
A general-purpose, web standards-based platform for parsing and rendering PDFs.
Examples
This tutorial shows how PDF.js can be used as a library in a web browser.
Policy Templates for Firefox
Note: As of Firefox 140, this policy no longer completely disables PDF.js; it changes the handler to send PDF files to the operating system. Embedded PDF files are shown in the browser.
Getting started
A general-purpose, web standards-based platform for parsing and rendering PDFs.

PDF viewer in JavaScript included in Mozilla Firefox

PDF.js is a JavaScript library that renders Portable Document Format (PDF) files using the web standards-compliant HTML5 Canvas. The project is led by the Mozilla Corporation after Andreas Gal launched it (initially … Wikipedia
Factsheet
Original author Andreas Gal
Developer Mozilla
Initial release 2 July 2011 (2011-07-02)
Factsheet
Original author Andreas Gal
Developer Mozilla
Initial release 2 July 2011 (2011-07-02)
🌐
npm
npmjs.com › package › pdfjs-lib
pdfjs-lib - npm
January 12, 2023 - This is a pre-built version of the PDF.js source code. It is automatically generated by the build scripts. For usage with older browsers or environments, without support for modern features such as optional chaining, nullish coalescing, and private class fields/methods; please see the legacy/ folder. See https://github.com/mozilla/pdf.js for learning and contributing.
      » npm install pdfjs-lib
    
Published   Jan 12, 2023
Version   0.0.149
Discussions

pdf lib.js - How to use Hopding / pdf-lib with pure javascript? (Without using a package manager) - Stack Overflow
How can I use Hopding/pdf-lib with pure javascript without using node or any other package manager? I have noticed that they have mentioned supporting pure JavaScript. But not mentioned how? I sear... More on stackoverflow.com
🌐 stackoverflow.com
Convert HTML to PDF, any client side js libraries?
jsPDF might be what you are looking for. More on reddit.com
🌐 r/javascript
19
17
February 26, 2016
Working With PDFs in Node.js Using pdf-lib
Working With PDFs in Node.js Using pdf-libthecodebarbarian.com/workin... 1 point · 0 comments · r/RCBRedditBot Posted by u/totally_100_human ... Reddit Inc © 2022. More on reddit.com
🌐 r/node
Converting text (or html) into a pdf file in Node.js
https://pdfkit.org/ More on reddit.com
🌐 r/node
9
0
June 11, 2024
🌐
PDF-LIB
pdf-lib.js.org
PDF-LIB · Create and modify PDF documents in any ... - JS.ORG
Create and modify PDF documents in any JavaScript environment.
🌐
GitHub
github.com › mozilla › pdf.js
GitHub - mozilla/pdf.js: PDF Reader in JavaScript
To use PDF.js in a web application you can choose to use a pre-built version of the library or to build it from source. We supply pre-built versions for usage with NPM under the pdfjs-dist name.
Starred by 52.4K users
Forked by 10.5K users
Languages   JavaScript 71.3% | Fluent 25.5% | CSS 2.2%
🌐
npm
npmjs.com › package › pdf-lib
pdf-lib - npm
pdf-lib can create, fill, and read PDF form fields. The following field types are supported: ... See the form creation and form filling usage examples for code samples. Tests 1, 14, 15, 16, and 17 in the complete examples contain working example ...
      » npm install pdf-lib
    
Published   Nov 06, 2021
Version   1.17.1
Author   Andrew Dillon
🌐
npm
npmjs.com › package › pdfjs-dist
pdfjs-dist - npm
2 weeks ago - PDF.js is a Portable Document Format (PDF) library that is built with HTML5.
      » npm install pdfjs-dist
    
Published   Nov 29, 2025
Version   5.4.449
Find elsewhere
🌐
PDF-LIB
pdf-lib.js.org › docs › api
pdf-lib · PDF-LIB
pdf-lib · BlendMode · ColorTypes · Duplex · ImageAlignment · LineCapStyle · LineJoinStyle · NonFullScreenPageMode · ParseSpeeds · PrintScaling · ReadingDirection · RotationTypes · StandardFonts · TextAlignment · TextRenderingMode · PDFButton · PDFCheckBox ·
🌐
Mozilla
mozilla.github.io › pdf.js › getting_started
PDF.js - Getting Started
A general-purpose, web standards-based platform for parsing and rendering PDFs.
🌐
Nutrient
nutrient.io › blog › sdk › how to build a javascript pdf editor
JavaScript PDF editor tutorial using pdf‑lib
November 4, 2024 - pdf-lib(opens in a new tab) is a versatile JavaScript library for creating and modifying PDF documents in any JavaScript environment, including browsers, Node.js, Deno, and React Native.
🌐
Nutrient
nutrient.io › blog › sdk › complete guide to pdfjs
Complete guide to PDF.js
August 11, 2025 - PDF.js is Mozilla’s open source JavaScript library for rendering PDFs in browsers without plugins. This guide covers PDF.js setup, rendering with the Canvas API, navigation controls, zoom functionality, and handling basic annotations. However, for enterprise applications requiring advanced features, high performance, and dedicated support, Nutrient Web SDK is the ideal solution.
🌐
GitHub
github.com › rivy › js.pdf-lib
rivy/js.pdf-lib: Create and modify PDF documents in any ...
Some of the code for stream decoding was ported directly to TypeScript for use in pdf-lib. jspdf is a PDF generation library for the browser.
Author   rivy
🌐
SourceForge
sourceforge.net › projects › pdf-js.mirror
PDF.js download | SourceForge.net
November 2, 2025 - A PDF Reader in JavaScript. PDF.js is a web standards-based platform for parsing and rendering Portable Document Formats (PDFs). Open source and built with HTML5, this PDF viewer is supported by a great community and Mozilla Labs.
🌐
Wikipedia
en.wikipedia.org › wiki › PDF.js
PDF.js - Wikipedia
July 18, 2025 - PDF.js is a JavaScript library that renders Portable Document Format (PDF) files using the web standards-compliant HTML5 Canvas.
🌐
PDF.js Express
pdfjs.express
PDF.js Viewer: Annotate, Form Fill | Easy Setup | PDF.js Express
Form Filling Library · Real-time Collaboration · Customize your PDF.js Viewer
🌐
Honeybadger
honeybadger.io › blog › pdf-node
Managing PDFs in Node.js with pdf-lib - Honeybadger Developer Blog
November 16, 2023 - Effortlessly manage PDFs in Node.js: Learn how to modify, merge, extract, and protect content using the powerful pdf-lib library for streamlined document handling.
Top answer
1 of 1
2

You can use the UMD Module as mentioned in their GitHub page. Here are some of the useful information I extracted from their GitHub page.

UMD Module

You can also download pdf-lib as a UMD module from unpkg or jsDelivr. The UMD builds have been compiled to ES5, so they should work in any modern browser. UMD builds are useful if you aren't using a package manager or module bundler. For example, you can use them directly in the tag of an HTML page.

The following builds are available:

  • https://unpkg.com/pdf-lib/dist/pdf-lib.js
  • https://unpkg.com/pdf-lib/dist/pdf-lib.min.js
  • https://cdn.jsdelivr.net/npm/pdf-lib/dist/pdf-lib.js
  • https://cdn.jsdelivr.net/npm/pdf-lib/dist/pdf-lib.min.js

NOTE: if you are using the CDN scripts in production, you should include a specific version number in the URL, for example:

  • https://unpkg.com/[email protected]/dist/pdf-lib.min.js
  • https://cdn.jsdelivr.net/npm/[email protected]/dist/pdf-lib.min.js

Example:

<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://unpkg.com/pdf-lib"></script>
  </head>

  <body>
    <div style="display: flex; width: 100%; height: 100%; flex-direction: column; overflow: hidden;">
        <iframe id="pdf" style="flex-grow: 1; border: none; margin: 0; padding: 0;"></iframe>
    </div>
  </body>
  <script type="text/javascript" src="https://unpkg.com/[email protected]/dist/pdf-lib.min.js"></script>
  <script>
    createPdf();
    async function createPdf() {
      const pdfDoc = await PDFLib.PDFDocument.create();
      const page = pdfDoc.addPage([350, 400]);
      page.moveTo(110, 200);
      page.drawText('Hello World!');
      const pdfDataUri = await pdfDoc.saveAsBase64({ dataUri: true
     });
      document.getElementById('pdf').src = pdfDataUri;
    }
  </script>
</html>
🌐
DEV Community
dev.to › handdot › generate-a-pdf-in-js-summary-and-comparison-of-libraries-3k0p
A full comparison of 6 JS libraries for generating PDFs - DEV Community
March 22, 2022 - As for PDFKit the APIs provided have an imperative pattern, with the result that creating a complex layout tend to be very hard. Embedding fonts it’s not difficult but needs an extra step: converting the fonts to TTF files. jsPDF is not the easiest library to master, but the documentation is very rich so you’ll not encounter any particular obstacle while working with it.
🌐
Mozilla
mozilla.github.io › pdf.js › examples
PDF.js - Examples
This tutorial shows how PDF.js can be used as a library in a web browser.
🌐
GitHub
github.com › Hopding › pdf-lib
Hopding/pdf-lib: Create and modify PDF documents in any ...
pdf-lib can create, fill, and read PDF form fields. The following field types are supported: ... See the form creation and form filling usage examples for code samples. Tests 1, 14, 15, 16, and 17 in the complete examples contain working example ...
Starred by 8.1K users
Forked by 827 users
Languages   TypeScript 80.9% | HTML 9.9% | JavaScript 8.5% | Objective-C 0.3% | CSS 0.2% | Starlark 0.1% | Java 0.1%
🌐
cdnjs
cdnjs.com › home › libraries › pdf-lib
pdf-lib - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
https://pdf-lib.js.org/ Tags: pdf-lib, pdf, document, create, modify, creation, modification, edit, editing, typescript, javascript, library · Version · 1.17.1 · Loading... Asset Type · All · Loading... https://cdnjs.cloudflare.com/ajax/libs/pdf-lib/1.17.1/pdf-lib.min.js ·