We have a .NET 4.8 Framework / C# based console app that processes a folder of PDFs. After upgrading to 11.24, we have, on occasion, had an exception thrown when trying to instantiate a PdfDocument with an existing PDF (that was created by the CoreSuite in another app). I was able to isolate one document where this exception was encountered and run it through an extraordinarily simple/stripped down test console app.
The exception is thrown as soon as the "new PdfDocument()" code is called.
Please note, however, if I change the DLL back to version 11.23 (using NugGet packaga manager), then the exact same code and source PDF work just fine without any exception.
class Program
{
static void Main(string[] args)
{
string filename = ConfigurationManager.AppSettings["filename"];
string docOwnerPassword = @"[blahPassword...]";
PdfDocument doc = new PdfDocument(filename, docOwnerPassword);
}
}
Exception details from VS debugger :
ceTe.DynamicPDF.Merger.PdfParsingException
HResult=0x80131500
Message=There was an error while parsing the PDF file. The PDF is likely corrupt or invalid.
Source=DynamicPDF.CoreSuite
StackTrace:
at ceTe.DynamicPDF.Merger.PdfDocument.p()
at ceTe.DynamicPDF.Merger.PdfDocument..ctor(aba A_0, String A_1)
at ceTe.DynamicPDF.Merger.PdfDocument..ctor(String filePath, String password)
at TestPDF.Program.Main(String[] args) in [blahPath...]TestPDF\Program.cs:line 13
Inner Exception 1:
IndexOutOfRangeException: Index was outside the bounds of the array.