-
Notifications
You must be signed in to change notification settings - Fork 10k
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
New soft mask method causes some text not to be rendered #14982
Comments
Interestingly enough, this seems to be somehow connected to the current canvas size and/or the zoom level. At around 50%, and below, the document actually renders correctly. |
I filed a bug on Bugzilla so we can track the regression, https://bugzilla.mozilla.org/show_bug.cgi?id=1772498. |
I can reproduce on my machine too. At 20% zoom some additional text appears, at 10% all text appears. |
@Snuffleupagus since this is a regression from #14175 and you reviewed that one, you probably have the most context here. Would you mind looking into this? |
Hello! We have a 2 big customers with the same problem, please, post here any updates (@Snuffleupagus would be so much appreciated) |
While I reviewed that one, I don't really have any deeper understanding of the code (since the SMask-handling is often quite complex). To make matters worse the test-cases are usually very big and complicated, as happens to be the case here, which makes debugging challenging.
Please keep in mind that this is an open-source project that you're able to use for free. Hence, rather than expecting unpaid contributors to work for free, have you considered letting one (or more) of your developers help out with debugging or even fixing this issue!? |
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 Line 49 in 987062c
since disabling the following code "fixes" this, and the duplicate, issue Lines 2665 to 2672 in 987062c
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.
|
Any plans on fixing that? |
Hi @Snuffleupagus - I am working on fixing this issue. I see that disabling the below does "fix" the issue. Lines 2665 to 2672 in 987062c
Why do we need that code? If I leave it commented out and view other pdfs I have, they still look good. I'm still ramping up on pdf.js so apologies if this is a basic question. Any information you have on this would be great. Thank you! |
If I understand correctly:
So I'd be in favor of removing this limit. |
The way that I'm reading this is that it wasn't directly linked to WebGL support, but more about reducing overall memory usage (and improving performance) when handling SMasks, given that the limit was added in its own commit: 5262e6f
Would it still not be a good idea to actually debug and fix this regression first, before we consider outright removing the limit? What worries me here: Imagine if we just remove the limit, and that leads to issues for users e.g. on lower powered/memory hardware? In that case we might need to re-add the limit, which would cause this bug (and its duplicates) to re-appear. |
Tbh I don't really know what's the best here. |
One quick data-point regarding the
Given that this is on up-to-date and powerful hardware, I can't imagine that e.g. a mobile phone will handle an increased limit very well. Maybe we should consider increasing the limit a little bit by default, but keep the old value for the |
In term of performance, the main issue is the use Lines 899 to 910 in 351d11c
I think we could apply:
And probably we could do some similar stuff for: Lines 873 to 897 in 351d11c
I didn't test anything (it's on my todo) but I think it could work. I do wonder if we could just draw on the |
Thanks for looking into this @Snuffleupagus and @calixteman. @Snuffleupagus - you mentioned:
If the document is very tall, it still gets clipped if the document is smaller than What would you all think about adding |
Another (better?) option here may be to add something like @calixteman - it sounds like you have an idea for a more robust approach but I wanted to present this idea as well. |
Are we OK increasing or removing MAX_GROUP_SIZE after the performance improvements from #18029? |
I think we must remove this limit:
So I think we must at least try, wait and see if users complain. |
…r not It fixes issues mozilla#14982 and mozilla#14724. The main problem of upscaling a canvas is that it can induces some pixelation (see issue mozilla#14724). So this patch is just removing the limit and as a side effect it fixes issue mozilla#14982. As far as I can tell, in looking different profiles (especially some memory profile) in using the Firefox profiler, I don't see any noticeable difference in term of memory use.
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 2d1f9ff as the change which introduced the regression.Attach (recommended) or Link to PDF file here: Tillamook-Market-Menu-04.04.22.pdf
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
What went wrong? (add screenshot)
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): n/a
The text was updated successfully, but these errors were encountered: