Hello. I am running into an issue saving a PDF file that has PDF form fields. The file is the 941-x tax form from the IRS website, found here. Calling the save method on this file throws an “Index was outside the bounds of the array” error.
I am using version 24.2 of the Aspose.PDF.Drawing nuget package
I wrote a simple console app that takes a file path as input. If I provide this file to this application, I get the exception. I also determined that if I split the pdf and use just the first page as input, the app does not throw an exception.
Here are the PDF files I’m using to test
PDFFiles.zip (254.4 KB)
The code for the console app is as follows
using Aspose.Pdf;
byte[] fileContents = File.ReadAllBytes(args[0]);
new License().SetLicense("Aspose.Total.NET.lic");
using MemoryStream stream = new MemoryStream(fileContents);
using Document document = new Document(stream);
document.Save(new MemoryStream(), 0);