The headless version of libreoffice uses the PDF settings you define using File -> Export as PDF (not directly export) Adjust the settings you need there, PDF/A 1b is sufficient for most cases.
Basic headless command
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless
Tell libreoffice to convert to PDF
--convert-to pdf:writer_pdf_Export
Define output directory
--outdir ~/Desktop/output
Define input directory / file, supports batch-import of all files of a type Please note: I could not find out a way to support recursive directory loops
~/Desktop/output ~/Desktop/testing/*.pdf
The full example command
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf:writer_pdf_Export --outdir ~/Desktop/output ~/Desktop/testing/*.pd
Profit 🍻