59 lines
5.4 KiB
Diff
59 lines
5.4 KiB
Diff
--- orig/SeedDMS/Preview/PdfPreviewer.php
|
|
+++ pear/SeedDMS/Preview/PdfPreviewer.php
|
|
@@ -27,18 +27,18 @@
|
|
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.ms-excel' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
|
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
|
- 'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'",
|
|
- 'application/postscript' => "ps2pdf '%f' - > '%o'",
|
|
- 'image/jpeg' => "convert '%f' pdf:- > '%o'",
|
|
- 'image/png' => "convert '%f' pdf:- > '%o'",
|
|
- 'image/gif' => "convert '%f' pdf:- > '%o'",
|
|
- 'video/mp4' => "convert '%f[1-20]' pdf:- > '%o'",
|
|
+ 'text/rtf' => "unoconv -d document -f pdf -o '%o' '%f'",
|
|
+ 'application/msword' => "unoconv -d document -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -f pdf -o '%o' '%f'",
|
|
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -f pdf -o '%o' '%f'",
|
|
+ 'text/html' => "unoconv -d document -f pdf -o '%o' '%f'",
|
|
+ 'text/plain' => "unoconv -d document -f pdf -o '%o' '%f'",
|
|
);
|
|
} /* }}} */
|
|
|
|
--- orig/SeedDMS/Preview/Previewer.php
|
|
+++ pear/SeedDMS/Preview/Previewer.php
|
|
@@ -37,10 +37,19 @@
|
|
'image/jpg' => "convert -resize %wx '%f' '%o'",
|
|
'image/jpeg' => "convert -resize %wx '%f' '%o'",
|
|
'image/svg+xml' => "convert -resize %wx '%f' '%o'",
|
|
- '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'",
|
|
+ 'text/plain' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'text/html' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'text/rtf' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/msword' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.oasis.opendocument.text' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.ms-excel' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72 -sOutputFile=- -q - | convert -resize %wx png:- '%o'",
|
|
);
|
|
$this->width = intval($width);
|
|
} /* }}} */
|