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
A general-purpose, web standards-based platform for parsing and rendering PDFs.
Policy Templates for Firefox
PDF files are downloaded and sent externally. 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.
cdnjs
cdnjs.com › home › libraries › pdf.js › 2.6.347
pdf.js - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf.min.js · https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf.worker.entry.js · https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf.worker.entry.min.js · https://cdnjs....
Videos
GitHub
github.com › mozilla › pdf.js
GitHub - mozilla/pdf.js: PDF Reader in JavaScript
If everything worked out, install all dependencies for PDF.js: ... Finally, you need to start a local web server as some browsers do not allow opening PDF files using a file:// URL. Run: ... Please keep in mind that this assumes the latest version of Mozilla Firefox; refer to Building PDF.js ...
Starred by 52.4K users
Forked by 10.5K users
Languages JavaScript 71.3% | Fluent 25.5% | CSS 2.2%
SourceForge
sourceforge.net › projects › pdf-js.mirror
PDF.js download | SourceForge.net
November 2, 2025 - This is an exact mirror of the PDF.js project, hosted at https://github.com/mozilla/pdf.js. SourceForge is not affiliated with PDF.js.
Mozilla
mozilla.github.io › pdf.js › getting_started
PDF.js - Getting Started
$ git clone https://github.com/mozilla/pdf.js.git $ cd pdf.js ... Note that we only mention the most relevant files and folders. ├── build/ │ ├── pdf.mjs - display layer │ ├── pdf.mjs.map - display layer's source map │ ├── pdf.worker.mjs - core layer │ └── ...
jsDelivr
jsdelivr.com › package › npm › pdfjs-dist-min
pdfjs-dist-min CDN by jsDelivr - A CDN for npm and GitHub
May 17, 2023 - A free, fast, and reliable CDN for pdfjs-dist-min. Generic build of Mozilla's PDF.js library.
Published May 17, 2023
Repository https://github.com/to-na/pdfjs-dist-min
npm
npmjs.com › package › pdfjs-dist
pdfjs-dist - npm
2 weeks ago - Generic build of Mozilla's PDF.js library.. Latest version: 5.4.449, last published: 14 days ago. Start using pdfjs-dist in your project by running `npm i pdfjs-dist`. There are 2281 other projects in the npm registry using pdfjs-dist.
» npm install pdfjs-dist
Published Nov 29, 2025
Version 5.4.449
Repository https://github.com/mozilla/pdf.js
Homepage https://mozilla.github.io/pdf.js/
PDF-LIB
pdf-lib.js.org
PDF-LIB · Create and modify PDF documents in any ... - JS.ORG
https://cdn.jsdelivr.net/npm/[email protected]/dist/pdf-lib.min.js
UNPKG
app.unpkg.com › [email protected] › files › build
UNPKG
Generic build of Mozilla's PDF.js library.
CDNPKG
cdnpkg.com › home › pdf.js › pdf.min.js
PDF.MIN.JS: DOWNLOAD - CDNPKG
Download pdf.min.js or get a CDN url for 1510 versions of pdf.js.
GitHub
github.com › dealfonso › pdfjs-viewer
GitHub - dealfonso/pdfjs-viewer: A viewer based on PDFjs, which can be embedded in any web page (not using iframes)
There is a single javascript file that contains the whole PDFjsViewer class (in folder js). There are also a set of css files that contain some styles to be used in the library and examples. These files can also be included individually in your project, or combined into a single file by concatenating them. A Makefile is provided to create the single all-in-one minified js and css files for the library.
Starred by 79 users
Forked by 6 users
Languages JavaScript 76.3% | Makefile 14.5% | CSS 9.2%
jsDelivr
jsdelivr.com › package › npm › pdfjs-dist-viewer-min
pdfjs-dist-viewer-min CDN by jsDelivr - A CDN for npm and GitHub
July 13, 2024 - A free, fast, and reliable CDN for pdfjs-dist-viewer-min. Generic minified build of Mozilla's PDF.js library including the viewer component.
Published Jun 19, 2016
Top answer 1 of 3
4
You have to set GlobalWorkerOptions.workerSrc to /build/pdf.worker(.min).js of same version:
pdfjsLib.GlobalWorkerOptions.workerSrc =
"https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.js";
pdfjsLib.getDocument('./ahmed.pdf').promise.then(doc => {
console.log(`This document has ${doc._pdfInfo.numPages} pages.");
});
And, as @Pasi has mentioned, you have to promisify .getDocument() by chaining .promise on it. Without it, there is no .then().
2 of 3
1
See the "Hello World with document load error handling" example on this page to get started: https://mozilla.github.io/pdf.js/examples/
(Your snippet is missing .promise after getDocument() and setting the workerSrc property)
SourceForge
sourceforge.net › home › open source software › formats and protocols › protocols › web services › pdf.js › files
PDF.js - Browse Files at SourceForge.net
This is an exact mirror of the PDF.js project, hosted at https://github.com/mozilla/pdf.js. SourceForge is not affiliated with PDF.js. For more information, see the SourceForge Open Source Mirror Directory. Summary · Files · Reviews · Download Latest Version pdfjs-5.4.449-dist.zip (6.4 MB) Home ·
Top answer 1 of 7
88
Use the download attribute.
var link = document.createElement('a');
link.href = url;
link.download = 'file.pdf';
link.dispatchEvent(new MouseEvent('click'));
2 of 7
14
It is also possible to open the pdf link in a new window and let the browser handle the rest:
window.open(pdfUrl, '_blank');
or:
window.open(pdfUrl);
Top answer 1 of 3
13
Hope am not too late in answering your question. Here are the steps:
- Open the particular pdf in the reader to full screen.
- Launch inspect.
- Look for a hidden download button with id
downloadstyled asdisplay: none, Change that todisplay: inlineto make it visible. - Click the button to download your pdf.
2 of 3
10
document.getElementById('download').click()
Answer by Matt C and Vincent Omondi
Crabbly
printjs.crabbly.com
Print.js - Javascript library for HTML elements, PDF and image files printing.
Print.js is a tiny javascript library to help printing from the web. Print friendly support for HTML elements, image files and JSON data. Print PDF files directly form page.