Skip to content

fix: base64 and document images corrupted or missing in PDF export - #106

Open
Herafia wants to merge 1 commit into
mainfrom
fix/pdf-images-sanitized-src-12
Open

Herafia wants to merge 1 commit into
mainfrom
fix/pdf-images-sanitized-src-12

Conversation

@Herafia

@Herafia Herafia commented Oct 23, 2026

Copy link
Copy Markdown

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

The re-sanitization added to displayText() encodes “=” and “+” in the attributes: document images were no longer recognized (white areas) and base64 images were corrupted, causing TCPDF (imagecolorat) to crash. The src attribute of each image is now decoded; the image is validated using GD and then passed to TCPDF as a data stream; any unreadable image is ignored.

@Herafia Herafia self-assigned this Oct 23, 2026
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