An alternative solution for converting odt to *pdf using pandoc. This could be scripted as needed, however, the downside is that latex would also need to be installed for .pdf output:
Libreoffice is also a java-free solution if users disable the JRE in libreoffice.
(as shown above its not actually a required dependency … its an optional one)
You can change this in the LO interface under Settings > Advanced.
You can also augment the configuration file in your HOME.
I also checked after ripping out java and the headless conversion works fine.
$ sudo pacman -Rdd jre-openjdk-headless
Packages (1) jre-openjdk-headless-22.0.2.u9-1
Total Removed Size: 145.31 MiB
:: Do you want to remove these packages? [Y/n]
:: Processing package changes...
No Java environment is set as default anymore
(1/1) removing jre-openjdk-headless [##################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
$ libreoffice --headless --convert-to pdf testdoc.odt
convert ~/Documents/testdoc.odt as a Writer document -> ~/Documents/testdoc.pdf using filter : writer_pdf_Export
I know we are talking about the function of a script here, but no java is needed to export an .odt file as pdf in LibreOffice. File-Export As-Export as pdf.
I don’t get the point of a script. Is it to batch convert?