Converting RTF Files to DOCX and PDF Files on Python-Django and linux server
Question:
Is there any way to accurately convert RTF Files to PDF and DOC files on linux server with Python ? I have gone through a number of past questions and here is what I concluded :
- The libreoffice command line converter is not accurate for my PDF and it does not work at all for DOC.
- Python libraries like PyWin32 work on Windows. I would have to make scripts and host it separately on Windows Server to work with Windows/Microsoft environment. Although I am not sure if it’s worth giving it a try ?
- There are .NET libraries like Aspose.words which will do the work but they are way too costly for a startup.
Any help would be much appreciated.
Answers:
You should take a look at: https://github.com/gotenberg/gotenberg
If you run a separate server for this on your Linux Server it self, it should do the task
As per suggestions and further research by me, I concluded that it is best to implement the 2nd option mentioned in my question itself because of it’s balance between a quality solution and being cost optimal. Although, utilities like libreoffice, latex etc. would do the work on linux but none of them are as accurate and real as a MS Word generated report. For my usecase, I implemented a separate Flask API to run on a windows server with MS Office license on it. It contains just a couple of endpoints, taking RTF file as input, and generating PDF and DOCX each.
Is there any way to accurately convert RTF Files to PDF and DOC files on linux server with Python ? I have gone through a number of past questions and here is what I concluded :
- The libreoffice command line converter is not accurate for my PDF and it does not work at all for DOC.
- Python libraries like PyWin32 work on Windows. I would have to make scripts and host it separately on Windows Server to work with Windows/Microsoft environment. Although I am not sure if it’s worth giving it a try ?
- There are .NET libraries like Aspose.words which will do the work but they are way too costly for a startup.
Any help would be much appreciated.
You should take a look at: https://github.com/gotenberg/gotenberg
If you run a separate server for this on your Linux Server it self, it should do the task
As per suggestions and further research by me, I concluded that it is best to implement the 2nd option mentioned in my question itself because of it’s balance between a quality solution and being cost optimal. Although, utilities like libreoffice, latex etc. would do the work on linux but none of them are as accurate and real as a MS Word generated report. For my usecase, I implemented a separate Flask API to run on a windows server with MS Office license on it. It contains just a couple of endpoints, taking RTF file as input, and generating PDF and DOCX each.