I’m using LibreOffice on my server to convert Excel files to PDFs via the command line. After upgrading from LibreOffice version 7.4 to version 24.8, I noticed that the generated PDFs have significantly increased in size (from 152 KB to 3541 KB), despite the content and layout of the PDF being identical before and after the upgrade.
Command I’m using:
/libreoffice24.8/program/soffice --headless --nologo --nofirststartwizard --convert-to pdf --outdir /tmp /tmp/inputFile.xlsx
What I’ve observed: Before the upgrade: The generated PDF size was 152 KB, and the “Tagged PDF” property was set to No. After the upgrade: The generated PDF size is 3541 KB, and the “Tagged PDF” property is set to Yes. The content, orientation, and overall look of the PDFs are exactly the same.
What I’ve tried: Attempted to disable tagged PDFs using the following command, but got an error:
/libreoffice24.8/program/soffice --headless --nologo --nofirststartwizard --convert-to pdf --export-tagged-pdf=off --outdir /tmp /tmp/inputFile.xlsx
This resulted in the error: Error in option: --export-tagged-pdf=off
Used the writer_pdf_Export filter:
/libreoffice24.8/program/soffice --headless --nologo --nofirststartwizard --convert-to pdf:writer_pdf_Export --outdir /tmp /tmp/inputFile.xlsx
This did not reduce the file size.
Tried specifying the PDF version with this command:
libreoffice24.8/program/soffice --headless --nologo --nofirststartwizard --convert-to pdf:writer_pdf_Export:selectPdfVersion=1 --outdir /tmp /tmp/inputFile.xlsx
But the file size remained the same.
My requirements: I need to reduce the PDF file size to a level similar to what it was before the upgrade (around 152 KB). Disabling tagged PDFs is likely part of the solution, as tagging seems to be increasing the file size. I’d like to know if there’s a way to disable tagging or reduce the PDF size using LibreOffice’s command-line options in version 24.8.
Any guidance on how to resolve this issue would be greatly appreciated!