Skip to content

Draw images inside patterns and Type3 glyphs on a layer - #85

Merged
bobsingor merged 1 commit into
embedpdf/mainfrom
embedpdf/fix/layer-pattern-images
Oct 22, 2026
Merged

bobsingor merged 1 commit into
embedpdf/mainfrom
embedpdf/fix/layer-pattern-images

Conversation

@bobsingor

Copy link
Copy Markdown
Contributor

A layer took tiling patterns and Type3 fonts from its base. Their content (a pattern's cell, a glyph's procedure) was parsed for the base, so its images carried the base document, and the layer page's image cache refuses an image of another document. CPDF_ImageLoader then read the cache's current entry: null on a page with no cached image yet (the native runtime crashed, WASM drew nothing), else the previous image's (nothing drawn). Chrome prints every rasterized CSS background as a tiling pattern with one image, and every engine open() is a layer.

  • layer-seam: tiling patterns and Type3 fonts never use the base's entry, as images already didn't. GetCachedType3() drops its base fallback, which can no longer see a base Type3 font.
  • bug-fix: CPDF_PageImageCache::Accepts() holds the same-document rule, and the image loader loads an image the cache refuses without the cache.

A layer took tiling patterns and Type3 fonts from its base. Their content
(a pattern's cell, a glyph's procedure) was parsed for the base, so its
images carried the base document, and the layer page's image cache refuses
an image of another document. CPDF_ImageLoader then read the cache's current
entry: null on a page with no cached image yet (the native runtime crashed,
WASM drew nothing), else the previous image's (nothing drawn). Chrome prints
every rasterized CSS background as a tiling pattern with one image, and every
engine open() is a layer.

- layer-seam: tiling patterns and Type3 fonts never use the base's entry, as
  images already didn't. GetCachedType3() drops its base fallback, which can
  no longer see a base Type3 font.
- bug-fix: CPDF_PageImageCache::Accepts() holds the same-document rule, and
  the image loader loads an image the cache refuses without the cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bobsingor
bobsingor merged commit a756d78 into embedpdf/main Oct 22, 2026
1 check passed
@bobsingor
bobsingor deleted the embedpdf/fix/layer-pattern-images branch October 22, 2026 18:35
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