From d9fd94b87496c1ab26572906404f23c89d72bde8 Mon Sep 17 00:00:00 2001 From: edouard-lopez Date: Sun, 10 Mar 2013 11:03:47 -0700 Subject: [PATCH] add section 'From Build to Production' and sub-section 'Use the Minified File' --- ....js-in-a-website-(Debian-Ubuntu).mediawiki | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki b/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki index 4591288..5cc398f 100644 --- a/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki +++ b/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki @@ -49,4 +49,24 @@ There is a package on Ubuntu 12.10/Linux Mint 14 : sudo apt-get install yui-compressor cd - yui-compressor ./build/pdf.js -o pdf-min.js \ No newline at end of file + mkdir ./production/ + yui-compressor ./build/pdf.js -o ./production/pdf-min.js + +== From Build to Production == +Now that your build is done, you can copy the viewer and its resources to your production directory: + + # directory holding image and i18n + cp -R ./build/generic/web/{images,locale}/ ./production + # compatibility.js is needed to support IE8+, Opera, etc. + # l10n.js is for localization (translation's files are in locale/) + cp ./build/generic/web/{viewer.{js,html,css},{compatibility,l10n}.js} ./production + +=== Use the Minified File === + +Be sure to edit `viewer.html` and `viewer.js` to use the correct file, the default it to use `pdf.js`. Here we want to use the minified version: + + + + + // viewer.js + PDFJS.workerSrc = './pdf-min.js';