question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New soft mask method causes some text not to be rendered

See original GitHub issue

Half of the text on this restaurant menu PDF does not render in current versions of PDF.js. I remembered that this PDF used to render correctly in Firefox, so I ran git bisect and identified commit 2d1f9ff7a3a8e29acd7500add4a1057a5eaba191 as the change which introduced the regression.


Attach (recommended) or Link to PDF file here: Tillamook-Market-Menu-04.04.22.pdf

Configuration:

  • Web browser and its version: Firefox 101.0 arm64
  • Operating system and its version: macOS 12.4
  • PDF.js version: git master (19539676813b5df6ca4726a1bfa6765193b1067c)
  • Is a browser extension: No

Steps to reproduce the problem:

  1. Open the PDF.
  2. Observe that roughly half the text on the menu does not appear.

What is the expected behavior? (add screenshot) Screen Shot 2022-06-02 at 8 47 03 PM

What went wrong? (add screenshot) Screen Shot 2022-06-02 at 8 47 12 PM

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
VictoriaSarychevacommented, Sep 12, 2022

Hello! We have a 2 big customers with the same problem, please, post here any updates (@Snuffleupagus would be so much appreciated)

0reactions
Snuffleupaguscommented, Oct 24, 2022

Having managed to create a slightly smaller test-case, see issue14982_reduced.pdf, I now understand more specifically what breaks. Although I’ve not managed to (immediately) see how to fix this, however the problem is connected to SMasks larger than https://github.com/mozilla/pdf.js/blob/987062c302c01bab72645e28a1ffa3fd457e1eb6/src/display/canvas.js#L49 since disabling the following code “fixes” this, and the duplicate, issue https://github.com/mozilla/pdf.js/blob/987062c302c01bab72645e28a1ffa3fd457e1eb6/src/display/canvas.js#L2665-L2672 Looking at the old code, we were previously taking the smask.scaleX/smask.scaleY into account during composeSMask. Unfortunately trying to restore, a variant of, that code doesn’t work and most likely other (possibly larger) changes are required.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Soft Mask - A replacement of Unity UI Mask with alpha support
Soft Mask assumes that the mask area is planar and rectangular. In general case, there is no way to pass a description of...
Read more >
text-rendering - CSS: Cascading Style Sheets - MDN Web Docs
The text-rendering CSS property provides information to the rendering engine about what to optimize for when rendering text.
Read more >
Create masks - Adobe Support
The Create Masks From Text command extracts the outlines for each character, creates masks from the outlines, and puts the masks on a...
Read more >
Text Rendering controls in Motion - Apple Support
The mask tools in the canvas toolbar are not available when Flatten is deselected. ... Render Text: A pop-up menu to choose a...
Read more >
16xAA font rendering using coverage masks, part I
Rendering fonts should be very fast, no stalls while fonts are being rendered. Our UI has a lot of smooth animation, text should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found