fix bug where cross reference stream subsections were skipped

a single cross-reference stream may contain multiple disjoint runs of object numbers, previously we only took the first now we load all objects.

adds indexer to array token for ease-of-use.

adds page number and bounds information to all form fields.
This commit is contained in:
Eliot Jones
2019-10-10 16:05:21 +01:00
parent 2ef45f71d5
commit dec4c31a33
15 changed files with 204 additions and 66 deletions

View File

@@ -39,19 +39,20 @@
using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
{
var form = document.GetForm();
Assert.Equal(16, form.Fields.Count);
Assert.Equal(18, form.Fields.Count);
}
}
[Fact]
public void GetsEmptyFormFields()
{
using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
{
var form = document.GetForm();
var annots = document.GetPage(1).ExperimentalAccess.GetAnnotations().ToList();
Assert.Equal(16, form.Fields.Count);
}
}
//[Fact]
//public void GetFormFieldsByPage()
//{
// using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
// {
// var form = document.GetForm();
// var fields = form.GetFieldsForPage(1).ToList();
// var page = document.GetPage(1).ExperimentalAccess.GetAnnotations().ToList();
// Assert.Equal(16, fields.Count);
// }
//}
}
}