We’re using the latest aspose.Pdf and we’re getting an exception when we add pages to a PDF. The code is below.
public void InsertPageAndTraverseForm()
{
var srcDocument = new Document(@"C:\Users\User\Desktop\FormTest.pdf");
var addDocument = new Document(@"C:\Users\User\Desktop\FormTest.pdf");
foreach (var page in addDocument.Pages)
{
srcDocument.Pages.Add(page);
}
var list = srcDocument.Form.Fields.ToList();
foreach (var item in list)
{
// crash at here
if (item.PageIndex != 1)
{
continue;
}
// other code
}
}
FormTest.pdf (1.3 MB)