PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Arabic support
https://forum.pdfsharp.net/viewtopic.php?f=4&t=508
Page 1 of 1

Author:  atefkabani [ Mon Oct 20, 2008 2:38 pm ]
Post subject:  Arabic support

How can i write pdf in arabic language

Author:  Thomas Hoevel [ Thu Oct 30, 2008 12:14 pm ]
Post subject: 

PDFsharp Unicode sample wrote:
The current implementation of PDFsharp is limited to left-to-right languages.
Languages like Arabic cannot yet be created even with Unicode fonts. Also the so called CJK (Chinese, Japanese, Korean) support in PDF can also not be addressed with PDF sharp.
However, we plan to support as much as possible languages with PDFsharp. If you are a programmer and a native speaker of one of these languages and you like to create PDF
documents in your language, you can help us to implement it in PDFsharp. You don't have to do the programming, but just help us to verify our implementation.

There's some work left to be done.
How urgently do you need it?

Author:  iman [ Fri Jan 23, 2009 6:13 pm ]
Post subject: 

hi.

It's really urgently

I use only PDFsharp

I'm C# programmer

I'm ready if can help.

Author:  Arno Piening [ Tue Sep 01, 2009 1:03 pm ]
Post subject:  Re: Arabic support

Hello
I'm currently also working on a program that prints reports using PDFsharp.
PDFsharp works great, but my program should also be able to work with Arabic and Chinese languages.
Does implementing the support for these languages have some kind of priority at the moment?
Or do you have it planned for a certain version of PDFsharp?

Out of curiosity, does this problem still exist, and what is the problem with rendering these characters?
<quote>Languages like Arabic cannot yet be created even with Unicode fonts.</quote>

Regards
Arno Piening

Author:  Thomas Hoevel [ Tue Sep 01, 2009 1:26 pm ]
Post subject:  Re: Arabic support

Hi, Arno!
Arno Piening wrote:
Out of curiosity, does this problem still exist, and what is the problem with rendering these characters?
<quote>Languages like Arabic cannot yet be created even with Unicode fonts.</quote>

The shape of a character depends on its neighbours. This is not yet implemented.
And RTL (Right-to-Left) support is not yet implemented either.

And also part of the problem: we can't read neither Arabic nor Chinese.
We need someone who can and who will tell us what's wrong and what's right.

It's not on the list for the next release:
http://www.pdfsharp.net/wiki/RoadMap.ashx
But OTOH this list is dynamic ...

Author:  Arno Piening [ Tue Sep 01, 2009 2:25 pm ]
Post subject:  Re: Arabic support

Wow, that’s a fast reply.

Quote:
And also part of the problem: we can't read neither Arabic nor Chinese.
We need someone who can and who will tell us what's wrong and what's right.

I can see how that would be a problem :)
Unfortunately i’m not able to read them either. I'll keep an eye on the development to see how things are going.
Again thanks for the reply and the great library.

Regards,
Arno Piening

Author:  Reed [ Tue Jan 19, 2010 8:22 am ]
Post subject:  Re: Arabic support

I am trying to do something.
currently it can accept Tahoma. but in the output the Chinese character can't be displayed.
I think the cause is the font glyph is not embeded in? is it?

Author:  Thomas Hoevel [ Tue Jan 19, 2010 9:29 am ]
Post subject:  Re: Arabic support

Reed wrote:
I think the cause is the font glyph is not embeded in? is it?

The Tahoma font that comes with Windows XP has no Chinese characters.

Author:  myounes [ Tue Apr 27, 2010 7:39 am ]
Post subject:  Re: Arabic support

Hi,

I do speak arabic and willing to participate in supporting it in PDFSharp :D

Thomas Hoevel wrote:
The shape of a character depends on its neighbours. This is not yet implemented.
And RTL (Right-to-Left) support is not yet implemented either.

And also part of the problem: we can't read neither Arabic nor Chinese.
We need someone who can and who will tell us what's wrong and what's right.

Author:  tiglos [ Wed Apr 28, 2010 2:12 pm ]
Post subject:  Re: Arabic support

Thomas Hoevel wrote:
Hi, Arno!
Arno Piening wrote:
Out of curiosity, does this problem still exist, and what is the problem with rendering these characters?
<quote>Languages like Arabic cannot yet be created even with Unicode fonts.</quote>

The shape of a character depends on its neighbours. This is not yet implemented.
And RTL (Right-to-Left) support is not yet implemented either.

And also part of the problem: we can't read neither Arabic nor Chinese.
We need someone who can and who will tell us what's wrong and what's right.

It's not on the list for the next release:
http://www.pdfsharp.net/wiki/RoadMap.ashx
But OTOH this list is dynamic ...


Hi, Hoevel!
I can help to test Chinese support as I am a native Chinese speaker.
I've read your Unicode example, if pdfsharp can read Unicode , then it seams not so hard to support Chinese characters. For a left-to-right layout, the sequence of Chinese characters and that of Latin characters are same. For a right-to-left layout, there are some differences. So for Chinese or generally CJK support, the left-to-right could be implemented just like Latin languages.
And there is an iTextSharp project which has good CJK support, may borrow something from it.

Author:  sontle [ Mon Apr 11, 2011 5:35 pm ]
Post subject:  Re: Arabic support

Any update on the languages such as Chinese, Korean, Japanese supports ? I am using PDFSharp to replace our existing reports but having issues with Japanese charaters.

