mozilla / pdf.js

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

Complex XFA forms fail to render properly (or at all), with XFA enabled. #13508

Open sictransit opened 3 years ago

sictransit commented 3 years ago

Attach (recommended) or Link to PDF file here:

Market Authorisation Application form from the European Medicines Agency.

The screenshots and attached file is a "variation form" that is a bit smaller (and easier to fill out).

Filled out version of the variation form.

Configuration:

Google Chrome | 91.0.4472.77 (Officiell version) (64 bitar) (cohort: Stable)
Version | 1cecd5c8a856bc2a5adda436e7b84d8d21b339b6-refs/branch-heads/4472@{#1246}

Steps to reproduce the problem:

  1. enableXfa = true
  2. load the PDF

What is the expected behavior? (add screenshot)

The expected behavior is what Adobe Reader renders, or at least something similar. I am aware that XFA support is still experimental, at best.

image

What went wrong? (add screenshot)

Some parts render OK, but the more complex parts look really strange.

image

There are also lots of warnings like this in the console:

Warning: XFA - Invalid reference: $record.envelope.lists.eeaCountriesExcludingUkNi.item[*].
Warning: XFA - Invalid reference: $record.envelope.lists.eeaCountries.item[*].
Warning: XFA - Invalid reference: $record.envelope.lists.countries.item[*].

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

sictransit commented 3 years ago

Mea culpa!

It seems I failed to enable XFA.

The latest and greatest version of PDF.js actually renders the form. Not well, but that's another issue.

marco-c commented 3 years ago

@sictransit let's keep this open to track rendering this form as it is supposed to be rendered (it is a pretty complex one!)

sictransit commented 3 years ago

Fair enough! I'm preparing a filled out form now and I'll post an example here. It will take some time because, as you said, it's pretty complex.

The empty form actually renders more or less OK, but I'm getting lots of exceptions with a real one.

sictransit commented 3 years ago

I've edited the issue description now, to better reflect the actual problem. I've also attached screenshots and a filled out form for test.

sictransit commented 2 years ago

The latest pre-release (https://github.com/mozilla/pdf.js/releases/tag/v2.11.338) certainly does a much better job. All the information is there, except for scanned signatures.

Issues I've noticed:

image