Error When Saving PDF File With Form Fields

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);

@NYoung347
The problem is reproduced with the 24.02 library. When using the 24.11 library, the exception is not thrown.

Thank you for the confirmation. I have tested Aspose.PDF.Drawing version 4.10 (4.11 is not listed in Nuget for this package) with my utility and this has resolved the issue.

@NYoung347
Glad your problem is solved.
Aspose.Pdf.Drawing 24.11 release is expected this week (or early next week).

1 Like

@NYoung347
release Aspose.Pdf.Drawing 24.11 published now.

Thank you for the update. Appreciate the help here