Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 16-Oct-2020 | - | ||||
viewer/ | H | 03-May-2022 | - | 5,120 | 4,579 | |
LICENSE | H A D | 16-Oct-2020 | 33.7 KiB | 662 | 544 | |
README | H A D | 16-Oct-2020 | 1.5 KiB | 53 | 35 | |
composer.json | H A D | 16-Oct-2020 | 606 | 26 | 25 | |
pdfjs-viewer.diff | H A D | 16-Oct-2020 | 4.1 KiB | 84 | 64 | |
pdfviewer.php | H A D | 16-Oct-2020 | 4.3 KiB | 123 | 64 |
README
1Roundcube inline PDF Viewer 2=========================== 3The rendering of PDF documents is based on the pdf.js library 4by andreasgal. See http://mozilla.github.com/pdf.js/ for more information. 5 6 7INSTALLATION 8------------ 9 10Add 'pdfviewer' to the list of plugins in the config/main.inc.php file 11of your Roundcube installation. 12 13 14BUILD (for developers only) 15----- 16Clone the git repository into a local directory: 17 18$ git clone https://github.com/mozilla/pdf.js.git pdfjs 19$ cd pdfjs 20 21To actually build the viewer, node.js is required! 22 23$ node make generic 24 25The viewer is generated in build/generic/web/ and the pdf.js script in 26build/generic/build/pdf.js. Copy build/generic/web/ to the plugin directory 27<roundcubedir>/plugins/pdfviewer/viewer/ and also copy pdf.js into the viewer 28directory: 29 30$ cd <roundcubedir>/plugins/pdfviewer 31$ cp -r <pdfjsdir>/build/generic/web viewer 32$ cp <pdfjsdir>/build/generic/build/pdf.js viewer/pdf.js 33$ cp <pdfjsdir>/build/generic/build/pdf.worker.js viewer/pdf.worker.js 34$ rm viewer/*.pdf 35 36Then apply the pdfjs-viewer.diff patch to adjust the viewer for the use 37within Roundcube: 38 39$ patch -p0 < pdfjs-viewer.diff 40 41Optionally, compress the scripts using Google's Closure Compiler [1] 42or the YUI Compressor [2]. 43 44$ <roundcubedir>/bin/jsshrink.sh viewer/pdf.js ECMASCRIPT5 45$ <roundcubedir>/bin/jsshrink.sh viewer/viewer.js ECMASCRIPT5 46 47This will create minimized versions in viewer/*.min.js which are 48linked by the viewer.html template. 49 50[1] http://closure-compiler.googlecode.com/ 51[2] http://developer.yahoo.com/yui/compressor/ 52 53