PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 7:53 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 24 posts ] 
Author Message
 Post subject: Arabic support
PostPosted: Mon Oct 20, 2008 2:38 pm 
Offline

Joined: Mon Oct 20, 2008 2:36 pm
Posts: 1
How can i write pdf in arabic language


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 30, 2008 12:14 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
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?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jan 23, 2009 6:13 pm 
Offline

Joined: Fri Jan 23, 2009 5:57 pm
Posts: 1
hi.

It's really urgently

I use only PDFsharp

I'm C# programmer

I'm ready if can help.


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Sep 01, 2009 1:03 pm 
Offline

Joined: Tue Sep 01, 2009 12:30 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Sep 01, 2009 1:26 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
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 ...

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Sep 01, 2009 2:25 pm 
Offline

Joined: Tue Sep 01, 2009 12:30 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Jan 19, 2010 8:22 am 
Offline

Joined: Tue Jan 19, 2010 8:16 am
Posts: 1
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Jan 19, 2010 9:29 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Apr 27, 2010 7:39 am 
Offline

Joined: Mon Apr 26, 2010 3:23 pm
Posts: 1
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Wed Apr 28, 2010 2:12 pm 
Offline

Joined: Wed Apr 28, 2010 1:44 pm
Posts: 1
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Mon Apr 11, 2011 5:35 pm 
Offline

Joined: Mon Apr 11, 2011 5:31 pm
Posts: 2
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Mon Apr 11, 2011 6:41 pm 
Offline

Joined: Mon Apr 11, 2011 5:31 pm
Posts: 2
Is there any work around in this area such as converting Japanese text into image and then display using pdfsharp ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Wed Jul 13, 2011 5:32 pm 
Offline

Joined: Wed Jul 13, 2011 5:29 pm
Posts: 2
Dear Support!

Is any update for Chinese language?

BRGDS
Grzegorz Pawluch


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Tue Nov 22, 2011 10:56 am 
Offline

Joined: Tue Nov 22, 2011 10:20 am
Posts: 1
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("编辑");


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Mon Apr 30, 2012 8:50 am 
Offline

Joined: Mon Apr 30, 2012 8:42 am
Posts: 1
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Thu Nov 27, 2014 4:09 pm 
Offline
Supporter

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 50
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("编辑");


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Fri Aug 26, 2016 3:38 pm 
Offline

Joined: Wed Aug 24, 2016 9:31 am
Posts: 8
I'm interested in Arabic support, too. I already got Chinese working with PDFsharp.


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sat Aug 27, 2016 11:05 am 
Offline

Joined: Wed Aug 24, 2016 9:31 am
Posts: 8
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sat Aug 27, 2016 12:13 pm 
Offline
Supporter

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 50
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sat Aug 27, 2016 12:28 pm 
Offline

Joined: Wed Aug 24, 2016 9:31 am
Posts: 8
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("编辑");


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sun Jul 02, 2017 2:50 pm 
Offline
Supporter

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 50
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 :(


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sun Jul 02, 2017 4:41 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 905
Location: CCAA
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.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sat Jul 08, 2017 7:55 pm 
Offline
Supporter

Joined: Sat Oct 18, 2008 4:15 pm
Posts: 50
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Arabic support
PostPosted: Sun Jul 09, 2017 9:14 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 905
Location: CCAA
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.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group