mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 03:34:52 +08:00
ignore form dictionaries that do not contain fields #131
though a form dictionary should always contain fields (as required by the spec) it is possible for this entry to be missing. in this case we return false for trygetform.
This commit is contained in:
@@ -83,11 +83,9 @@
|
|||||||
q = qToken.Int;
|
q = qToken.Int;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fieldsToken = acroDictionary.Data[NameToken.Fields.Data];
|
if (!acroDictionary.TryGet(NameToken.Fields, tokenScanner, out ArrayToken fieldsArray))
|
||||||
|
|
||||||
if (!DirectObjectFinder.TryGet(fieldsToken, tokenScanner, out ArrayToken fieldsArray))
|
|
||||||
{
|
{
|
||||||
throw new PdfDocumentFormatException($"Could not retrieve the fields array for an AcroForm: {acroDictionary}.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fields = new Dictionary<IndirectReference, AcroFieldBase>(fieldsArray.Length);
|
var fields = new Dictionary<IndirectReference, AcroFieldBase>(fieldsArray.Length);
|
||||||
|
Reference in New Issue
Block a user