Long story short, I want to build a system that reorders some components in a document file (be it a docx or odt, I don’t have a hard constraint atm).

So my problem input should be a document file, and I need to be able to approximate the number of pages consumed by this document file, I also need to be able to get the height of individual components (like a single paragraph or a table) to have the data I need to rearrange so I can make the document have less pages.

I don’t have a hard constraint on the programming language of the tool either (Python preferred), I prefer not embedding LibreOffice into my system.

Also I’m willing to hear other solutions (maybe my input is not the optimal thing I can use for this problem).

Thanks in advance!

  • Lupec@lemm.ee
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    10 months ago

    Is using something like typst to generate your exams an option? There’d be a learning curve but it’s full of utilities to format and arrange content and whatnot so it feels like it could be a cleaner way of achieving what you want. Plus, it’d make iterating easier and give you more consistency over time going forward

    • Red1C3@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      10 months ago

      Not really no, I need something that I can embed into my application, rather than 3rd party software, my application must work offline too :/