Merge pull request #14218 from janekotovich/subform_min_0

XFA subform with occur min=0 and no bound data displaying.
This commit is contained in:
calixteman 2021-11-05 04:12:34 -07:00 committed by GitHub
commit e136afbabc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View File

@ -635,6 +635,13 @@ class Binder {
/* skipConsumed = */ this.emptyMerge
).next().value;
if (!match) {
// If there is no match (no data) and `min === 0` then
// the container is entirely excluded.
// https://www.pdfa.org/norm-refs/XFA-3_3.pdf#G12.1428332
if (min === 0) {
uselessNodes.push(child);
continue;
}
// We're in matchTemplate mode so create a node in data to reflect
// what we've in template.
const nsId =

View File

@ -213,6 +213,7 @@
!issue4402_reduced.pdf
!issue845r.pdf
!issue3405r.pdf
!issue14130.pdf
!issue7339_reduced.pdf
!issue3438.pdf
!issue11403_reduced.pdf

BIN
test/pdfs/issue14130.pdf Normal file

Binary file not shown.

View File

@ -4402,6 +4402,13 @@
"link": false,
"type": "eq"
},
{ "id": "issue14130",
"file": "pdfs/issue14130.pdf",
"md5": "82e7efb0a10122e793fc64348d93dc4e",
"enableXfa": true,
"rounds": 1,
"type": "eq"
},
{ "id": "issue6151",
"file": "pdfs/issue6151.pdf",
"md5": "926f8c6b25e6f0978759f7947d70e079",