Skip to content

BUG: PDFConverter ignores font_color when generating a PDF #3105

Closed

Description

PDFConverter(font_color=...) does nothing when the converter generates a new PDF. _generate_pdf never sets a fill color, so the text is always black. Only the existing-PDF injection path uses a color (per item).

font_color=(255, 0, 0):     fill-color ops in content stream: NONE (default black)
font_color=(255, 255, 255): fill-color ops in content stream: NONE (default black)

It also isn't in the identifier, along with row_height, column_width and injection_items, so PDFConverters with different layouts share an identity.

The catch with a fix: the default font_color is (255, 255, 255). Just applying it would make every default generated PDF white-on-white. So either the default moves to black and the value gets applied, or the param is documented as injection-only. Filing to ask which you'd prefer before sending a PR.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions