From 98cd529883af10e0d5d10e5b7319e5f094b67a01 Mon Sep 17 00:00:00 2001 From: edouard-lopez Date: Mon, 11 Mar 2013 02:30:21 -0700 Subject: [PATCH] add warning about minificatin, move section about edit needed to use minified file --- ....js-in-a-website-(Debian-Ubuntu).mediawiki | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki b/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki index d4dd7a1..33f9f3e 100644 --- a/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki +++ b/Setup-PDF.js-in-a-website-(Debian-Ubuntu).mediawiki @@ -41,7 +41,7 @@ You should get this output: ### Creating generic viewer -=== Compressing PDF.js === +=== Compressing PDF.js (unsupported!) === '''Minification is NOT supported''' by the developer of the project. First start testing with the full build, then use the minified version. From my test, the '''minified version did NOT''' work while the normal version was. @@ -54,18 +54,11 @@ There is a package on Ubuntu 12.10/Linux Mint 14 : sudo apt-get install yui-compressor cd mkdir ./production/ - # yui-compressor ./build/pdf.js -o ./production/pdf-min.js + # yui-compressor ./build/pdf.js -o ./production/pdf-min.js # BEWARE UNSUPPORTED BEHAVIOR -== From Build to Production == -Now that your build is done, you can copy the viewer and its resources to your production directory: +==== Use the Minified File ==== - # 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 === +'''Minification break the libs''' using yui-compressor and PDF.js v0.7.339 (build: 0ebe91c). Try at your own risk. 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: @@ -74,3 +67,14 @@ Be sure to edit `viewer.html` and `viewer.js` to use the correct file, the defau // viewer.js PDFJS.workerSrc = './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 \ No newline at end of file