Forums

my webapp requires libreoffice, what to do?

Hi all,

I'm considering hosting my webapp on here with a paid account, but my app requires automatically converting uploaded "docx" files to "pdf" format. I've tested several variants of this, and so far the only things I know that work on linux (without comtypes or other windows packages) is to call the libreoffice convert options through a subprocess.

So my question: Is it possible to setup a server here for my website, with libreoffice pre-installed? I obviously can't use "sudo apt install" for this.

Alternative question: Is there a solution for converting docx to pdf without being on windows, AND without libreoffice?

We have abiword installed, and that apparently handles docx files as of version 2.8.0. You can call it from a subprocess -- details here for .doc, I imagine .docx would be similar.

Does anyone have a working example of this? I can't find python code anywhere as an example to convert a .docx to pdf with abiword. These guides are in terminal format.

If you want to do it in Python, you can use some of the methods in the subprocess module to run the code from Python.