Skip to content

FIX: apply font_color to PDFs PDFConverter generates - #3136

Merged
Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
u7k4rs6:fix/pdf-font-color
Oct 14, 2026
Merged

Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
u7k4rs6:fix/pdf-font-color

Conversation

@u7k4rs6

Copy link
Copy Markdown
Contributor

Fixes #3105.

Went with the option that doesn't change anything for people who don't pass a color:

  • font_color now defaults to None.
  • Generated PDFs set the fill color to font_color, or black when it isn't set (same as today), and set it again after each page break.
  • Injection items without their own color still fall back to white when font_color isn't set, so hidden injected text keeps working. If font_color is set, they use it.
  • font_color is in the identifier when set. Unset is dropped, so default PDFConverter hashes don't move. I left row_height/column_width/injection_items out to keep this small.

Tests go through convert_async and read the fill-color ops back out of the PDF content stream:

  • generated PDF over several pages with no color, red and white
  • injection with every combo of converter color and item color
  • identifier with and without a color
  • invalid colors still raise

The new ones fail on main. tests/unit/converter, registry and backend/test_converter_service: 2928 passed.

Comment thread tests/unit/converter/test_pdf_converter.py Outdated
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
Merged via the queue into microsoft:main with commit e59d2e3 Oct 14, 2026
55 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.

BUG: PDFConverter ignores font_color when generating a PDF

2 participants