Skip to content

ROB: Add outline items when the outlines are not an indirect dictionary - #4305

Merged
stefan6419846 merged 2 commits into
py-pdf:mainfrom
RavSinghChandan:outline-root-not-a-dictionary
Nov 2, 2026
Merged

stefan6419846 merged 2 commits into
py-pdf:mainfrom
RavSinghChandan:outline-root-not-a-dictionary

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

PdfWriter.add_outline_item() on a document whose /Outlines entry is a number, array, string or null raised a TypeError ('NumberObject' object is not iterable), and one whose /Outlines is a direct dictionary raised AttributeError: 'DictionaryObject' object has no attribute 'indirect_reference', because get_outline_root() wrapped the entry in a TreeObject and replaced it by its object number.

A direct dictionary is now stored as a new indirect outline root, and an entry that is not a dictionary is replaced by a new outline root, with a warning unless it is null

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.67%. Comparing base (16dca36) to head (11e7cad).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4305   +/-   ##
=======================================
  Coverage   98.66%   98.67%           
=======================================
  Files          59       59           
  Lines       12102    12110    +8     
  Branches     2298     2302    +4     
=======================================
+ Hits        11941    11949    +8     
  Misses         84       84           
  Partials       77       77           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846
stefan6419846 merged commit 6ff5244 into py-pdf:main Nov 2, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants