Skip to content

fix(pdf): fixed issue causing garbled black results#306

Merged
tedwaine merged 2 commits into
AcademySoftwareFoundation:developfrom
kenmcgaugh:pdf_reader_fix
Jul 9, 2026
Merged

fix(pdf): fixed issue causing garbled black results#306
tedwaine merged 2 commits into
AcademySoftwareFoundation:developfrom
kenmcgaugh:pdf_reader_fix

Conversation

@kenmcgaugh

Copy link
Copy Markdown
Contributor

Many PDF files do not have an explicit background and for them the QPdfDocument render() method produced unpremultiplied RGB over black. This fix composites the rendered result over white for both the "Pages RGB" stream and thumbnails. This leaves the "Pages RGBA" stream over black, but it has been modified to premult the RGB so that if it were composited 'over' a white image it would look correct.

kenmcgaugh and others added 2 commits July 8, 2026 12:26
Many PDF files do not have an explicit background and for them the QPdfDocument render() method produced unpremultiplied RGB over black. This fix composites the rendered result over white for both the "Pages RGB" stream and thumbnails. This leaves the "Pages RGBA" stream over black, but it has been modified to premult the RGB so that if it were composited 'over' a white image it would look correct.

Signed-off-by: Ken McGaugh <ken@mcgaugh.co.uk>
@tedwaine tedwaine merged commit c3ab3d6 into AcademySoftwareFoundation:develop Jul 9, 2026
3 of 4 checks passed
@tedwaine

tedwaine commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Nice one @kenmcgaugh. thanks!

@kenmcgaugh kenmcgaugh deleted the pdf_reader_fix branch July 9, 2026 19:14
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