• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-Oct-2020-

viewer/H03-May-2022-5,1204,579

LICENSEH A D16-Oct-202033.7 KiB662544

READMEH A D16-Oct-20201.5 KiB5335

composer.jsonH A D16-Oct-2020606 2625

pdfjs-viewer.diffH A D16-Oct-20204.1 KiB8464

pdfviewer.phpH A D16-Oct-20204.3 KiB12364

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