We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cannot retain font when converting from doc to xml


I use following command to convert doc file to xml file that is used to convert to pdf file later:

Aspose.Words.Document doc = new Aspose.Words.Document(docFileName);
doc.Save( xmlFileName, SaveFormat.AsposePdf );

However, all fonts in my doc file have been changed to “Times New Roman” font when I look at the returned xml file. So texts inside my doc file cannot be shown in PDF file if they use special fonts like “MingLiU”. Is there any way I can retain original fonts when converting from doc to xml ?

I use following command to convert xml to pdf:

Pdf pdfDirectToFile = new Aspose.Pdf.Pdf.CreatePdfComponent( fileStreamOut );
pdfDirectToFile.TextInfo.IsUnicode = true;
pdfDirectToFile.BindXML( xmlFileName, null );

Many thanks,

This message was posted using Page2Forum from Fonts embedding while creating PDF - Aspose.Pdf for .NET


Thanks for your inquiry. Could you please attach your document here for testing?
Also, please note that converting to PDF through intermediate XML is obsolete. So consider using the latest version of Aspose.Words. Starting from 6.0.0 version Aspose.Words supports direct method of PDF conversion. See the following link for more information:
Best regards.

Thank you very much for your answer. It works fine now.