mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.2k stars 9.96k forks source link

Artwork (background) does not render in XFA Foreground PDF #13630

Open JDziurlaj opened 3 years ago

JDziurlaj commented 3 years ago

Attach (recommended) or Link to PDF file here: https://co.miami.oh.us/DocumentCenter/View/21632/Affidavit-of-Indigency?bidId=

Configuration:

Steps to reproduce the problem:

  1. enableXFA in Firefox Nightly
  2. Open form

What is the expected behavior? (add screenshot) Background PDF renders image

What went wrong? (add screenshot) Four blank pages appear

marco-c commented 3 years ago

Affdavit of Indigency_202011250930184310.pdf

https://web.archive.org/web/20210626132434/https://co.miami.oh.us/DocumentCenter/View/21632/Affidavit-of-Indigency?bidId=

JDziurlaj commented 3 years ago

I can start attaching the forms if that's your preference

calixteman commented 3 years ago

Interesting file because there are some xfa streams but they're almost empty and if I disable xfa, the pdf is rendered correctly. So our heuristic to guess when a pdf should be rendered using xfa stuff is wrong here.

JDziurlaj commented 3 years ago

I think it is a foreground XFA form. These use a regular (non-XFA) PDF as the basis, and then you can put XFA controls "on top". In this case, they didn't add any controls.

calixteman commented 3 years ago

Thank you for the tip. So when we've a full xfa the flag /NeedsRendering in document catalog must be true and for a xfaf (XFA Foreground) it's unset of false.

JDziurlaj commented 3 years ago

Even for Static XFA, which generates a full AcroForm along with the XFA packets, you would still want to invoke the XFA engine so that certain interactivity can be achieved (via the JS API, assuming that's on the roadmap).

marco-c commented 3 years ago

I can start attaching the forms if that's your preference

Actually, it'd be great if you can post a web.archive.org link, so the PDFs will be available forever.

shtstorm commented 1 year ago

I can see the document now in FF 118. Not sure if it's a complete one though.