🌐
Mozilla
mozilla.github.io › pdf.js › examples
PDF.js - Examples
The example demonstrates how promises can be used to handle errors during loading. It also demonstrates how to wait until a page is loaded and rendered. The PDF.js can accept any decoded base64 data as an array.
🌐
Nutrient
nutrient.io › blog › sdk › complete guide to pdfjs
Complete guide to PDF.js
August 11, 2025 - Here’s an example of how to use some of these options: ... This will render the PDF page with a 1.5x zoom and with a red background. PDF.js provides several methods for navigating PDF documents, including scrolling, zooming, and searching.

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 › mozilla › pdf.js › blob › master › examples › learning › helloworld.html
pdf.js/examples/learning/helloworld.html at master · mozilla/pdf.js
<h1>'Hello, world!' example</h1> · <canvas id="the-canvas" style="border: 1px solid black; direction: ltr;"></canvas> · <script src="../../node_modules/pdfjs-dist/build/pdf.mjs" type="module"></script> · <script id="script" type="module"> // // If absolute URL from the remote server is provided, configure the CORS ·
Author   mozilla
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-tutorial
JavaScript Tutorial - GeeksforGeeks
Web Development: JavaScript is widely used in web development to create interactive and dynamic websites. Frameworks like React and Angular make front-end development faster, while Node.js is used for building server-side applications.
Published   2 days ago
🌐
PDF.js Express
pdfjs.express › demo
PDF.js Viewer Demo | PDF.js Express
Try the PDF.js Express Viewer demo: 26 out-of-the-box annotations, PDF form filling, e-signatures, UI customization, light/dark themes & more.
Find elsewhere
🌐
CodeSandbox
codesandbox.io › examples › package › pdfjs-dist
pdfjs-dist examples - CodeSandbox
lex961Find more examples or templates · AboutGeneric build of Mozilla's PDF.js library.6,183,977Weekly Downloads · Latest version5.4.449 · LicenseApache-2.0 · External Links · mozilla.github.io/pdf.js/ github.com/mozilla/pdf.js · github.com/mozilla/pdf.js/issues ·
🌐
Apryse
apryse.com › blog › how-to-use-pdf-js
PDF.js Viewer | Apryse
May 8, 2020 - In the above example, previous is the element ID, while icons/baseline-navigate_before-24px.svg is the path to the tool icon. And that’s it! ... As you can see, building a basic PDF viewer with PDF.js is pretty straightforward.
🌐
JSFiddle
jsfiddle.net › pdfjs › 9engc9mw
PDF.js 'Hello, world!' example - JSFiddle - Code Playground
The Code Completion will now also have the context of all panels before suggesting code to you - so if for example you have some CSS or JS, the HTML panel will suggest code based on the other two panels.
🌐
Best of JS
bestofjs.org › projects › pdfjs
Best of JS • PDF.js
More examples can be found in the examples folder. Some of them are using the pdfjs-dist package, which can be built and installed in this repo directory via npx gulp dist-install command. For an introduction to the PDF.js code, check out the presentation by our contributor Julian Viereck:
🌐
Medium
medium.com › @alekswebnet › the-easiest-pdf-viewer-pdf-js-with-the-power-of-web-components-446aa191e53
Build a Web Component for PDF.js Viewer | by Oleksandr Shevchuk | Medium
July 18, 2025 - It works, awesome! Now we have a web component for displaying PDFs, and we can change file URL dynamically! This is just a simple example, if you want a more complex solution, look at this package: ... Displaying PDFs in your web application could be successfully done by the PDF.js viewer.
🌐
Nutrient
nutrient.io › blog › sdk › implement pdf viewer pdf js
PDF.js viewer example: Implement a simple PDF viewer with PDF.js
October 17, 2024 - An example of how to implement a minimal PDF viewer with Mozilla's PDF.js.
🌐
Stack Overflow
stackoverflow.com › questions › 70341179 › pdf-js-example-not-displaying
PDF.JS Example Not Displaying
<!DOCTYPE html> <html> <head> <base ... type="text/javascript" src="https://mozilla.github.io/pdf.js/build/pdf.js"></script> <h1>PDF.js 'Hello, world' example</h1> <canvas id="the-canvas"></canvas> <script type="text/javascript">// atob() ...
🌐
Columbia University
columbia.edu › ~njn2118 › journal › 2021 › 7 › 30.html
How to use and extend Mozilla's PDF.js Viewer
The main PDF.js library code. ... This is a helper script that's needed to load the PDF file in a separate thread. ... Locale files that are created in the build process. Copy this directory to your setup and load the locale.properties file in the viewer template. You need to connect all these pieces in your customized viewer.html template. See Mediathread's viewer template for a working example...
🌐
JSFiddle
jsfiddle.net › pdfjs › wagvs9Lf
PDF.js Previous/Next example - JSFiddle - Code Playground
The Code Completion will now also have the context of all panels before suggesting code to you - so if for example you have some CSS or JS, the HTML panel will suggest code based on the other two panels.
🌐
PDF.js Express
pdfjs.express › documentation › samples
PDF.js Express Web Viewer Samples | Documentation
Realtime collaboration (Firebase) An example setup with Firebase backend. For more details, refer to realtime collaboration guide.
🌐
PDF-LIB
pdf-lib.js.org
PDF-LIB · Create and modify PDF documents in any ...
import { degrees, PDFDocument, rgb, StandardFonts } from 'pdf-lib'; async function modifyPdf() { const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf' const existingPdfBytes = await fetch(url).then(res => res.arrayBuffer()) const pdfDoc = await PDFDocument.load(existingPdfBytes) const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica) const pages = pdfDoc.getPages() const firstPage = pages[0] const { width, height } = firstPage.getSize() firstPage.drawText('This text was added with JavaScript!', { x: 5, y: height / 2 + 300, size: 50, font: helveticaFont, color: rgb(0.95, 0.1, 0.1), rotate: degrees(-45), }) const pdfBytes = await pdfDoc.save() }
🌐
CloudDefense.ai
clouddefense.ai › code › javascript › example › pdfjs-dist
Top 10 Examples of
return pdfDocument.getMetadata().then(function (data) { let info = data.info; let metadata = data.metadata; self.documentInfo = info ; self.metadata = metadata; // Provides some basic debug information console.log("PDF " + pdfDocument.fingerprint + " [" + info.PDFFormatVersion + " " + (info.Producer || "-").trim() + " / " + (info.Creator || "-").trim() + "]" + " (PDF.js: " + (pdfjsLib.version || "-") + ")"); let pdfTitle; if (metadata && metadata.has("dc:title")) { let title = metadata.get("dc:title"); // Ghostscript sometimes returns 'Untitled', so prevent setting the // title to 'Untitled.