pdf.js is an HTML5 technology experiment that explores building a faithful
and efficient Portable Document Format (PDF) renderer without native code
assistance.
pdf.js is community-driven and supported by Mozilla Labs. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs, and eventually release a PDF reader extension powered by pdf.js.
This demo provides an interactive interface for displaying and browsing PDFs using the pdf.js API.
For an experimental Chrome extension, get the code as explained below and issue
For an introduction to the PDF.js code, check out the presentation by our contributor Julian Viereck:
Additional learning resources can be found at:
and of course our open Github issues:
For better consistency and long-term stability, please do look around the code and try to follow our conventions. More information about the contributor process can be found on the contributor wiki page.
If you don't want to hack on the project or have little spare time, you still can help! Just open PDFs in the online demo and report any breakage in rendering.
Our Github contributors so far:
More information about running the tests can be found on the contributor wiki page.
You can read more about pdf.js here:
from https://github.com/mozilla/pdf.js
pdf.js is community-driven and supported by Mozilla Labs. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs, and eventually release a PDF reader extension powered by pdf.js.
Getting started
Online demo
For an online demo, visit:This demo provides an interactive interface for displaying and browsing PDFs using the pdf.js API.
Extension
A Firefox extension is availble in two places:- Stable Version: https://addons.mozilla.org/firefox/addon/pdfjs
- Development Version: http://mozilla.github.com/pdf.js/extensions/firefox/pdf.js.xpi
extensions.update.interval
option in about:config
).For an experimental Chrome extension, get the code as explained below and issue
node make extension
.
Then open Chrome, go to Tools > Extension
and load the (unpackaged) extension
from the directory build/chrome
.Getting the code
To get a local copy of the current code, clone it using git:$ git clone git://github.com/mozilla/pdf.js.git pdfjs
$ cd pdfjs
Next, you need to start a local web server as some browsers don't allow opening
PDF files for a file:// url:$ node make server
You can install Node via nvm or the
official package. If everything worked out, you can now serve - http://localhost:8888/web/viewer.html
- http://localhost:8888/test/pdfs/?frame
Building pdf.js.
In order to bundle allsrc/
files into a final pdf.js
and build the generic viewer, issue:$ node make generic
This will generate the file build/generic/build/pdf.js
that can be included in your final project. The pdf.js file is large and
should be minified for production. Also, if you would like to support
more browsers than firefox you'll also need to include compatibility.js
from build/generic/web/
.Learning
You can play with the PDF.js API directly from your browser through the live demos below:- Hello world: http://jsbin.com/pdfjs-helloworld-v2/edit#html,live
- Simple reader with prev/next page controls: http://jsbin.com/pdfjs-prevnext-v2/edit#html,live
For an introduction to the PDF.js code, check out the presentation by our contributor Julian Viereck:
Additional learning resources can be found at:
Contributing
pdf.js is a community-driven project, so contributors are always welcome. Simply fork our repo and contribute away. Good starting places for picking a bug are the top error messages and TODOs in our corpus report:and of course our open Github issues:
For better consistency and long-term stability, please do look around the code and try to follow our conventions. More information about the contributor process can be found on the contributor wiki page.
If you don't want to hack on the project or have little spare time, you still can help! Just open PDFs in the online demo and report any breakage in rendering.
Our Github contributors so far:
- https://github.com/mozilla/pdf.js/contributors
- https://github.com/mozilla/pdf.js/blob/master/LICENSE
Running the tests
pdf.js comes with browser-level regression tests that allow one to probe whether it's able to successfully parse PDFs, as well as compare its output against reference images, pixel-by-pixel.More information about running the tests can be found on the contributor wiki page.
Additional resources
Gallery of user projects and modifications:You can read more about pdf.js here:
from https://github.com/mozilla/pdf.js