Idea: use Writer docs interchangeable with Python Jinja

Hi,

I have a lot of writer documents, that have forms or template variables in it.
Often I exported a PDF file and put it on my website, so it can be filled out online and printed.
Multiple of my documents have different base layouts in common and I want to bring them alive online to have it like a online form that can be issued with pre-filled data out of a database.
So my first thought was doing it with python and the templating engine Jinja. Later that can easily be integrated/upgraded to a running website by Django or Flask.

I’m trying to find a way, to have only one file and use it in both worlds. One file to edit them all.
Or at least a type of conversion that can easily be exported and consumed by python.
LibreOffice Online powered by Collabora Online Development Edition uses XML files already, right? So maybe there lays a starting point.

Anyone is already doing this or have similar needs and can think of a way to achieve this?

Thanks for your input.

What do you mean? Collabora Online doesn’t use any special kind of XML file; it uses ODF (or other usual supported file types) stored on server.

Doesn’t exchange it information transported over http by xml? How can otherwise the ODF file being displayed by the browsers?

No.

The browser receives a series of bitmaps (tiles), similar to e.g. online maps. The messages themselves between the browser and server use JSON (mostly).

1 Like

I’m afraid you have a misconception about Writer. Writer is intended to write (sophisticated) text making up a flow or stream of arguments. The form designer is a secondary tool provided to allow for “marginal” entry and interactivity.

Your goal reverses the paradigm, making form creation the primary objective, putting totally aside text flow management.

I understand (and approve) your request for common look/layout in your forms. Unfortunately, form controls are graphical objects. They cannot be styled. All you can do is design some generic form in a template file (initial contents) and this about all you can expect: no styles, no automatic update.

IMHO, you should look for a specific form generator. Someone has surely already created such a tool for Django or Flask. This will be less pain than trying to convert ODF (which contains much more than simply forms) to Python.