Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backgroundimage is not rendered #13441

Closed
gertot opened this issue May 26, 2021 · 1 comment · Fixed by #13683
Closed

Backgroundimage is not rendered #13441

gertot opened this issue May 26, 2021 · 1 comment · Fixed by #13683

Comments

@gertot
Copy link

gertot commented May 26, 2021

Attach (recommended) or Link to PDF file here:
backgroundimage_not_visible_anonymisiert.pdf

Configuration:

  • Web browser and its version: Chrome Version 90.0.4430.212 (Offizieller Build) (x86_64)
  • Operating system and its version: Windows 10, MacOs BigSur
  • PDF.js version: 2.5.207
  • Is a browser extension: no

Steps to reproduce the problem:

  1. open the document in demo viewer.js

What is the expected behavior? (add screenshot)
The backgroundimage gets rendered like in Acrobat Reader
Bildschirmfoto 2021-05-26 um 09 44 21

What went wrong? (add screenshot)
Backgroundimage is not rendered only some text
Bildschirmfoto 2021-05-26 um 09 43 57

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

@Snuffleupagus
Copy link
Collaborator

This looks like a pattern-related bug, rather than image-conversion related, and in up-to-date PDF.js versions (tested with PDF.js 2.9.273 in Firefox Nightly 90) at least something renders here:
image_pattern

PDF.js version: 2.5.207

Note that that that version is no longer supported, please find the current releases at https://mozilla.github.io/pdf.js/getting_started/#download

brendandahl added a commit to brendandahl/pdf.js that referenced this issue Jun 30, 2021
Previously, when we filled image masks we didn't copy over the current transformation,
this caused patterns to be misaligned when painted. Now we create a temporary
canvas with the mask and have the transform copied over and offset it relative to
where the mask would be painted. We also weren't properly offsetting tiling patterns.
This isn't usually noticeable since patters repeat, but in the case of mozilla#13561 the pattern
is only drawn once and has to be in the correct position to line up with the mask image.

These fixes broke mozilla#11473, but highlighted that we were drawing that correctly by
accident and not correctly handling negative bounding boxes on tiling patterns.

Fixes mozilla#6297,  mozilla#13561, mozilla#13441, mozilla#13111

Partially fixes mozilla#1344 (still blurry but boxes are in correct position now)
brendandahl added a commit to brendandahl/pdf.js that referenced this issue Jul 6, 2021
Previously, when we filled image masks we didn't copy over the current transformation,
this caused patterns to be misaligned when painted. Now we create a temporary
canvas with the mask and have the transform copied over and offset it relative to
where the mask would be painted. We also weren't properly offsetting tiling patterns.
This isn't usually noticeable since patters repeat, but in the case of mozilla#13561 the pattern
is only drawn once and has to be in the correct position to line up with the mask image.

These fixes broke mozilla#11473, but highlighted that we were drawing that correctly by
accident and not correctly handling negative bounding boxes on tiling patterns.

Fixes mozilla#6297,  mozilla#13561, mozilla#13441, mozilla#13111

Partially fixes mozilla#1344 (still blurry but boxes are in correct position now)
brendandahl added a commit to brendandahl/pdf.js that referenced this issue Jul 7, 2021
Previously, when we filled image masks we didn't copy over the current transformation,
this caused patterns to be misaligned when painted. Now we create a temporary
canvas with the mask and have the transform copied over and offset it relative to
where the mask would be painted. We also weren't properly offsetting tiling patterns.
This isn't usually noticeable since patters repeat, but in the case of mozilla#13561 the pattern
is only drawn once and has to be in the correct position to line up with the mask image.

These fixes broke mozilla#11473, but highlighted that we were drawing that correctly by
accident and not correctly handling negative bounding boxes on tiling patterns.

Fixes mozilla#6297,  mozilla#13561, mozilla#13441

Partially fixes mozilla#1344 (still blurry but boxes are in correct position now)
bh213 pushed a commit to bh213/pdf.js that referenced this issue Jun 3, 2022
Previously, when we filled image masks we didn't copy over the current transformation,
this caused patterns to be misaligned when painted. Now we create a temporary
canvas with the mask and have the transform copied over and offset it relative to
where the mask would be painted. We also weren't properly offsetting tiling patterns.
This isn't usually noticeable since patters repeat, but in the case of mozilla#13561 the pattern
is only drawn once and has to be in the correct position to line up with the mask image.

These fixes broke mozilla#11473, but highlighted that we were drawing that correctly by
accident and not correctly handling negative bounding boxes on tiling patterns.

Fixes mozilla#6297,  mozilla#13561, mozilla#13441

Partially fixes mozilla#1344 (still blurry but boxes are in correct position now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants