|
|
@ -27,6 +27,32 @@ For an online demo, visit: |
|
|
|
This demo provides an interactive interface for displaying and browsing PDFs |
|
|
|
This demo provides an interactive interface for displaying and browsing PDFs |
|
|
|
using the pdf.js API. |
|
|
|
using the pdf.js API. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Getting the code** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To get a local copy of the current code, clone it using git: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
|
|
git clone git://github.com/andreasgal/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: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash |
|
|
|
|
|
|
|
make server |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If everything worked out, you can now serve |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://localhost:8888/web/viewer.html |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can also view all the test pdf files on the right side serving |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://localhost:8888/test/pdfs/?frame |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Hello world** |
|
|
|
**Hello world** |
|
|
|
|
|
|
|
|
|
|
|
For a "hello world" example, take a look at: |
|
|
|
For a "hello world" example, take a look at: |
|
|
@ -38,6 +64,20 @@ in a custom project. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Contributing |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pdf.js is a community-driver project, so contributors are always welcome. |
|
|
|
|
|
|
|
Simply fork our repo and contribute away. A great place to start is our |
|
|
|
|
|
|
|
open issues. For better consistency and long-term stability, please do look around the |
|
|
|
|
|
|
|
code and try to follow our conventions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you __don't want to hack__ on the project or have short spare times, you still |
|
|
|
|
|
|
|
can help! Just open PDFs in the |
|
|
|
|
|
|
|
[online demo](http://andreasgal.github.com/pdf.js/web/viewer.html) and report |
|
|
|
|
|
|
|
any breakage in rendering. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Running the Tests |
|
|
|
## Running the Tests |
|
|
|
|
|
|
|
|
|
|
|
pdf.js comes with browser-level regression tests that allow one to probe |
|
|
|
pdf.js comes with browser-level regression tests that allow one to probe |
|
|
@ -64,16 +104,6 @@ images. The test type `load` simply tests whether the file loads without |
|
|
|
raising any errors. |
|
|
|
raising any errors. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Contributing |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pdf.js is a community-driver project, so contributors are always welcome. |
|
|
|
|
|
|
|
Simply fork our repo and contribute away. A great place to start is our |
|
|
|
|
|
|
|
open issues. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For better consistency and long-term stability, please do look around the |
|
|
|
|
|
|
|
code and try to follow our conventions. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Additional resources |
|
|
|
## Additional resources |
|
|
|
|
|
|
|
|
|
|
|
Our demo site is here: |
|
|
|
Our demo site is here: |
|
|
@ -97,8 +127,28 @@ Join our mailing list: |
|
|
|
Subscribe either using lists.mozilla.org or Google Groups: |
|
|
|
Subscribe either using lists.mozilla.org or Google Groups: |
|
|
|
|
|
|
|
|
|
|
|
https://lists.mozilla.org/listinfo/dev-pdf-js |
|
|
|
https://lists.mozilla.org/listinfo/dev-pdf-js |
|
|
|
|
|
|
|
|
|
|
|
https://groups.google.com/group/mozilla.dev.pdf-js/topics |
|
|
|
https://groups.google.com/group/mozilla.dev.pdf-js/topics |
|
|
|
|
|
|
|
|
|
|
|
Talk to us on IRC: |
|
|
|
Talk to us on IRC: |
|
|
|
|
|
|
|
|
|
|
|
#pdfjs on irc.mozilla.org |
|
|
|
#pdfjs on irc.mozilla.org |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Additional resources to understand the structure of PDF |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A really basic overview of PDF is described here: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://partners.adobe.com/public/developer/en/livecycle/lc_pdf_overview_format.pdf |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A more detailed file example: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://gnupdf.org/Introduction_to_PDF |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The PDF specification itself is an ISO and not free available. However, there is |
|
|
|
|
|
|
|
a "PDF Reference" from Adobe: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_1-7.pdf |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Recommanded chapters to read: "2. Overview", "3.4 File Structure", |
|
|
|
|
|
|
|
"4.1 Graphics Objects" that lists the PDF commands. |
|
|
|
|
|
|
|
|
|
|
|