Hello,
I am encountering a problem with converting this word document to PDF using the latest version of Aspose.PDF (2.9.5) and the page with the Table of Contents (TOC) give an error. The rest of the page shows up just fine. Attached is the word document I am trying to convert. Also my code to convert is simply this:
Document doc = new Aspose.Words.Document(filename);
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.FormatAsposePdf);
//Read the document in Aspose.Pdf.Xml format into Aspose.Pdf.
Pdf pdf = new Pdf();
pdf.IsCoreFontUsed = false;
pdf.TextInfo.IsFontEmbedded = true;
foreach (Aspose.Pdf.Section section in pdf.Sections)
foreach (Aspose.Pdf.Paragraph paragraph in section.Paragraphs)
if (paragraph is Aspose.Pdf.Text)
foreach (Aspose.Pdf.Segment segment in ((Aspose.Pdf.Text)paragraph).Segments)
segment.TextInfo.IsFontEmbedded = true;
pdf.BindXML(stream, null);
iStepNumber++;
pdf.Save(outpath + filename + “.pdf”);
Your help would be greatly appreciated.
Best Regards,
Patrick