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 :

  1. The libreoffice command line converter is not accurate for my PDF and it does not work at all for DOC.
  2. 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 ?
  3. 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.

Asked By: Abhishek Mittal

||

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

Answered By: Aashutosh Rathi

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.

Answered By: Abhishek Mittal
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.