Add SeedDMS Previewers and PdfPreviewers
This commit is contained in:
parent
579f4e92e6
commit
2e6d730ee6
@ -11,6 +11,9 @@ tar xzf /srv/seeddms.tgz -C /srv
|
||||
mv /srv/seeddms51x /srv/seeddms
|
||||
rm -f /srv/seeddms.tgz
|
||||
|
||||
# Patch Previewers
|
||||
patch -d /srv/seeddms -p0 <${SOURCE_DIR}/seeddms/seeddms-previewers.patch
|
||||
|
||||
# Populate database
|
||||
export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64)
|
||||
envsubst <${SOURCE_DIR}/seeddms/tmp/seeddms-createdb.sql >/tmp/seeddms-createdb.sql
|
||||
|
42
seeddms/seeddms-previewers.patch
Normal file
42
seeddms/seeddms-previewers.patch
Normal file
@ -0,0 +1,42 @@
|
||||
diff -ruN orig/SeedDMS/Preview/PdfPreviewer.php pear/SeedDMS/Preview/PdfPreviewer.php
|
||||
--- orig/SeedDMS/Preview/PdfPreviewer.php 2017-05-03 14:14:18.000000000 +0200
|
||||
+++ pear/SeedDMS/Preview/PdfPreviewer.php 2017-10-07 19:01:01.169624330 +0200
|
||||
@@ -27,10 +27,15 @@
|
||||
function __construct($previewDir, $timeout=5) { /* {{{ */
|
||||
parent::__construct($previewDir, $timeout);
|
||||
$this->converters = array(
|
||||
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
- 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
'text/rtf' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
'application/msword' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'text/html' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
+ 'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
||||
);
|
||||
} /* }}} */
|
||||
|
||||
diff -ruN orig/SeedDMS/Preview/Previewer.php pear/SeedDMS/Preview/Previewer.php
|
||||
--- orig/SeedDMS/Preview/Previewer.php 2017-05-03 14:14:18.000000000 +0200
|
||||
+++ pear/SeedDMS/Preview/Previewer.php 2017-10-07 19:02:22.781623907 +0200
|
||||
@@ -40,7 +40,16 @@
|
||||
'text/plain' => "convert -resize %wx '%f' '%o'",
|
||||
'application/pdf' => "convert -density 100 -resize %wx '%f[0]' '%o'",
|
||||
'application/postscript' => "convert -density 100 -resize %wx '%f[0]' '%o'",
|
||||
- 'application/x-compressed-tar' => "tar tzvf '%f' | convert -density 100 -resize %wx text:-[0] '%o",
|
||||
+ 'application/x-compressed-tar' => "tar tzvf '%f' | convert -density 100 -resize %wx text:-[0] '%o'",
|
||||
+ 'text/rtf' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'application/msword' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'text/html' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
+ 'text/plain' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'",
|
||||
);
|
||||
$this->width = intval($width);
|
||||
} /* }}} */
|
Loading…
Reference in New Issue
Block a user