First time here? Check out the FAQ!
asked 2012-05-11 20:44:13 +0200bhui
Hey, I need to convert various kinds of documents (.docx, .doc, .rtf, .odt, others) to PDF/A format using libreoffice in headless mode from the command line (linux). What would the command be for doing this? Specifically, what do I give as the "-convert-to" parameter? TIA :-)
This link explains that the headless PDF conversion uses the last options set in the GUI PDF conversion, so the solution is to set the PDF/A option in the GUI then use the headless mode.
Or you can change the configuration file. The only thing that seems to be changed when the PDF/A option is toggled on is a number in the .libreoffice/3/user/registrymodifications.xcu file. The entry
<item oor:path="/org.openoffice.Office.Common/Filter/PDF/Export"><prop oor:name="SelectPdfVersion" oor:op="fuse"><value>0</value></prop></item> has the value changed from 0 to 1.
The xcu file seems to be mostly one long line, so it isn't clear to me how best to edit it.
answered 2012-05-12 21:12:26 +0200bhui
@w_whalley Thanks! Huh, interesting. Doesn't sound all that stable for a production environment where we want the behavior to be consistent...I have a feeling that I'll end up writing a Python script to do the whole thing (including setting the property programmatically). I had hoped to be able to use a neat one-liner, but I guess sometimes entire scripts are necessary ;-)
For anybody interested in what I'm using for the solution, see here: http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export (specifically the SelectPdfVersion property).
LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!
Asked: 2012-05-11 20:44:13 +0200
Seen: 3,503 times
Last updated: May 21 '12