Gathering detailed insights and metrics for pdfjs-dist
Gathering detailed insights and metrics for pdfjs-dist
Gathering detailed insights and metrics for pdfjs-dist
Gathering detailed insights and metrics for pdfjs-dist
@bundled-es-modules/pdfjs-dist
mirror of pdfjs-dist, bundled and exposed as ES module
simple-react-pdf
Simple PDF React component with vertical scroll bar (pdfjs-dist, ES6 syntax, Babel, Browserify).
pdfjs-dist-legacy
a legacy implementation of pdfjs-dist
pdfjs-dist-viewer-angular
pdfjs-dist non-agnostic language viewer
npm install pdfjs-dist
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
48,768 Stars
19,955 Commits
10,028 Forks
1,118 Watching
1 Branches
391 Contributors
Updated on 28 Nov 2024
Minified
Minified + Gzipped
JavaScript (73.02%)
Fluent (24.23%)
CSS (1.81%)
HTML (0.92%)
TypeScript (0.02%)
Cumulative downloads
Total Downloads
Last day
-6.8%
553,422
Compared to previous day
Last week
0.2%
3,030,350
Compared to previous week
Last month
11%
12,820,642
Compared to previous month
Last year
39%
136,328,388
Compared to previous year
PDF.js is a Portable Document Format (PDF) viewer that is built with HTML5.
PDF.js is community-driven and supported by Mozilla. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs.
PDF.js is an open source project and always looking for more contributors. To get involved, visit:
Feel free to stop by our Matrix room for questions or guidance.
Please note that the "Modern browsers" version assumes native support for the latest JavaScript features; please also see this wiki page.
Modern browsers: https://mozilla.github.io/pdf.js/web/viewer.html
Older browsers: https://mozilla.github.io/pdf.js/legacy/web/viewer.html
PDF.js is built into version 19+ of Firefox.
npx gulp chromium
. Then open
Chrome, go to Tools > Extension
and load the (unpackaged) extension from the
directory build/chromium
.To get a local copy of the current code, clone it using git:
$ git clone https://github.com/mozilla/pdf.js.git
$ cd pdf.js
Next, install Node.js via the official package or via nvm. If everything worked out, install all dependencies for PDF.js:
$ npm install
Finally, you need to start a local web server as some browsers do not allow opening
PDF files using a file://
URL. Run:
$ npx gulp server
and then you can open:
Please keep in mind that this assumes the latest version of Mozilla Firefox; refer to Building PDF.js for non-development usage of the PDF.js library.
It is also possible to view all test PDF files on the right side by opening:
In order to bundle all src/
files into two production scripts and build the generic
viewer, run:
$ npx gulp generic
If you need to support older browsers, run:
$ npx gulp generic-legacy
This will generate pdf.js
and pdf.worker.js
in the build/generic/build/
directory (respectively build/generic-legacy/build/
).
Both scripts are needed but only pdf.js
needs to be included since pdf.worker.js
will
be loaded by pdf.js
. The PDF.js files are large and should be minified for production.
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 and Bower under
the pdfjs-dist
name. For more information and examples please refer to the
wiki page on this subject.
PDF.js is hosted on several free CDNs:
You can play with the PDF.js API directly from your browser using the live demos below:
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:
More learning resources can be found at:
The API documentation can be found at:
Check out our FAQs and get answers to common questions:
Talk to us on Matrix:
File an issue:
The latest stable version of the package.
Stable Version
3
8.8/10
Summary
Malicious PDF can inject JavaScript into PDF Viewer
Affected Versions
< 1.10.100
Patched Versions
1.10.100
8.8/10
Summary
Malicious PDF can inject JavaScript into PDF Viewer
Affected Versions
>= 2.0.0, < 2.0.550
Patched Versions
2.0.550
0/10
Summary
PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF
Affected Versions
<= 4.1.392
Patched Versions
4.2.67
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 14 issue activity found in the last 90 days -- score normalized to 10
Reason
all changesets reviewed
Reason
security policy file detected
Details
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
no binaries found in the repo
Reason
project is fuzzed
Details
Reason
SAST tool is run on all commits
Details
Reason
0 existing vulnerabilities detected
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
Project has not signed or included provenance with any releases.
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More