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

Hi,

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.SetUnicode();
pdfDirectToFile.BindXML( xmlFileName, null );

Many thanks,
Khoa


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

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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 Apsose.Words. Starting from 6.0.0 version Aspose.Words supports direct method of PDF conversion. See the following link for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-convert-a-document-to-pdf.html

Best regards.

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