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

XFA Form fails to load with columnWidths error #13582

Open JDziurlaj opened 3 years ago

JDziurlaj commented 3 years ago

Attach (recommended) or Link to PDF file here: https://bsdwebstorage.blob.core.windows.net/journalgerinfo/Conflict-of-interest_statement.pdf

Steps to reproduce the problem:

  1. Enable XFA support
  2. Open form

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

What went wrong? (add screenshot) PDF does not load with error

Warning: XFA - an error occured during layout: TypeError: node[$extra].columnWidths is undefined

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

JDziurlaj commented 3 years ago

This renders now, although it has some rendering issues (some JavaScript and table layout) as well.

symtalha14 commented 3 years ago

image I'm getting this.

calixteman commented 3 years ago

You can see this pdf in Firefox nightly: https://www.mozilla.org/en-US/firefox/channel/desktop/ and then you enable enableXfa in using about:config. With a local setup, you can set option enableXfa to true in web/app_options.js (see https://github.com/mozilla/pdf.js/blob/caaf77375f4a1b1ee2e9402ec5a2f5d25a65e161/web/app_options.js#L197).

Snuffleupagus commented 3 years ago

The only way for https://github.com/mozilla/pdf.js/issues/13582#issuecomment-877397848 to happen is if you're not actually following the STR which explicitly says (note the first step):

Steps to reproduce the problem:

  1. Enable XFA support
  2. Open form

This isn't really related to this issue, which is about a XFA document not rendering once support has been manually enabled; please try to limit unrelated discussion in issues since that can often make things more difficult to follow.

symtalha14 commented 3 years ago

This isn't really related to this issue, which is about a XFA document not rendering once support has been manually enabled; please try to limit unrelated discussion in issues since that can often make things more difficult to follow.

I understand your point but as @calixteman pointed out this pdf can be viewed in Firefox Nightly, It wasn't mentioned in the STR, Hence the confusion. Thanks for the clarification.

marco-c commented 3 years ago

This is working well now.

marco-c commented 3 years ago

The remaining issues are related to JS.