johnwhitington / cpdf-source

PDF Command Line Tools Source
GNU Affero General Public License v3.0
227 stars 26 forks source link

Merging files regression #367

Closed johnwhitington closed 1 day ago

johnwhitington commented 1 week ago

For example, PO Spec-2.pdf.

This needs bisecting.

johnwhitington commented 1 week ago

Works in v2.7commercial, not in v2.7.1AGPL.

The page appears to get overwritten by part of the structure tree!

johnwhitington commented 1 week ago

This was a bug in Pdfst.renumber_parent_trees. Gated with process_struct_trees for patch release.

To fix. Oddly, though, it seems to work when run from cpdf-source but not when run from bug directory. How can the filenames affect this?

johnwhitington commented 1 day ago

Failing case:

cpdf PO\ GO-0015.pdf Spec-1.pdf Spec-2.pdf -process-struct-trees -o out.pdf

johnwhitington commented 1 day ago

We moved renumber_parent_trees to earlier in the phase order, which seems to have fixed it. Not entirely clear what was going on, though.

What happened, for the record, was that /Contents of a page ended up pointing at part of the structure tree. This looks like a problem between the list of PDFs and the final PDF - some kind of renumbering gone wrong. But we cannot trace it.