Pdf.Document.Save : KeyNotFoundException (Foreign Characters)

Hello, I’m having trouble working through the following error when saving a PDF document.

KeyNotFoundException: The given key was not present in the dictionary.

I’ve narrowed down the issue to the foreign characters in the last page of the PDF creating the error. However, I’ve been unable to find a solution that both prevents the error and saves the new document with the characters as shown in the physical PDF file.

We recently upgraded to Aspose.PDF, Version=23.10.0 from an old 2015 version. The old version does not throw the KeyNotFoundException with the same file, but it does not render a majority of characters on the last page. I’m hopeful to find a way to save without error & show all foreign characters on the last page.

problem_pdf_to_html.pdf (4.9 MB)

Below is a simplified code example to recreate the issue. If anyone has any suggestions here I’d greatly appreciate it.

var pdf = new Aspose.Pdf.Document(HttpContext.Current.Server.MapPath(“\Documents\problem_pdf_to_html.pdf”));
pdf.Save(“D:\Documents\problemFileToWord.docx”, SaveFormat.DocX);

@oxcyonDev

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-55901

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.