How to programatically modify Open/Libre Office odt document?

此生再无相见时 提交于 2021-02-07 08:54:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!