You can modify the
DEFAULT_URL variable in the
web/viewer.js file or you can append the
?file= query string to the viewer URL, e.g.
The goal is to support all HTML5 compliant browsers, but since feature support varies per browser/version our support for all PDF features varies as well. If you want to support more browsers than Firefox you'll need to include compatibility.js which has polyfills for missing features. Find the list of features needed for PDF.js to properly work and browser tests for those features at Required Browser Features. In general, the support is below:
|Firefox Stable||yes||Windows and Linux|
|Chrome Stable||yes||Windows and Linux|
|Android||limited||none||Android's Web Browser version 4.0 or below lacks a number of features or has defects, e.g. in typed arrays or HTTP range requests|
|Safari||limited||none||Safari (desktop and mobile) lacks a number of features or has defects, e.g. in typed arrays or HTTP range requests|
|IE9||limited||none||IE9 lacks a number of features and most notably typed arrays which causes subpar performance.|
|<=IE8||NO||none||IE8 and below are missing too many features to be supported.|
There is currently a Firefox, Chromium and Opera extension. The Firefox extension is well supported and actively worked on. The Chromium extension is maintained by a PDF.js contributor. The Opera extension can be found here. For installing the Firefox or Chromium extension, please refer to the readme.
First, you need to prepare your fork and setup the development environment. Don't forget to read the Contributing page. Second, make yourself familiar with the PDF format and PDF.js internals. Third, if you don't already have a certain issue you want to fix, choose one from the open issues labeled 5-good-beginner-bug. Last, submit a pull request for the review. During any part of the process we recommend to communicate with the PDF.js team on #pdfjs IRC channel at irc.mozilla.org if you have questions or need to find a reviewer.
PDF.js is mainly written for reading PDF files, not editing them. Because of that we don't yet support adding any kind of annotations. We do however support rendering a number of annotation types for viewing.
(warning, the following list may be incomplete)
The home, end, page up, page down and all arrow keys can be used to navigate the document.
User interface buttons or ctrl + mouse wheel can be used to change the zooming level, but keyboard shortcuts are also available:
(replace ctrl with meta on some configurations)
The only supported minifier as of now is Google Closure Compiler (see https://developers.google.com/closure/compiler). You can build a minified version of PDF.js using the following command:
CLOSURE_COMPILER="../path/to/closure/compiler.jar" node make minified
Yes. The code for the website at http://mozilla.github.com/pdf.js is located in the "gh-pages" branch. You can clone it using
git clone -b gh-pages https://github.com/mozilla/pdf.js.git pdfjs-gh-pages or download the archive.
Yes. The issues are used to track both bugs filed by users and specific work items for developers. Try to file one issue per problem observed.
Yes. PDF.js will attempt to recover usable PDF data (pages, content or fonts) and display the document. Please report the issue (see above) and we will take a look.
The best place is our email@example.com mailing list. You can subscribe to it using lists.mozilla.org or Google Groups. This way you will reach not only developers. As an alternative, you can join our weekly engineering meeting to discuss new ideas for the project.
The issue tracking system is designed to record a single technical problem. A bug report is something where a developer/contributor can work on. The GitHub issue tracker is not a good place for general, not well thought out or unworkable ideas. Most likely a discussion-type issue will not be addressed for a long time or closed as invalid.
We are glad to hear that and will try to help you, but first check examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare short well-documented example that demonstrate the problem and make it accessible online on your website, jsbin, etc. before opening a new issue or contacting us on the IRC channel -- keep in mind that just code snippets won't help us troubleshoot the problem. The issues that do not provide enough details will be closed as invalid/incomplete (see reporting issue above).
Please periodically check or subscribe to our firstname.lastname@example.org mailing list to be informed about changes in the PDF.js architecture/design or security announcements.
Last edited by Tim van der Meij,