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

PDF File - Some backgrounds not rendered in PDFJS Demo Viewer #13111

Closed
blackmambahk opened this issue Mar 16, 2021 · 3 comments
Closed

PDF File - Some backgrounds not rendered in PDFJS Demo Viewer #13111

blackmambahk opened this issue Mar 16, 2021 · 3 comments

Comments

@blackmambahk
Copy link

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

Configuration:

  • Web browser and its version: Chrome Version 89.0.4389.90 (Official Build) (64-bit) (and Firefox 86.0.1)
  • Operating system and its version: Windows 10
  • PDF.js version: ?? Whatever Is Used by the site mozilla.github.io/pdf.js today - I think it is 2.8.240
  • Is a browser extension: NO

Steps to reproduce the problem:

  1. Open attached file
  2. Goto Page 6 - half the page is white when it should black

What is the expected behavior? (add screenshot)
Screenshot Chrome Native

What went wrong? (add screenshot)
Screenshot Demo Viewer

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

@HAPENLY
Copy link

HAPENLY commented Mar 17, 2021

Check whether it is related to the maximagesize property

@CetinSert
Copy link
Contributor

SVG rendering fail for all pages with

Error: Invalid SVG dimensions
    at unreachable (pdf.min.js:22)
    at assert (pdf.min.js:22)
    at DOMSVGFactory.create (pdf.min.js:22)
    at SVGGraphics._makeTilingPattern (pdf.min.js:22)
    at SVGGraphics._makeColorN_Pattern (pdf.min.js:22)
    at SVGGraphics.setStrokeColorN (pdf.min.js:22)
    at SVGGraphics.executeOpTree (pdf.min.js:22)
    at SVGGraphics.group (pdf.min.js:22)
    at SVGGraphics.executeOpTree (pdf.min.js:22)
    at SVGGraphics.group (pdf.min.js:22)

@SamyCookie
Copy link

SamyCookie commented May 13, 2021

It does not work with with PDF.js in Firefox 88 but seems to fixed now with current master version.

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants