🌐
GitHub
github.com › Hopding › pdf-lib
GitHub - Hopding/pdf-lib: Create and modify PDF documents in any JavaScript environment
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 829 users
Languages   TypeScript 80.9% | HTML 9.9% | JavaScript 8.5% | Objective-C 0.3% | CSS 0.2% | Starlark 0.1% | Java 0.1%
🌐
GitHub
github.com › rivy › js.pdf-lib
GitHub - rivy/js.pdf-lib: Create and modify PDF documents in any JavaScript environment
This library was immensely helpful as a reference and existence proof when creating pdf-lib. pdfkit's code for font embedding, PNG embedding, and JPG embedding was especially useful. pdf.js is a PDF rendering library for the Browser.
Author   rivy
🌐
GitHub
github.com › mozilla › pdf.js
GitHub - mozilla/pdf.js: PDF Reader in JavaScript
PDF Reader in JavaScript. Contribute to mozilla/pdf.js development by creating an account on GitHub.
Starred by 52.5K users
Forked by 10.5K users
Languages   JavaScript 71.1% | Fluent 25.5% | CSS 2.3% | HTML 1.1%

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)
🌐
Mozilla
mozilla.github.io › pdf.js
PDF.js - Home
A general-purpose, web standards-based platform for parsing and rendering PDFs.
🌐
GitHub
github.com › topics › pdf-lib
pdf-lib · GitHub Topics · GitHub
Open-source PDF generation library built with TypeScript and React. Features a WYSIWYG template designer, PDF viewer, and powerful generation capabilities. Create custom PDFs effortlessly in both browser and Node.js environments.
🌐
PDF-LIB
pdf-lib.js.org
PDF-LIB · Create and modify PDF documents in any JavaScript environment.
# With npm npm install --save pdf-lib # With yarn yarn add pdf-lib
🌐
GitHub
github.com › cantoo-scribe › pdf-lib
GitHub - cantoo-scribe/pdf-lib: Create and modify PDF documents in any JavaScript environment
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 274 users
Forked by 55 users
Languages   TypeScript 71.2% | HTML 21.6% | JavaScript 6.7% | Objective-C 0.2% | CSS 0.1% | Starlark 0.1% | Java 0.1%
🌐
GitHub
github.com › pdfme › pdf-lib
GitHub - pdfme/pdf-lib: Create and modify PDF documents in any JavaScript environment
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 16 users
Forked by 7 users
Languages   TypeScript 71.1% | HTML 21.5% | JavaScript 6.8% | Objective-C 0.2% | CSS 0.2% | Starlark 0.1% | Java 0.1%
Find elsewhere
🌐
Mozilla
mozilla.github.io › pdf.js › examples
PDF.js - Examples
Remember though that PDF.js uses promises, and the above will return a PDFDocumentLoadingTask instance that has a promise property which is resolved with the document object. var loadingTask = pdfjsLib.getDocument('helloworld.pdf'); loadingTask.promise.then(function(pdf) { // you can now use *pdf* here });
🌐
GitHub
github.com › foliojs › pdfkit
GitHub - foliojs/pdfkit: A JavaScript PDF generation library for Node and the browser
A JavaScript PDF generation library for Node and the browser - foliojs/pdfkit
Starred by 10.5K users
Forked by 1.2K users
Languages   JavaScript
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>
🌐
GitHub
github.com › mozilla › pdfjs-dist
GitHub - mozilla/pdfjs-dist: Generic build of PDF.js library.
Generic build of PDF.js library. . Contribute to mozilla/pdfjs-dist development by creating an account on GitHub.
Starred by 1.3K users
Forked by 568 users
Languages   JavaScript 99.2% | CSS 0.8%
🌐
npm
npmjs.com › package › pdf-lib
pdf-lib - npm
See https://github.com/Hopding/pdf-lib/issues/207#issuecomment-537210471 for additional details. 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 ...
      » npm install pdf-lib
    
Published   Nov 06, 2021
Version   1.17.1
Author   Andrew Dillon
🌐
GitHub
github.com › APITemplate-io › generate-pdf-with-javascript › blob › main › pdf-lib.html
generate-pdf-with-javascript/pdf-lib.html at main · APITemplate-io/generate-pdf-with-javascript
page.drawText('Example Generating PDF with PDF-lib', { size: 12}); const pdfDataUri = await pdfDoc.saveAsBase64({ dataUri: true }); document.getElementById('pdf').src = pdfDataUri; } </script> </html>
Author   APITemplate-io
🌐
GitHub
github.com › Hopding › pdf-lib › issues › 1556
Run existing PDF Javascript from PDF-Lib · Issue #1556 · Hopding/pdf-lib
July 10, 2023 - This could be implemented by proxifying ... to PDF-Lib ones. Or providing a lower level API that behaves like native PDF Javascript in a contextualized sandbox providing all native features. I am trying to have a preexisting Javascript code to run and edit fields based on other fields states instead of rewriting it all. Plus, I couldn't figure some low level API to hide/show fields which this script is doing. It would help me out with a personnal project where I need this custom JS to run instead ...
Published   Nov 30, 2023
🌐
GitHub
github.com › Hopding › pdf-lib › blob › master › docs › CONTRIBUTING.md
pdf-lib/docs/CONTRIBUTING.md at master · Hopding/pdf-lib
compiled/dist/pdf-lib.min.js - a single JavaScript file containing a minified UMD version of the project.
Author   Hopding
🌐
GitHub
github.com › topics › pdf-library
pdf-library · GitHub Topics · GitHub
Open-source PDF generation library built with TypeScript and React. Features a WYSIWYG template designer, PDF viewer, and powerful generation capabilities. Create custom PDFs effortlessly in both browser and Node.js environments.
🌐
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 - After this read, you'll be able to find the right PDF library for your Javascript application. In the end, we'll also introduce pdfme, a very handy and powerful PDF library! if you like it, give me a start⭐ https://github.com/pdfme/pdfme
🌐
npm
npmjs.com › package › pdfjs-dist
pdfjs-dist - npm
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/environments, without native support for the latest JavaScript features, please see the legacy/ folder. Please see this wiki page for information about supported browsers/environments. See https://github.com/mozilla/pdf.js for learning and contributing.
      » npm install pdfjs-dist
    
Published   Nov 29, 2025
Version   5.4.449
🌐
Mozilla
mozilla.github.io › pdf.js › getting_started
PDF.js - Getting Started
$ git clone https://github.com/mozilla/pdf.js.git $ cd pdf.js · PDF.js is hosted on several free CDNs: https://www.jsdelivr.com/package/npm/pdfjs-dist · https://cdnjs.com/libraries/pdf.js · https://unpkg.com/pdfjs-dist/ Note that we only mention the most relevant files and folders.