Converting docx to PDF/A with libre office writer

Viewed 753

I am happily converting docx files to PDF via the command line (controlled via C# process calls) out of my service.

Unfortunately I could not find any internet search results on how to set the options for the output PDF that the GUI offers me. I am specifically looking for generating PDF/A and tagged PDF via the command line.

Anyone ever done this and knows how to do that?

EDIT: Obviously getting a PDF/A can be done by using unoconv instead. On windows one would use the following command line in a checked out unoconv repository:

python.exe .\unoconv -f pdf -eSelectPdfVersion=1 C:\temp\libre\renderingtest.docx

I did not find further information on how to select other things (tagged PDF etc.) and where to get a complete list of the options that are available.

EDIT: It seems as one could try the different options in the GUI. The settings get saved to C:\Users\<userName>\AppData\Roaming\LibreOffice\4\user\registrymodifications.xcu. Then one can look up the changed setting and provide that to unoconv as this:

python.exe .\unoconv -f pdf -eUseTaggedPDF=1 -eSelectPdfVersion=1 C:\temp\libre\renderingtest.docx

Still not sure if I am doing this correctly though.

1 Answers

The gotenberg project shows how that can be done using unocov.

$ curl --request POST 'http://localhost:3000/forms/libreoffice/convert' --form 'files=@"doc.docx"' --form 'nativePdfFormat="PDF/A-1a"' -o pdfA.pdf

Example PDF

enter imageenter link description here description here

Related