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 Binding error in Form #13756

Open JDziurlaj opened 3 years ago

JDziurlaj commented 3 years ago

Attach (recommended) or Link to PDF file here: Attestation_d'occupation.pdf https://services.groups.be/docgenerator/Docgen/FormRequest.aspx?noDocument=90101&noGroupe=10&cdLangue=1 Configuration:

Steps to reproduce the problem:

  1. enableXfa = true
  2. Open form

What is the expected behavior? (add screenshot)

What went wrong? (add screenshot) image

Document does not load. Warning: XFA - an error occurred during parsing and binding: TypeError: can't access property Symbol.iterator Warning: XFA - an error occurred during layout: TypeError: can't access property Symbol(), this.form is undefined

Snuffleupagus commented 3 years ago

Document does not load. Warning: XFA - an error occurred during parsing and binding: TypeError: can't access property Symbol.iterator Warning: XFA - an error occurred during layout: TypeError: can't access property Symbol(), this.form is undefined

Fixing the breaking error specifically looks pretty trivial, and I can submit a patch for that in case it's deemed helpful. (Although there's likely other things wrong with this document and those bugs I probably cannot fix.)

calixteman commented 3 years ago

@Snuffleupagus, feel free to fix whatever you want ;): your help is greatly appreciated. Anyway, the binding ref make a reference to $record: as far as I understand specs, it's related to data coming from an external source (see chapter Exchanging Data Between an External Application and a Basic XFA Form) so we won't implement anything related to that stuff but if I misunderstood specs please tell me. And there are few layout issues...

JDziurlaj commented 3 years ago

$record allows for windowing a larger dataset, including XML embedded in the xfa data dom. For example, a subset of data can be rendered on to the form at once. The config dom present.common.data.record value stores the location of the repeating record value. I can upload an example if needed.

calixteman commented 3 years ago

@JDziurlaj, +1 for an example.

JDziurlaj commented 3 years ago

example datawindow.pdf