We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

chinese text with 'Segoe UI' font family is not visible in PDF

Hi,
I have created a word file using Syncfusion dll through .net code. and i am just displaying the below html text in the word document using paragraph.AppentHtml method.

<span style="font-family: 'Segoe UI'; direction: ltr; word-wrap: break-word; color: #000000; font-size: 10pt;" dir="ltr">你好</span>Help

In word document i am able to see all the text and all the style is applied in the text.

Now i have converted this word file into the PDF file using the below code. Now in the PDF file text  '你好' is not visible only Text 'Help' is visible. But if i select all text from the generated PDF file and paste it in the Notepad file then complete text '你好 Help' is copied. It means complete text is exist in the PDF but it is not visible. Now what i did I have removed the font family 'font-family: 'Segoe UI'' from the above html text. and i did again the same thing, now complete text is visible in the PDF file. it means issue is with the font family.And this font family is listed in font family list of the word document so it means it is exist in the system so we can not say that font family is not exist. Please help me on this what i need to do  because we can not remove the font family from the html text.


DocToPDFConverter converter = new DocToPDFConverter();

 

PdfDocument pdfDoc = converter.ConvertToPDF(wordDoc);

pdfDoc.Save("RFPQuoteSlip_" + DateTime.Now.ToString() + ".pdf", Response, HttpReadType.Open);


13 Replies

KK Karthik Krishnaraj Syncfusion Team November 17, 2014 12:47 PM UTC

Hi Amit Kumar,

Thank you for your interest in Syncfusion Products.

We suspect this to be defect from our side, we logged issue report for this, and we will be fixing it internally.

Thanks,

Karthik



AK Amit Kumar November 19, 2014 09:08 AM UTC

Hi Karthik,
Thanks for reply. Because of this issue, My client work is being impacted. So please let me know if is there any work around for this issue?

Thanks
Amit Kumar


KC Karthikeyan Chandrasekar Syncfusion Team November 20, 2014 12:21 PM UTC

Hi Amit,

We have logged this as an issue report in our database, the fix for this issue will be available in our upcoming Volume 4 release.

 

Regards,

Karthikeyan.C



PH Praveenkumar H Syncfusion Team November 21, 2014 05:42 AM UTC

Hi Amit,

A quick note on previous update, the font “Segoe UI” doesn’t support the Unicode characters, so text not visible in the generated pdf. You can see this same behavior in Microsoft word also, but Microsoft word uses the font fallback to display the Unicode characters properly, here fallback font is “MS Mincho”.

The below screen shots show the font fall back behavior of MS word.

Exported pdf using MS word

Currently we don’t have the support for font fallback when converting the doc to pdf, so we have considered this as a defect and will fix this internally.

We suggest to use “MS Micho” or “Arial Unicode MS” font to display the Unicode (Chinese) characters properly.

With Regards,

Praveen



AK Amit Kumar November 28, 2014 08:09 AM UTC

Thanks Praveen.


PH Praveenkumar H Syncfusion Team December 1, 2014 05:28 AM UTC

Hi Amit,

Thank you for using syncfusion products,

Please let us know if you need further assistance.

With Regards,
Praveen


AK Amit Kumar December 3, 2014 01:36 PM UTC

Hi Praveen,
I am just adding below text in the paragraph using the paragraph.AppendHtml. but chinese characters "内存" are not visible in the PDF.

"Client profile- 3203 word BRD Copy and pasted for testing 内存"

And i have applied the below style in the paragrabh.

 var pStyle = (IWParagraphStyle)WDoc.AddParagraphStyle("TableCellFont10ArialBold");
           pStyle.CharacterFormat.FontName = "Arial";
           pStyle.CharacterFormat.FontSize = 10;
           pStyle.CharacterFormat.Bold = true;
           pStyle.ParagraphFormat.LeftIndent = 4;

paragraph.ApplyStyle( pStyle.Name);     

Please let me know what i am doing wrong  with the code. And i am using verson 11.3040.0.30.

Thanks
Amit Kumar





PH Praveenkumar H Syncfusion Team December 5, 2014 08:16 AM UTC

Hi Amit,

Thank you for your update,

“Arial” font doesn’t support the Chinese characters, please use the “Arial Unicode MS” to preserve the text properly in pdf.

 var pStyle = (IWParagraphStyle)WDoc.AddParagraphStyle("TableCellFont10ArialBold");

           pStyle.CharacterFormat.FontName = "Arial Unicode MS";

           pStyle.CharacterFormat.FontSize = 10;

           pStyle.CharacterFormat.Bold = true;

           pStyle.ParagraphFormat.LeftIndent = 4;

           paragraph.ApplyStyle( pStyle.Name);     

 

Please try this and let us know the result.

 

With Regards,

Praveen



AK Amit Kumar December 8, 2014 11:40 AM UTC

Hi Praveen,
I have done the changes that you have suggested, But still i am facing the same issue.And it is not in my local machine. I am facing this on server only.

Thanks
Amit Kumar


PH Praveenkumar H Syncfusion Team December 9, 2014 05:30 AM UTC

Hi Amit,

Thank you for your update,

Can you please provide us your server environment details, also send us the full code snippet to reproduce this issue, it will help us to investigate further in this.

With Regards,

Praveen



NG Nishant Garg December 15, 2014 03:25 PM UTC

Hi Praveen,

As you asked for environment detail & code are following 

Server 2008 R@ for Web  and windows Server 2012 for SQL server. 

Code:

WordDocument wordDoc = new WordDocument();
IWSection section1 = wordDoc.AddSection();
paragraph = section.AddParagraph();
paragraph.AppendText("Client profile- 3203 word BRD Copy and pasted for testing 内存");
paragraph.ApplyStyle(wordStyles.TableCellFont10ArialBold.Name);

DocToPDFConverter converter = new DocToPDFConverter();
string fileName = + "QuoteSlip_" + UserContext.TenantName.ToString() + ".pdf";

//Convert word document into PDF document
PdfDocument pdfDoc = converter.ConvertToPDF(wordDoc);
                            
//Stream the output to the browser.
if (Request.Browser.Type.StartsWith("IE"))
       pdfDoc.Save(fileName, Response, HttpReadType.Save);
else
    pdfDoc.Save(fileName, Response, HttpReadType.Open);

Style file 
 var pStyle = (IWParagraphStyle)WDoc.AddParagraphStyle("TableCellFont10ArialBold");
 pStyle.CharacterFormat.FontName = "Arial Unicode MS";
 pStyle.CharacterFormat.FontSize = 10;
 pStyle.CharacterFormat.Bold = true;
 pStyle.ParagraphFormat.LeftIndent = 4;
 paragraph.ApplyStyle( pStyle.Name);     

Please also verify that does your code works after publish on server. 

we are not able to face our client because of this issue, so please get it resolved ASAP.

Thanks & Regards,
Nishant Garg


PH Praveenkumar H Syncfusion Team December 16, 2014 04:45 AM UTC

Hi Nishant,

Thank you for your update,

We have tested the sample and it is works fine in our side, we suspect that the issue occurs due to the font, please ensure the font “Arial Unicode MS” installed in your machine.

Please install the font and try the sample once again, if issue still persist please send us your output pdf document, it will help us to investigate further in this.

With Regards,

Praveen



NG Nishant Garg December 18, 2014 10:52 AM UTC

Thanks Praveen

We installed "Arial Unicode MS" font and restarted our server. After that It's working fine for us. 



Loader.
Up arrow icon