Skip to content

Commit

Permalink
Fix #659
Browse files Browse the repository at this point in the history
  • Loading branch information
hhrutter committed Jul 31, 2023
1 parent f0e5a70 commit 3161cdf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/pdfcpu/validate/xReftable.go
Expand Up @@ -684,8 +684,16 @@ func validateCollectionFieldDict(xRefTable *model.XRefTable, d types.Dict) error
}

// Subtype, required name
subTypes := []string{"S", "D", "N", "F", "Desc", "ModDate", "CreationDate", "Size"}

if xRefTable.ValidationMode == model.ValidationRelaxed {
// See i659.pdf
subTypes = append(subTypes, "AFRelationship")
subTypes = append(subTypes, "CompressedSize")
}

validateCollectionFieldSubtype := func(s string) bool {
return types.MemberOf(s, []string{"S", "D", "N", "F", "Desc", "ModDate", "CreationDate", "Size"})
return types.MemberOf(s, subTypes)
}
_, err = validateNameEntry(xRefTable, d, dictName, "Subtype", REQUIRED, model.V10, validateCollectionFieldSubtype)
if err != nil {
Expand Down

0 comments on commit 3161cdf

Please sign in to comment.