When I run the code below to save the
attached test document as a .pdf document, I get an error with the following exception message: “Item has already been added. Key in dictionary: ’ ’ Key being added: ’ '”), and the resulting saved pdf cannot be opened (Adobe Reader pops up a dialog that says: “There was an error opening this document. The file is damaged and could not be repaired.”).
From what I can tell, the problem has to do with the font used in the input document: “Charlotte Small Caps LET”. The font is installed and otherwise works fine. Saving the same Word document as PDF in Word produces a correct PDF document.
Aspose.Words
assembly version: 8.2.1.0.
The font and a test .docx are attached.
Thanks,
Edin Zulich
P.S. Test code:
using System;
using Aspose.Words;
using Aspose.Words.Rendering;
namespace RenderTest
{
class RenderTest
{
static void Main(string[] args)
{
try
{
Document doc = new Document("CharlotteSmallCapsLET.docx");
doc.Save("RenderTestOutput.pdf", SaveFormat.Pdf);
}
catch (Exception e)
{
Console.Error.WriteLine("Error: " + e.Message);
Console.Error.WriteLine(e.StackTrace.ToString());
}
}
}
}