I am writing a program that requires input as a document, it needs to replace several values, insert a table and convert it to PDF. It is written in Python + Qt (PyQt). Is there a well-known document standard that can be easily used programmatically? It should be a cross platform and preferably open.
I looked at Microsoft Doc and Docx, which are binary formats, and I cannot edit them. Python has bindings for it, but they are only on Windows.
Open Office ODT / ODF is encrypted in an XML file, so I can edit it, but there are no command line utilities or in any way programmatically convert the file to a PDF file. Open Office provides bindings, but you need to start Open Office from the command line, start the server, etc. And my clients may not have Open Office installed.
RTF is readable with Python, but I could not find a way / libraries for converting RTF documents to PDF.
I am currently exporting from Microsoft Word to HTML, replacing values ββand using PyQt to convert it to PDF. However, it loses formatting features and looks awful. I am surprised that there is no well-known library that allows you to edit various document formats and convert them to other formats, am I missing something?
Update: thanks for the tip, I'll take a look at using Latex.
Thanks Jackson
source
share