I'm running into an odd problem. With certain documents, following saving them with PdfSharp, when I try to open them in Adobe Reader, I get the following error message: "There was an error processing a page. A number is out of range."
The simplest version of the code that reproduces this error is as follows:
Code:
using (var pdfDoc = PdfSharp.Pdf.IO.PdfReader.Open(sourcePath, PdfDocumentOpenMode.Modify))
{
pdfDoc.Save(destPath);
}
The above code runs without any exceptions being thrown so I have no idea that anything went wrong until I actually try to open the new file.
Unfortunately I can't share the documents since they have personal information on them, but the commonality seems to be that they were previously signed using DocuSign. I've tried to create a file that causes the error, but I've been unable to do so.
I know that without access to the original documents, it's unlikely that anyone could definitively say what's happening, but does anyone have any advice as to how I could troubleshoot this issue?