rotdrop / nextcloud-app-pdf-downloader

Recusively convert entire directory trees to PDF and provide the resulting document as download.
Other
3 stars 4 forks source link

Fallback convertor #37

Open yward opened 1 year ago

yward commented 1 year ago

Hello Rotdrop, Thank you so much for the great app!

I am having an issue with the fallback convertor unoconv as it fails to convert any Libreoffice files.

The approach I am trying to do now, is to use a different convertor which is the built-in libreoffice headless convertor which can be accessed as follows: libreoffice --headless --convert-to pdf filename.odt

What do I need to enter in your fallback convertor field to call the above script? Any variable I should replace the filename with?

I appreciate your assistance in advance!

rotdrop commented 1 year ago

Hi,

there is an example pass-through converter script at

https://github.com/rotdrop/nextcloud-app-pdf-downloader/blob/main/contrib/converter-example.sh

The script simply uses cat to copy PDF-data from stdin to stdout. So: input data is received on stdin, output data is expected at stdout. This means that you probably have to fill some lines of code which generates temporary files (not sure whether libreoffice --headless ... can be convinced to directly read and write stdin/stdout.

Perhaps it would be a good idea to first try the script as-is and plug it into the "universal converter" admin-setting in order to check if the machinery works as expected. This feature is not well tested.