From 816094dd459d6d2de5a4f6db0690e26a45cdfab4 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Fri, 7 Feb 2014 03:20:32 -0800 Subject: [PATCH] Add instructions to easily set up PDF.js without Node.js or git --- Setup-PDF.js-in-a-website.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Setup-PDF.js-in-a-website.md b/Setup-PDF.js-in-a-website.md index 48cedfe..984e608 100644 --- a/Setup-PDF.js-in-a-website.md +++ b/Setup-PDF.js-in-a-website.md @@ -1,5 +1,24 @@ -## Linux +You can choose to use a pre-built version of PDF.js, or build PDF.js from source. + +## Pre-built PDF.js +When the source code of PDF.js changes, the [online demo](http://mozilla.github.io/pdf.js/web/viewer.html) is automatically updated. The source of all demo files can easily be accessed at https://github.com/mozilla/pdf.js/tree/gh-pages/. +These files can also be uploaded to your server to use PDF.js to display PDF files from your website + +1. Download https://github.com/mozilla/pdf.js/archive/gh-pages.zip. +2. Extract the zip file (a directory called "pdf.js-gh-pages" will be created). +3. Copy the following directories to your website: + * pdf.js-gh-pages/build/ + * pdf.js-gh-pages/web/ + The web/ directory contains a 1 MB pdf file called "compressed.tracemonkey-pldi-09.pdf". This file is only used as an example for the demo and can safely be removed if you need disk space. +4. If you want to open a PDF from your website with PDF.js, simply link to the viewer and pass the location of the PDF file. For example: + + ```html + Open yourpdf.pdf with PDF.js + ``` + +## Build PDF.js from source +### Linux * [Instructions for Linux can be found here.](Setup-PDF.js-in-a-website-(Linux)) -## Windows +### Windows * [Instructions for Windows can be found here.](Setup-PDF.js-in-a-website-(Windows)) \ No newline at end of file