this post was submitted on 13 Jan 2024
11 points (100.0% liked)
Programming
17325 readers
143 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
How about generating latex source code, compiling it and getting the page count of the generated PDF? Reorder your set of questions and see if the result is better or worse. Optionally do it in a smart way to reduce the number of PDF compilations you have to do. (Simulated annealing comes to mind for example.)
I think it would be easier to find a library to find the last line on a PDF page than it is to parse unzipped odt files and basically write a layout engine that does the same as libre office just to get the number of pages.
Maybe you can even get Tex to put it in the log during compilation. That would be the most convenient option and seems reasonable to achieve.