Author:  sontle [ Mon Apr 11, 2011 6:41 pm ]
Post subject:  Re: Arabic support

Is there any work around in this area such as converting Japanese text into image and then display using pdfsharp ?

Author:  Grzegorz Pawluch [ Wed Jul 13, 2011 5:32 pm ]
Post subject:  Re: Arabic support

Dear Support!

Is any update for Chinese language?

BRGDS
Grzegorz Pawluch

Author:  Mikael [ Tue Nov 22, 2011 10:56 am ]
Post subject:  Re: Arabic support

I've been trying to get chinese glyphs into a pdf trough pdfSharp, WITH SUCCESS!
It semes like this is a matter of selecting the right font. The "Arial Unicode MS" is a font with 50.377 glyphs, and includes what I understand most languages.

What I think is missing is pdfSharp is some fallback method for when glyphs are not represented in the selected font. It sems like wordpad and other editors uses this is some way...

Test this:
Code:
      Document document = new Document();
      Section section = document.AddSection();
      Paragraph paragraph = section.AddParagraph();
      document.Styles[StyleNames.Normal].Font.Name = "Arial Unicode MS";
      paragraph.AddFormattedText("This should be \"edit\" in chinese: ");
      paragraph.AddFormattedText("编辑");

Author:  mkn [ Mon Apr 30, 2012 8:50 am ]
Post subject:  Re: Arabic support

Hello,

the only problem I see is that PDFSharp does no line wrap when the end of the (visible) line is reached and there is no spacing character like blank or tab. As in Japanese no spaces are used the full text cannot be read. All is printed in one line. This is also a problem if e.g. a hyperlink text is very long so this is not a real "Japanese" problem.

Can I tell PDFSharp to do a hard wrap when there is no space for a long "word" after the last visible character?

Thanks for any suggests in advance,
Michael

Author:  gastan [ Thu Nov 27, 2014 4:09 pm ]
Post subject:  Re: Arabic support

Your sample works for me in separate console application. But for some reason I cannot make it work in my web application (asp.net2) using same routines.
Does anybody have any clue what could be the problem?



Mikael wrote:
I've been trying to get chinese glyphs into a pdf trough pdfSharp, WITH SUCCESS!
It semes like this is a matter of selecting the right font. The "Arial Unicode MS" is a font with 50.377 glyphs, and includes what I understand most languages.

What I think is missing is pdfSharp is some fallback method for when glyphs are not represented in the selected font. It sems like wordpad and other editors uses this is some way...

Test this:
Code:
      Document document = new Document();
      Section section = document.AddSection();
      Paragraph paragraph = section.AddParagraph();
      document.Styles[StyleNames.Normal].Font.Name = "Arial Unicode MS";
      paragraph.AddFormattedText("This should be \"edit\" in chinese: ");
      paragraph.AddFormattedText("编辑");

Author:  dennisr35 [ Fri Aug 26, 2016 3:38 pm ]
Post subject:  Re: Arabic support

I'm interested in Arabic support, too. I already got Chinese working with PDFsharp.

Author:  dennisr35 [ Sat Aug 27, 2016 11:05 am ]
Post subject:  Re: Arabic support

I found out, it is necessary to run the BIDI algorithm on the Arabic string. I think this needs to be done by PDFsharp. But still characters are not joined correctly.

Author:  gastan [ Sat Aug 27, 2016 12:13 pm ]
Post subject:  Re: Arabic support

Arabic worked for me. if u have webapp, u need to set RTL attribude for the page...
and for PDF... I think it works (I cant read it), no idea, but there were no complains

Author:  dennisr35 [ Sat Aug 27, 2016 12:28 pm ]
Post subject:  Re: Arabic support

This code doesn't look like code for PDFsharp.

Mikael wrote:
Test this:
Code:
      Document document = new Document();
      Section section = document.AddSection();
      Paragraph paragraph = section.AddParagraph();
      document.Styles[StyleNames.Normal].Font.Name = "Arial Unicode MS";
      paragraph.AddFormattedText("This should be \"edit\" in chinese: ");
      paragraph.AddFormattedText("编辑");

Author:  gastan [ Sun Jul 02, 2017 2:50 pm ]
Post subject:  Re: Arabic support

Any way to do line wrapping in Chinese?
In Chinese or Japanese the text is one long line. I would need it to break at the end of page to the next line :(

Author:  TH-Soft [ Sun Jul 02, 2017 4:41 pm ]
Post subject:  Re: Arabic support

Hi!
gastan wrote:
Any way to do line wrapping in Chinese?
With PDFsharp your code is responsible for linebreaks (or columnbreaks).
You probably have to call MeasureString for each single glyph to get width and height and then draw the characters in one column until you reach the margin for a columnbreak.

Author:  gastan [ Sat Jul 08, 2017 7:55 pm ]
Post subject:  Re: Arabic support

I see. Well, regular text (english) breaks fine. So there obviously is something done.
Do you have some pointers or sample code for how to do custom line breaks?

thx

Author:  TH-Soft [ Sun Jul 09, 2017 9:14 am ]
Post subject:  Re: Arabic support

gastan wrote:
Do you have some pointers or sample code for how to do custom line breaks?
PDFsharp includes the XTextFormatter class that is a sample for linebreaks.

With Latin characters you have words and linebreaks occur between words - there is a list of characters that allow breaks like blank, hyphen, comma, maybe dot also.
I have no idea where linebreaks in Japanese or Chinese will occur.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/