Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PDF Reader in JavaScript

License

NotificationsYou must be signed in to change notification settings

mozilla/pdf.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 tocreate a general-purpose, web standards-based platform for parsing andrendering PDFs.

Contributing

PDF.js is an open source project and always looking for more contributors. Toget involved, visit:

Feel free to stop by ourMatrix room for questions or guidance.

Getting Started

Online demo

Please note that the "Modern browsers" version assumes native support for thelatest JavaScript features; please also seethis wiki page.

Browser Extensions

Firefox

PDF.js is built into version 19+ of Firefox.

Chrome

  • The official extension for Chrome can be installed from theChrome Web Store.This extension is maintained by@Rob--W.
  • Build Your Own - Get the code as explained below and issuenpx gulp chromium. Then openChrome, go toTools > Extension and load the (unpackaged) extension from thedirectorybuild/chromium.

Getting the Code

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 theofficial package or vianvm. If everything worked out, installall dependencies for PDF.js:

$ npm install

Finally, you need to start a local web server as some browsers do not allow openingPDF files using afile:// URL. Run:

$ npx gulp server

and then you can open:

Please keep in mind that this assumes the latest version of Mozilla Firefox; refer toBuilding 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:

Building PDF.js

In order to bundle allsrc/ files into two production scripts and build the genericviewer, run:

$ npx gulp generic

If you need to support older browsers, run:

$ npx gulp generic-legacy

This will generatepdf.js andpdf.worker.js in thebuild/generic/build/ directory (respectivelybuild/generic-legacy/build/).Both scripts are needed but onlypdf.js needs to be included sincepdf.worker.js willbe loaded bypdf.js. The PDF.js files are large and should be minified for production.

Using PDF.js in a web application

To use PDF.js in a web application you can choose to use a pre-built version of the libraryor to build it from source. We supply pre-built versions for usage with NPM underthepdfjs-dist name. For more information and examples please refer to thewiki page on this subject.

Including via a CDN

PDF.js is hosted on several free CDNs:

Learning

You can play with the PDF.js API directly from your browser using the live demos below:

More examples can be found in theexamples folder. Some of them are using the pdfjs-dist package, which can be built and installed in this repo directory vianpx gulp dist-install command.

For an introduction to the PDF.js code, check out the presentation by ourcontributor Julian Viereck:

More learning resources can be found at:

The API documentation can be found at:

Questions

Check out our FAQs and get answers to common questions:

Talk to us on Matrix:

File an issue:

About

PDF Reader in JavaScript

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors402


[8]ページ先頭

©2009-2025 Movatter.jp