Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Get font information more reliably when removing text #3252

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

samuelbradshaw
Copy link
Contributor

Last month I contributed pull request #3216, an enhancement to PdfWriter.removeText() that allows users to remove only the specified fonts. Since then, I've come across a few PDFs where my simple logic to find fonts wasn't working. This fix walks through the PDF structure to find font references more reliably. I also added a few explanatory comments.

Copy link

codecov bot commented Apr 12, 2025

Codecov Report

Attention: Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.59%. Comparing base (96ba79c) to head (d8bce21).

Files with missing lines Patch % Lines
pypdf/_writer.py 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3252      +/-   ##
==========================================
- Coverage   96.59%   96.59%   -0.01%     
==========================================
  Files          53       53              
  Lines        8957     8976      +19     
  Branches     1648     1658      +10     
==========================================
+ Hits         8652     8670      +18     
  Misses        183      183              
- Partials      122      123       +1     

☔ 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.

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.

1 participant