Free Support Forum - aspose.com

Aspose.Word Save PDF issue: Requested a name string that is not present in the font

Dear Sir

I just want to find a solution converting word to pdf. And Aspose sound a good one.

But when I download the assembly for the trial use, I always got a error: Requested a name string that is not present in the font.

Below is my code:

using System;
using System.Collections.Generic;
using System.Text;
using Aspose.Words;
using System.IO;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Aspose.Words.Document ddd=new Document ("c:\\test.doc");

ddd.Save("c:\\fff.doc");
ddd.Save("c:\\ffff.txt", SaveFormat.Text);
ddd.Save("c:\\fdf.pdf", SaveFormat.Pdf);
}
}
}

I can get the right doc and txt file but when it came to the pdf save method, I met the error.

Could you tell me whether it is a demo restriction or what else?

thank you!

PS: I use WinXP and Microsoft Visual Studio 2005


Hello

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

Thank you for your interest in Aspose products. Could you please attach your document and fonts, which you use in the document, for testing? I will check the problem on my side and provide you more information.

Aspose.Words evaluation version has only two limitations: it limits the maximum number of paragraphs in the document and adds a watermark at the top of the document.

Also, if you want to test Aspose.Words without the evaluation version limitations, you can request a 30-day Temporary License. Please refer to
http://www.aspose.com/corporate/purchase/faqs/temporary-license.aspx

Best regards,

Thank you for your quick response.

I download the 6.5 demo version in my home computer and it works ok now.

I have another question, when I save the word to pdf, the double bytes conversion is not correct.The word file contains Chinese word in the second line.

I have uploaded the word file, font file and the pdf file.simsun.rar is the Chinese font. Also the right pdf for your reference.

thank you.

Hi

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

Thank you for additional information. The problem occurs because this font is installed as True Type Collection (TTC). Currently, Aspose.Words supports only True Type and Open Type fonts (TTF) upon converting to PDF and XPS. So please try installing TTF version of Simsun fonts (See the attached file).

Also, I think you should use the latest version of Aspose.Words (7.0.0) for evaluation. You can download this version from here:

http://www.aspose.com/community/files/51/file-format-components/aspose.words-for-.net-and-java/category1188.aspx

Hope this helps.

Best regards,

Thank you for your help!

I use the font you attached but the pdf still can not show the Chinese word corrently. I tried a Arial Unicode MS font, which is a TTF font and inluding the double bytes, the pdf looks right. I guess the reason maybe the double bytes word with GB encoding is mis-encoded to Unicode, so I can not get the right look.

Could you use the word I atattched to create a doc file and make the pdf for me?

The jpeg file is how the words looks like.

Thank you!

Regards

Hi

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

Thank you for additional information. I cannot get the text, which you have attached, to be displayed correctly, even in TXT. What options do I need to set to display this text correctly?

But, I can successfully convert the Word document, which you have attached earlier, to PDF. I attached PDF file produced on my side.

Also, maybe it is needed to remove old SimSun font from your PC (means simsun.ttc).

Best regards,

Hello,

I am running a licensed version of Aspose.Words 6.4.0.0 under Windows XP and am experiencing the problem even worse than this poster. SaveToPdf throws “Requested a name string that is not present in the font” in even the most trivial Chinese document, with fonts that are installed as ttf (simhei.ttf and arialuni.ttf). Changing all of the fonts to Arial Unicode MS yielded the same exception. The attached document is an extreme case, with a single character that throws the exception. Can you help in any way?

Thanks,
-Elliott

Hi

Thanks for your inquiry. I cannot reproduce the problem using the latest version of Aspose.Words (7.0.0). You can download this version from here:
http://www.aspose.com/community/files/51/file-format-components/aspose.words-for-.net-and-java/category1188.aspx

Also, I attached PDF document produced on my side.

Best regards,

Hi

In fact I was experiencing some of the same trouble as you mentioned.

In my developing WinXP system, both the 6.5 and the 7.0 version araise the same exception. But when I run the program in another computer, it is OK. So I guess there maybe some problem with the computer's Windows system.

As of the font problem, I tried serveral Chinese ttf fonts and all the PDF I get is not looks right. I found that even I used different fonts, I got the same result. The font is not properly embeded in the pdf.

Because all the system I used were Chinese version of WindowsXP, and in that version, the simsum.ttc is the default font that WinXP used. If we delete the simsum.ttc font from the system, some words in the Windows GUI may be in awful looking, because the system display font(simsum.ttc) is replaced by others.

The Aspose support can create the right pdf, so I thing it may be caused by the Chinese Windows system. If we use the pure English WindowsXP the problem may be resolved. I have no such system, so I can not make the tesing.

At last, as the simsum.ttc is the default font that Chinese Windows support. If the TTC font is supported in the Aspose, maybe the problem will be resolved ultimately.

Kean Wu

Hi

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

Thank you for additional information. Actually, simsun.ttc contains tree fonts SimSun, N SimSun and SimSun-PUA. So, you should install these tree TTF fronts to fully replace SimSun True Type Collection. I have attached all these fonts. Hope this could help you.

Best regards,

My issues seem to be very similar. On the development machine, 6.6 and 7.0 crash, even with .ttf fonts. On other machines the conversion works perfectly. The dev machine is XP SP3, while the working machines are XP SP3 and Server 2003. I have many more fonts on the dev machine than on the working machines - perhaps Aspose is trying to use one of the others by mistake?

Fontlist.txt lists the fonts on the (breaking) dev machine.

Fontlist-working.txt lists the fonts on one of the machines where the conversion works.


Hi Elliott,

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

Thanks for your inquiry. Could you also attach your document here for testing? I will check the issue and provide you more information.

Best regards,

The issues you have found earlier (filed as 9619) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(94)