Skip to content

ROB: Handle a Tf operator with a missing size or no operands in layou… - #4228

Merged
stefan6419846 merged 1 commit into
py-pdf:mainfrom
RavSinghChandan:layout-tf-missing-operands
Oct 20, 2026
Merged

stefan6419846 merged 1 commit into
py-pdf:mainfrom
RavSinghChandan:layout-tf-missing-operands

Conversation

@RavSinghChandan

@RavSinghChandan RavSinghChandan commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

In layout mode, a Tf operator without its size operand (/F1 Tf) made extract_text() raise IndexError, and so did a bare Tf with no operands at all. Plain mode already handles both.

Now a missing or non-numeric size keeps the current font size, and a missing font name resolves to the same placeholder font as an unknown one (see resolve_font()), so the rest of the page is still extracted. The two call sites share a small helper, set_font_operation().

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.19%. Comparing base (32fd5fb) to head (52fda5a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4228   +/-   ##
=======================================
  Coverage   98.18%   98.19%           
=======================================
  Files          59       59           
  Lines       11820    11827    +7     
  Branches     2226     2226           
=======================================
+ Hits        11606    11613    +7     
  Misses        118      118           
  Partials       96       96           

☔ 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 81f774e into py-pdf:main Oct 20, 2026
23 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