Unicode characters issue

Hi,
I have a problem when publishing table that contains non-standard character such as ćčšž etc. into a PDF document
using table.Publish(tableLocation, pdfDoc.LastPage)
(used from your example)

i get an exception:
Could not find width for this character. Unicode is not currenty supported by system fonts.

Thanks

8 Replies

MW Melba Winshia Syncfusion Team July 4, 2007 12:19 PM UTC

Hi Miran,

I created a sample to publish table that contains non-standard character such as ćčšž into a PDF document. But I was not able to reproduce the exception. Here is the test sample that I used to test this issue:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63455/main.htm

Could you please take a look at the sample above and let me know if you still find any problem while running the sample? If not could you please modify this sample so that I can reproduce the issue. It would help me in analyzing this issue further.

Thanks,
Melba



AD Administrator Syncfusion Team May 7, 2008 03:41 PM UTC

Hi,
we are facing the same issue.
I think this related to our Synchfusion version that currently is 3.301.0.0.
Unfortunately we cannot switch to latest one because it require MS .net framework 2.0. that is not supported by the release of our software were we face the issue.
Do you know if any of synchfusion version running on MS .net framework 1.1 support UTF8 characters?
Thanks
Paolo

>Hi Miran,

I created a sample to publish table that contains non-standard character such as ćčšž into a PDF document. But I was not able to reproduce the exception. Here is the test sample that I used to test this issue:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63455/main.htm

Could you please take a look at the sample above and let me know if you still find any problem while running the sample? If not could you please modify this sample so that I can reproduce the issue. It would help me in analyzing this issue further.

Thanks,
Melba





SyncfusionUTF8 error.zip


AD Administrator Syncfusion Team May 12, 2008 02:46 AM UTC

hello,everyone,
I am facing the same issue.I want to create a pdf and print a chinese string "你好",but it print "ÄãºÃ!" for me!
who can tell me how to do with the issue?

any help will be appreciate.


Jerry




YG Yavanaarasi G Syncfusion Team May 12, 2008 11:04 AM UTC

Hi Paolo,

I regret to let you know that we have stopped providing support for .Net framework version 1.1. We provide support only for version 2005 and 2008 . So please upgrade to .Net framework version 2.0 or higher version. I had run the sample link that was updated previously with version 3.3 with .Net framework 2.0. Here it works fine.

Please upgrade and try the above sample link and let me know if the issue still exists.

Regards,
G.Yavana



YG Yavanaarasi G Syncfusion Team May 12, 2008 11:05 AM UTC

Hi Jerry,

If you want to print the chinese strings you have to include the below code snippet and run the above sample. The chinese string is printed correctly.


[C#]
Font arabicFont = new Font("Times New Roman", 10);
IPDFFont chinesefont = pdfDoc.Fonts.Add(CJKFontFace.HanyangSystemsShinMyeongJoMedium);


Please try this and let me know if this helps.

Regards,
G.Yavana










AD Administrator Syncfusion Team May 13, 2008 03:39 AM UTC

G.Yavana,thanks for your help.I do what you tell me and find that PdfDocument class has not a property named Fonts,my code such as:

//Create a new document.
PdfDocument doc = new PdfDocument();

//Add a page
PdfPage page = doc.Pages.Add();

//Create Pdf graphics for the page
PdfGraphics g = page.Graphics;

//Create a solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);

float fontSize = 20f;

//Set the font
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Font arabicFont = new Font("Times New Roman", 10);
//IPDFFont pdfNewFont = doc.Fonts.Add(CJKFontFace.HanyangSystemsShinMyeongJoMedium);
//Draw the text
g.DrawString("你好!", font, brush,new PointF(20,20));

doc.Save("Sample.pdf");



AD Administrator Syncfusion Team May 13, 2008 07:18 AM UTC

Hi G.Yavana

I have find out how to use the Fonts property,but there is one thing that I cannot understand:how to use the PDFDocument class and the PdfDocument class?I cannot find any helpful messages about them.

Any help will be appreciated.


Jerry



YG Yavanaarasi G Syncfusion Team May 13, 2008 07:42 AM UTC

Hi Jerry,

We have implemented our new PDF in version 5.2. In our new PDf the API's are different. The code that I send in the previous update was in the legacy version. You can create the cjkfont in our new pdf by using the below code snippet:

//Set the font

PdfCjkStandardFont font1 = new PdfCjkStandardFont( PdfCjkFontFamily.SinoTypeSongLight ,20f);

//ChineseTraditionalFont
PdfCjkStandardFont font2 = new PdfCjkStandardFont(PdfCjkFontFamily.MonotypeHeiMedium, 20.5f);

g.DrawString("你好!", font1, brush,new PointF(20,20));


Please refer the below link for more details about Unicode Support:

http://64.78.15.37:89/products/pdf/windows/codesamples/viewsource.aspx?&zip_path=1417_Unicode_support_src.zip&lang=csharp&id=1417


Please refer the documentation link for how to use the PdfDocument class:
http://www2.syncfusion.com/ug_62/pdf/default.html

Please try this and let me know if this helps.

Regards,
G.Yavana


Loader.
Up arrow icon