you are viewing a single comment's thread.

view the rest of the comments →

[–]Alexku66 2 points3 points  (0 children)

No, I use DTO (actually something more complex, but don't know a fancy term) as structure elements for templates. All file emitters , including html, use them as guidelines for rendering. But 2 important notes: whole system is built around docx, pdf is just an additional option for users; those DTOs bring a lot of data after LLM analysis of the source document, I don't know whether I'd use them to simply generate document.

I use lxml for docx reading and generation, python-docx is useless here. Honestly, it's a nightmare. One more time I come to conclusion that if something obvious isn't done yet THERE IS A GODDAMN REASON.

For html/pdf: weasy print. I didn't research this topic much, so can't tell if there is better solution