chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
30 stars 4 forks source link

A LaTeX documentclass with the `draft` option doesn't produce a list of names that can be used to split the PDF #261

Open christianp opened 1 month ago

christianp commented 1 month ago

For a document item, Chirun looks at the /Root/Names part of the PDF's trailer to find the location of each page.

When the draft option is given to the \documentclass command, pdflatex doesn't produce this list of names, so Chirun fails with an error 'PDFPageLookup' object has no attribute 'dests'.

To begin with, we should throw a better error message when we can't get the list of names. Maybe it should also just give up on splitting the PDF and only use the original file.