stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
449 stars 167 forks source link

Possible PDF rendering issue in v20.5.0-alpha.X #2363

Open Hypercubed opened 3 weeks ago

Hypercubed commented 3 weeks ago

Possible PDF rendering issue in v20.5.0-alpha.X:

I've been trying to debug an issue I'm seeing rendering a particular PDF (sorry can't share just yet).

When rendered in my app using 20.5.0-alpha.2 (also alpha.0) I'm seeing tables rendered as black boxes in Firefox (and only Firefox):

image

The black boxes are part of the canvas rendering; not the text layer.

Rendering the same PDF locally using v20.2.0 or the showcase (pdfviewer.net) does not render like that.

image

I don't see this in any other browser (tested Chome, Safari, Edge and Brave) but is consistant for Firefox accross OSs (tested Mac, Windows and Ubuntu). Any ideas? I'll work on getting a reproducible PDF that I can share.

Hypercubed commented 3 weeks ago

I've confirmed the issue exists in the showcase when using ngx-extended-pdf-viewer 20.5.0-alpha.X.

image

Here is a PDF that has the issue:

1418006_Iranian_Threat_Group_Updates_Tactics_Techniques_and_Procedures_in_Spear_Phishing_Campaign_webSnapshot-1.pdf

stephanrauh commented 2 weeks ago

I don't see black boxes. I've tried with the current showcase on https://pdfviewer.net, on my developer preview, in Mozilla's showcase (https://mozilla.github.io/pdf.js/web/viewer.html), in native Chrome, in Firefox, in Safari, and in Apple's preview app. All of these programs render the bottom of page 12 correctly. However, there are many missing images, and that's also happening in each of these programs. What's wrong with the document?

As for you issue: maybe it's a Windows issue?

image

Example of a missing image (figure 15):

image
stephanrauh commented 2 weeks ago

Please check if the error also happens on https://mozilla.github.io/pdf.js/web/viewer.html. If so, it's a bug of the pdf.js library, and you'll want to report it over there.

Hypercubed commented 2 weeks ago

Odd... Here is a complete breakdown or what I tested.

While I didn't test all possible permutations; the only consistant variables that produce this issue are:

The work around for my app is to roll back to v20.2.0.

Edit: Also tested stable and bleeding edge. Also no difference.

Hypercubed commented 2 weeks ago

Another point is the pdfjs versions:

Possible issue in pdfjs 4.3?

Hypercubed commented 2 weeks ago

Update Again!!

I am seeing it on the public version of https://pdfviewer.net/ in Firefox when toggled to bleeding edge (pdfjs v4.3.620).

stephanrauh commented 2 weeks ago

Hm. I can reproduce your issue in Firefox, no matter which version of pdf.js I'm using. There are no error messages, no file accesses, no exceptions, just nothing. I'm clueless.

Hypercubed commented 2 weeks ago

This is closest I've found to a similar issue against pdfjs: https://github.com/mozilla/pdf.js/issues/16287

Since this only an issue (for me) on the -alpha versions I'm ok to close it for now. I'll reopen if I see it in a stable version.

Thanks for looking.

stephanrauh commented 2 weeks ago

Well, I'd like to publish the final version soon. I'm afraid it might be a merge that went wrong, but if it is, I'll never find it. I'm not familiar with the rendering engine of pdf.js. Maybe someone else can help?

Hypercubed commented 2 weeks ago

Will bleeding edge be 4.4 when you publish?

Do you see any difference between stable and bleeding edge with the PDF attached here: https://github.com/mozilla/pdf.js/issues/16287 ?

This is the same instance (https://pdfviewer.net/extended), same browser (Firefox 126.0.1), same PDF (test.pdf). Only diffrence is stable vs bleeding edge.

image

stephanrauh commented 2 weeks ago

Yes, I'd like to publish the final version soon - basically I only have to run a comprehensive test, but at the moment, so many new tickets come in I always forget to run my test. Even so, it should be a matter of days of weeks, and I suppose that means that the stable branch is still 4.3 and 4.4 is the bleeding-edge branch.

Hypercubed commented 2 weeks ago

When you have a 4.4 bleeding-edge version I'll be glad to test it.

Hypercubed commented 2 weeks ago

One more data-point then I'll give it rest for today.

I cloned pdfjs and tested my PDF using the webviewer on both master and v4.3.136. Saw no issues in either case.

stephanrauh commented 1 day ago

In the meantime, version 20.5.2 has landed. Any news from your side?