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

Free Support Forum - aspose.com

PPTX to PDF: Chinese characters are not properly exported in PDF (C# .NET)

Hi,

I am using ASPOSE slides 7.4 and it fails to fully convert the attached presentation to PDF.

It shows some characters as squares. knowing the office version of the file views fine, which means the fonts are installed.

Thanks,

M

Hi M,


Thanks for inquiring Aspose.Slides.

I have worked with the presentation file shared by you using Aspose.Slides for .NET 7.4.0 on my end and have not been able to observe the issue specified. For your kind reference, I have attached the generated PDF as well. Please try using the specified version on your end.

Many Thanks,

Can you post the code you used to convert this file? Attached is the file I get when i convert the file.

Hi M,


I have used the following sample for exporting to PDF.

PresentationEx _presentationEx2 = new PresentationEx(path + “Test1.pptx”);
_presentationEx2.Save(path + “Test1.pdf”, Aspose.Slides.Export.SaveFormat.Pdf);


I feel that the fonts used inside your presentation are missing in your operating system. Please install the fonts used in your presentation and then try to export to PDF. I am hopeful things will work other wise there seems no other issue as I am able to export properly.

Many Thanks,

I installed language pack for simplfied and classical chinses. but I still see the issue.

Hi M,


I have retested on my machine and have observed no issue. I am using Aspose.Slides for .NET 2.0 7.4.0 assembly on my end in Windows 7 x64 environment. The issue on your end is that the font used in your presentation are probably missing in your operating system. If you don’t have installed font and you have their availability on the disk then Aspose.Slides also offer to load them from custom location. Please use the following sample in this regard.

FontsLoader.LoadExternalFonts(new string[]{"/Library/Fonts", “/Library/Fonts/Microsoft”});

Please also share the complete environment details with us if there is still an issue even after you have the installed or referred the used fonts while rendering PDF.

Many Thanks,

Hi,

The env is Window7 64. also I downloaded the font which is STXIHEI.TTF and i referenced it using the api you mentioned above and still getting the same problem.

if its Font issue, wouldnt be for the whole text? why I am getting the issue for these characters only?

Thanks,

Mohammed

Hi Mohammed,


I like to share that the issue you are having is due to missing or inaccessible font issue. Please observe the attached image. One PDF has been shared by you and other has been generated by me on my end. You can observe from the list of fonts in document properties of PDF files that your PDF does not include all fonts in it. Since in my case, I don’t have your custom STXIHEI.TTF font installed, so in this case ArialUnicodeMS font is used to render the Chinese characters. I have shared my set of fonts with you over this link. Please install them on your end and then try exporting to PDF. If the issue still persist then please share the STXIHEI.TTF along with other missing rendered fonts with us and I will try to reproduce the issue on my end on the basis of shared fonts.

Many Thanks,

Hello,

I installed the fonts you sent me and that solved the problem.

Many thanks,

Mohammed

Hi Mohammed,


That is really appreciable that things have worked on your end. Please share with us if there is any further help I may offer you in this regard.

Many Thanks,

Can u share font files to me ? Tahnks

@ximoon,

I have observed your comments and like to inform that you may download these fonts from any external source.

Where I can get them?

@ximoon,

Please check attachment.
chinese.stxihei.zip (6.2 MB)