fix formatting

This commit is contained in:
Uwe Steinmann 2025-10-23 13:50:18 +02:00
parent 00e6a22dbd
commit ed36b88a09

View File

@ -81,43 +81,43 @@ image.
## Conversion to pdf for pdf preview
* text/plain, text/csv, application/csv, application/vnd.oasis.opendocument.text application/msword, application/vnd.wordperfect, text/rtf
### text/plain, text/csv, application/csv, application/vnd.oasis.opendocument.text application/msword, application/vnd.wordperfect, text/rtf
`unoconv -d document -f pdf --stdout -v '%f' > '%o'`
* image/png, image/jpg, image/jpeg
### image/png, image/jpg, image/jpeg
`convert -density 300 '%f' 'pdf:%o'`
Actually `convert` can be used for many other image formats.
* image/svg+xml
### image/svg+xml
`cairosvg -f pdf -o '%o' '%f'`
* application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.oasis.opendocument.presentation
### application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.oasis.opendocument.presentation
`unoconv -d presentation -f pdf --stdout -v '%f' > '%o'`
* application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet
### application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet
`unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'`
* message/rfc822
### message/rfc822
`java -jar emailconverter-2.5.3-all.jar '%f' -o '%o'`
The emailconverter can be obtained from https://github.com/nickrussler/email-to-pdf-converter
It requires `wkhtmltopdf` which is part of debian.
* text/plain
### text/plain
`iconv -c -f utf-8 -t latin1 '%f' | a2ps -1 -q -a1 -R -B -o - - | ps2pdf - -`
The parameter `-q` is important because a2ps sends some statistical
data to stderr, which makes SeedDMS believe the command has failed.
* application/x-xopp
### application/x-xopp
`xournalpp -p "%o" "%f"`
@ -145,15 +145,15 @@ needed if the output goes to stdout.
`convert -resize %wx '%f' 'png:%o'`
* image/svg+xml
### image/svg+xml
`cairosvg -f png --output-width %w -o '%o' '%f'`
* text/plain
### text/plain
`convert -density 100 -resize %wx 'text:%f[0]' 'png:%o'`
* application/pdf
### application/pdf
`gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dPDFFitPage -r72x72 -sOutputFile=- -dFirstPage=1 -dLastPage=1 -q '%f' | convert -resize %wx png:- '%o'`
@ -166,23 +166,23 @@ needed if the output goes to stdout.
`pdftocairo` needs to output to stdout because the output file name passed
to pdftocairo will be suffixed with `.png`
* application/postscript
### application/postscript
`convert -density 100 -resize %wx '%f[0]' 'png:%o'`
* text/plain
### text/plain
iconv -c -f utf-8 -t latin1 '%f' | a2ps -1 -q -a1 -R -B -o - - | gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dFirstPage=1 -dLastPage=1 -dPDFFitPage -r72x72 -sOutputFile=- -q - | convert -resize %wx png:- 'png:%o'
`iconv -c -f utf-8 -t latin1 '%f' | a2ps -1 -q -a1 -R -B -o - - | gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dFirstPage=1 -dLastPage=1 -dPDFFitPage -r72x72 -sOutputFile=- -q - | convert -resize %wx png:- 'png:%o'`
On Linux systems you will have to set the desired value in /etc/papersize for a2ps
e.g. a4, or letter. Unfortunately, a2ps cannot process utf-8 encoded files. That's
why the input needs to be recoded with iconv or recode.
* application/msword, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.text, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/rtf, application/vnd.ms-powerpoint, text/csv, application/csv, application/vnd.wordperfect,
### application/msword, application/vnd.oasis.opendocument.spreadsheet, application/vnd.oasis.opendocument.text, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/rtf, application/vnd.ms-powerpoint, text/csv, application/csv, application/vnd.wordperfect,
`unoconv -d document -e PageRange=1 -f pdf --stdout -v '%f' | gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -dPDFFitPage -r72x72 -sOutputFile=- -dFirstPage=1 -dLastPage=1 -q - | convert -resize %wx png:- 'png:%o'`
* video/webm, video/mp4
### video/webm, video/mp4
This will take 12th frame of a video and converts into a png. It requires
ffmpeg to be installed.
@ -193,11 +193,11 @@ needed if the output goes to stdout.
`ffmpeg -i "%f" -ss 00:00:02 -frames:v 1 -loglevel quiet -vf scale=%w:-1 -f apng "%o"`
* audio/mpeg
### audio/mpeg
`sox "%f" -n spectrogram -x 600 -Y 550 -r -l -o - | convert -resize %wx png:- "png:%o"`
* application/x-xopp
### application/x-xopp
`xournalpp -i "%o" --export-png-width=%w "%f"`