add warning about minificatin, move section about edit needed to use minified file

edouard-lopez 2013-03-11 02:30:21 -07:00
parent 0826706158
commit 98cd529883

@ -41,7 +41,7 @@ You should get this output:
### Creating generic viewer ### 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. '''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 sudo apt-get install yui-compressor
cd <pdfjs> cd <pdfjs>
mkdir ./production/ 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 == ==== Use the Minified File ====
Now that your build is done, you can copy the viewer and its resources to your production directory:
# directory holding image and i18n '''Minification break the libs''' using yui-compressor and PDF.js v0.7.339 (build: 0ebe91c). Try at your own risk.
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: 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 // viewer.js
PDFJS.workerSrc = './pdf-min.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