Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Writing Arabic text to a PDF file

Thread view: 
Swetha - 02 Jan 2006 11:48 GMT
Hello everyone

I have a Java application that writes to a PDF file using the gnujpdf
API. When I write English text to the PDF file it works fine.

The problem I encounter is when I try writing Arabic text to the file.
They end up as ???? (question marks). The Arabic strings to be written
to the pdf are present in Properties files in Unicode form.

When I display these Arabic strings on the screen using the Graphics
object, they appear perfectly fine. But the same Graphics object when
passed to the API's dispose method, ends up showing me only question
marks.

Does anyone have any ideas on how to work around this problem or solve
it? Has anyone tried writing Arabic text to PDF using gnujpdf before?

Thanks
Swetha
Richard Wheeldon - 04 Jan 2006 21:24 GMT
> The problem I encounter is when I try writing Arabic text to the file.
> They end up as ???? (question marks). The Arabic strings to be written
> to the pdf are present in Properties files in Unicode form.

Check which font the PDF is using. Not all fonts support Arabic
characters. Does it work with any other non-english characters?
Can you read any arabic PDFs?

If you don't have lots of text to write in different languages,
try taking a look here:
    http://www.columbia.edu/kermit/utf8.html

Richard
Swetha - 07 Jan 2006 09:32 GMT
Richard,

I do have lots of text to be written in Arabic. And yes, I am able to
read other Arabic PDFs.

I think the problem is with writing Arabic in Unicode form to the PDF.

Do you have any idea how this can be solved?

Swetha
Richard Wheeldon - 08 Jan 2006 18:12 GMT
> Richard,
>
[quoted text clipped - 4 lines]
>
> Do you have any idea how this can be solved?

I'm not sure. Check that everything is using the same unicode
format where appropriate. e.g. All expecting utf8. Take a look
at some of the other PDF processors. e.g. FOP or iText. Even if
you don't intend using them, getting a simple example working
might point you in the right direction,

Richard
Swetha - 10 Jan 2006 08:39 GMT
Thanks Richard, I tried i-Text and it seems to work relatively more
predictably, so I've decided to go with i-Text.

Swetha
rwatki44@gmail.com - 12 Jan 2006 16:31 GMT
> Thanks Richard, I tried i-Text and it seems to work relatively more
> predictably, so I've decided to go with i-Text.
>
> Swetha

Swetha, I see that you have decided to go with iText.  But, if you are
ever looking for a product with great Unicode character support, I work
for a company, ceTe Software, that has a DynamicPDF Merger/Generator
for Java product.

If you would like to see what our product can do feel free to download
our free evaluation version from our site,
http://www.cete.com/Products/MergerForJava/Download.csp.

Robbie
rwatki44@gmail.com - 12 Jan 2006 17:48 GMT
> Thanks Richard, I tried i-Text and it seems to work relatively more
> predictably, so I've decided to go with i-Text.
>
> Swetha

Swetha, I see that you have decided to go with iText.  But, if you are
ever looking for a product with great Unicode character support, I work
for a company, ceTe Software, that has a DynamicPDF Merger/Generator
for Java product.

If you would like to see what our product can do feel free to download
our free evaluation version from our site,
http://www.cete.com/Products/MergerForJava/Download.csp.

Robbie
Swetha - 07 Jan 2006 12:38 GMT
Richard wrote:

> Can you read any arabic PDFs?

I can read Arabic PDFs. I think the issue is with writing to the PDF.
Do I need to embed the fonts I need?

And well, I have quite a lot of Arabic and other language text to be
written to the PDF.

Swetha
Roedy Green - 07 Jan 2006 20:08 GMT
>I can read Arabic PDFs. I think the issue is with writing to the PDF.
>Do I need to embed the fonts I need?

The idea of PDF is if you don't embed fonts, then the reader will make
do with whatever fonts the client has.  If you are sure he has
suitable fonts, you can leave them out.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Swetha - 08 Jan 2006 13:29 GMT
I'm using "Simplified Arabic" to generate the PDF and the font is
present on my system. However, I can still not read the generated PDF.

Later, I used Adobe Distiller to create a new default PDF setting that
embeds another Unicode Arabic font(Lateef) that I downloaded. I used
this font to create the PDF from my Java app. As before, the graphics
displayed on the screen shows up fine but when the same object is sent
to the PDF for writing, it ends up as question marks.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.