2

I'm very new in iText.
Now I want to display Khmer Unicode in iText, but I can't do it. Does any one know how to do it? Please advise me.

Regards, LeeJava

hippietrail
  • 15,848
  • 18
  • 99
  • 158
leejava
  • 339
  • 1
  • 3
  • 11

3 Answers3

1

According to you, the owner of the question in another post, iText is not support Khmer Unicode.

I made summarize on this again as well on my blog: http://ask.osify.com/qa/287

Only we have to modify the source code of iText but until now no one claim that they will work on it so iText is not the right choice for us with Khmer Unicode yet until the source modify.

Another alternative solution, we have to use Openoffice doc with JODConverter, for me, I'm still in experiment this one but with quick test, it's working fine.

We just have another issue with creating the openoffice doc that could put Khmer unicode rendering as stated shortly in http://ask.osify.com/qa/318

Updated 13/01/2016

Osify
  • 2,253
  • 25
  • 42
  • To add a bit of detail: to have Khmer support in iText, ideally you would need A) a developer who is familiar with the iText code and B) someone who knows the rules of the Khmer language. iText is Open Source, so anyone can contribute and is very welcome to do so. If you, or anyone else, is willing to contribute Khmer support and submit a pull request on our git repository (http://github.com/itext/itextpdf) then it will be very, very much appreciated and we'll be happy to aid you with the itty gritty details of iText development, as long as you do the actual coding. – Amedee Van Gasse Jan 13 '16 at 07:51
  • Khmer support will probably be more than the proverbial "3 lines of code", so you'd need to contact iText to sign a Contributor License Agreement before you submit a pull request. That's mostly a CYA formality, essentially saying that iText is allowed to use your code and that you are the author. – Amedee Van Gasse Jan 13 '16 at 07:56
  • I now see that you have linked to a iTextKhmer repository, and the code has the Apache 2.0 license. – Amedee Van Gasse Jan 13 '16 at 08:00
  • I have not declare yet any license but I think Apache 2.0 License is OK (I'm not clear enough on opensource license). Let me know which one is compatible. – Osify Jan 13 '16 at 08:12
  • I am sorry to correct you but in the documentation in the gh-pages branch I can clearly read Apache 2.0. Perhaps this is not intentional but that is the correct situation. EDIT: there is even a `LICENSE` file in the master branch. – Amedee Van Gasse Jan 13 '16 at 08:16
  • I removed it and let me know which one is compatible... there will be more improvement for our language – Osify Jan 13 '16 at 08:22
  • One of the iText developers (not me, I'm QA) is currently eyeballing your code. ;) – Amedee Van Gasse Jan 13 '16 at 08:50
  • 1
    Update: iText 7 version 7.0.4, with the pdfCalligraph add-on version 1.0.3, both to be released end of July 2017, will have Khmer support. This has been developed independently from the code posted in this answer. Khmer support will not be backported to iText 5. – Amedee Van Gasse Jul 14 '17 at 07:22
  • i try for dotnet core. it is disaplyiing . but the text is just like error in photoshop – Sras Oct 09 '20 at 07:13
  • @Sras, if have screenshot is easy to check your issue, at first, have you tried the font that work on Photoshop (if it's like)? Font family of "Kh OS" – Osify Oct 10 '20 at 06:05
0
Font font = new Font("khmer", Font.PLAIN ,33);
iText.setFont(font);
Lay Leangsros
  • 9,156
  • 7
  • 34
  • 39
0

if its anything like a normal font your gonna want something like

Font myfont= new Font(BaseFont.createFont("Font location", "encoding, "embedded"));   

most fonts are located under c:\windows\fonts

user979490
  • 260
  • 3
  • 11