PDF problem with cyrillic symbol

Received : 2007/10/17 08:03:55
Message : Hello, Support!

I’ve encountered problem saving documents in PDF. When I try to save text in Cyrillic encoding, nothing appending to the result document, every cyrillic symbol will be missing.

Pdf pdf1 = new Pdf();
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
sec1.Paragraphs.Add(new Text("Текстовое сообщение"));
pdf1.Save("d:/temp.pdf");

But if I load document with cyrillic words from XML, and then save it to PDF – everything will be OK.

Pdf pdf1 = new Pdf();
pdf1.BindXML("d:/temp.xml", null);
pdf1.Save("d:/temp.pdf");

Need your assistance to solve this problem


This message was posted using Aspose.Live 2 Forum

Can you please provide the temp.xml and let us check it?

I tried the following code and it works:
Text text1 = new Text(“Текстовое сообщение”);
text1.Segments[0].TextInfo.IsUnicode = true;
text1.Segments[0].TextInfo.FontName = “Times New Roman”;

Thanks a lot!

Your code sample is working, but now I have one more problem with exporting - it takes approximately 15-20 seconds to save document, even it has one word in content.



Can your help me in reducing this time?



P.S. temp.xml in my previous sample - is xml file generated from *.doc file (with cyrillic symbols) using “Document” class.

Please set font map like the following:
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = @“d:\test”;

But there is time interval before the first document saving (when generating Aspose.Pdf.TruetypeFontMap.xml). Caching works only for the following savings



So I need to generate this file for every computer where my programm works…



If there is no chance to me to completely remove time delays with current version of Aspose.Pdf, can you try to solve this problem in future versions? because Aspose.Pdf exporting perfectly works with English language and it will be great if it would work with Russian too;)

Sorry I don’t think we can improve it in the future version. Aspose.Pdf has to use more time to generate the font map for the first time. Sorry for the inconvenience.