Embedded pdf fonts issue

Hello Aspose-Support,

I´ve got an issue with the embedded fonts while creating an pdf file which contains chinese characters. The font SimSun is missing, instead ArialUnicodeMS will be embedded, however this font is not available on all targeted systems (e.g. Windows XP).

The following steps will be done:

  1. Read Word Template an fill via MailMerge
  2. Convert all font settings in Word Document to SimSun
  3. Create pdf and save

When I create a pdf out of an web environment (with the same code) SimSun is included - wired behavior.

I attached an example generated under WPF and one under ASP.NET. I also attached a word doc generated before the pdf.

If you need further information or sample code please let me know.

best regards
Markus Klieber

Hello
Thanks for your request. Aspose.Words requires all fonts, which are used in the document to be installed in the environment, where you perform conversion. Fonts are read, during converting to PDF, and embedded into the PDF document. If Aspose.Words cannot find some of fonts, it uses another similar font. So please make sure that SimSun font is installed on both systems where you perform converting to PDF.
Also I cannot reproduce the problem on my side.
Best regards,

Hi Andrey,

thanks for your reply. The pdf conversion is done on one system, so the font is present. It seems, that in both cases the font settings in the word document are ignored.

If I try to generate the pdf file in an testing environment where the SimSun font is installed and the ArialUnicodeMS font is missing I will only get squares instead of chinese characteres.

best regards
Markus

Hello
Thank you for additional information. But I still cannot reproduce the problem on my side using the latest version of Aspose.Words (10.1.0) and the following code for testing:

Document doc = new Document("C:\\Temp\\pre-pdf-output.doc");
doc.Save("C:\\Temp\\out.pdf");

I have Simsun font (version 5.03) installed on my environment.
I sent the document produced on my side to your e-mail.
Best regards,

Hi Andrey,

I solved my issue. I tried this after loading the template, mail merge and changing the font:

var inMemory = new MemoryStream();

content.WordDoc.Save(inMemory, SaveFormat.Doc);

var document = new Document(inMemory);

document.Save("C:\document.pdf");

Your are right that creating an pdf from the file I attached will not reproduce my issue, however your last post leaded my in the right direction and I created another document in memory and converted that into pdf. That works

best regards

Hi
It is perfect, that you already fond the reason of the problem. Please let me know in case of any issues, I will be glad to help you.
Best regards,