Open rocodes opened 1 year ago
I am :100: in favour of this, but I do want to point out that unoconv
is deprecated. The replacement unoserver
is a fairly lightweight layer that basically just ensures that LibreOffice will stay in memory for bulk conversion operations. I believe for our usecase, it would probably be best to not rely on unoconv
or deal with unoserver
and instead just go with LibreOffice's headless conversion directly.
I'm in favour. Just tested a little bit with soffice (libreoffice) --convert-to pdf
. Here are some notes for our future selves:
subprocess.check_call
won't work. (An example of this is when a file is passed in without the correct file extension- a warning is printed to the console, the file is not converted, and the return code is 0). A workaround could be to check for a pdf file with the name we expect, and ensure it is newer than the original file we were trying to convert.I'm in favour. Just tested a little bit with soffice (libreoffice) --convert-to pdf. Here are some notes for our future selves:
Dangerzone does use this "libreoffice headless" approach. We could piggy back on that.
We currently convert Office/Libreoffice files using
unoconv
to print them as PDFs.unoconv
(already installed in sd-devices) currently supports the following filetypes: [Edit: see comment below regarding moving away from unoconv]It would be easy to add support for more of these filetypes (see eg https://github.com/freedomofpress/securedrop-export/pull/109), would be helpful for users (see eg https://github.com/freedomofpress/securedrop-client/issues/2008 or https://github.com/freedomofpress/securedrop-client/issues/2007; though not about printing, the same concept applies), and would not require adding any additional dependencies. Let's discuss which formats are useful to include, as a stopgap while we figure out other formats such as webp support, or while we figure larger changes such as https://github.com/freedomofpress/securedrop-workstation/issues/842.
Note:
unoconv
is also installed in sd-viewer, if we are looking for a quick way to add additional viewable filetypes without additional upstream dependencies.