问题
I would like to use OO/LO PDF generation capabilities in my applications. To do it, I need to be able to modify a previously generated odt template from my code. The modification would be simple text replacements only (which do not even require regexes).
OO's developer's guide does not contain any examples or tutorials which would allow me to do what I need to do.
Neither is LO's developer's guide useful. It contains multiple java examples, but no useful C++ code.
For both APIs a doxygen documentation is available - but there is no general introduction and browsing the entire code base and reverse engineering the classes and discovering how to use them is too tedious and cumbersome.
To sum up: how can I modify odt files using a C or C++ API?
回答1:
I ended up extracting the archive, processing and editing xml, then packing it back up again.
Worked well.
回答2:
Qt has ODT file handler by default
http://doc.qt.io/qt-5/qtextdocumentwriter.html
来源:https://stackoverflow.com/questions/21039575/how-to-programatically-modify-open-libre-office-odt-document