Skip to content

Conversation

@PJBrs
Copy link
Contributor

@PJBrs PJBrs commented Nov 13, 2025

This PR adds support for parsing Comb fields in text widget annotations.

Closes #2153

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.14%. Comparing base (103f0f9) to head (41c1729).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3519   +/-   ##
=======================================
  Coverage   97.14%   97.14%           
=======================================
  Files          57       57           
  Lines        9792     9807   +15     
  Branches     1775     1780    +5     
=======================================
+ Hits         9512     9527   +15     
  Misses        168      168           
  Partials      112      112           

☔ View full report in Codecov by Sentry.
📢 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.

@PJBrs
Copy link
Contributor Author

PJBrs commented Nov 14, 2025

@stefan6419846 Thanks for your review!

One question - can you have a look at the doc strings? I hope my solution for how to describe the formatting_kwargs variable is OK. Also, I suppose I could add a link to the TextStreamAppearance class to the list of classes under API in the documentation, but I don't know how (yet).

@PJBrs PJBrs requested a review from stefan6419846 November 14, 2025 19:00
@stefan6419846
Copy link
Collaborator

One question - can you have a look at the doc strings? I hope my solution for how to describe the formatting_kwargs variable is OK.

Sorry, there has been a misunderstanding here. Please keep the old approach, but pass all parameters as named ones instead of positional ones (id est use font_name=font_name when calling it). Further refactoring can come later.

Also, I suppose I could add a link to the TextStreamAppearance class to the list of classes under API in the documentation, but I don't know how (yet).

Is this class really relevant for the pypdf user? We should only include functionality in the official docs which are public and can actually be passed by the user. For me, TextAppearanceStream rather is an internal API for us.

…onal

Two methods in the TextStreamAppearance have rather long lists of arguments:
__init__() and _generate_appearance_stream_data(). This patch passes all
arguments directly related to formatting as named arguments instead of as
positional arguments, to increase code clarity and reduce chances of errors.
@PJBrs
Copy link
Contributor Author

PJBrs commented Nov 16, 2025

@stefan6419846 Now I understand better, thanks for the explanation!

No reason, I think, to add the current class to the API documentation. Should be ready for review!

@stefan6419846 stefan6419846 merged commit bd433f7 into py-pdf:main Nov 17, 2025
16 checks passed
stefan6419846 added a commit that referenced this pull request Nov 23, 2025
## What's new

### Security (SEC)
- Reduce default limit for LZW decoding by @stefan6419846

### New Features (ENH)
- Parse and format comb fields in text widget annotations (#3519) by @PJBrs

### Robustness (ROB)
- Silently ignore Adobe Ascii85 whitespace for suffix detection (#3528) by @mbierma

[Full Changelog](6.3.0...6.4.0)
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.

comb flag in form is not taken into account for apperance generator

2 participants