Do u confirm the behavior I described comparing the pdf file produced by acrobat and the one produced by itext? I thought it was an easy thing cuz the Arabic text shows perfect when I click on the field. Thought it was a refresh problem or something similar. For my project the deadline is 3/28/2005 but even if it was not ready by that time (or at all :)) I am willing to help in beta testing if needed for Arabic support in fields. Do you suggest an alternative solution (even commercial) or a different approach to my problem?
-----Original Message----- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 4:22 PM To: Ayman Yasin; [email protected] Subject: RE: [iText-questions] Filling pdf form fields with arabic? I had a look into it and it's too much work to support it, at least for now. Just to give you an idea of what is needed: - create an Identity-H font with all the characters for a particular script embedded - read an Identity-H font, extract the toUnicode cmap and use it - create a field with the Arabic shaping rules - create a new form field interface to support the Arabic option. Best Regards, Paulo Soares > -----Original Message----- > From: Ayman Yasin [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 15, 2005 11:41 AM > To: Paulo Soares; [email protected] > Subject: RE: [iText-questions] Filling pdf form fields with arabic? > > Thanx for the response, > I attached a simple PDF with 1 text field filled in Arabic > text in acrobat 6 ME pro (trial available for download) > I also attached the servlet source file which tries to fill > the field with Arabic text using itext. > The result so far is that no text at all shows after filling > with itext unless I click with the mouse on the text field > (must be editable) then it shows correctly. > I used for this text field the font: WinSoft Pro Medium and > the subset All Scripts. > This font comes with acrobat me and should be embedded always > as I understand. I tried also with Arial and subset Arabic. > I also uploaded the help file for the ME edition specific > features on this location: > http://www.arabcc.net/theunforgiven/randomfiles/ME%20Specific% 20Features.pdf I hope it will help. -----Original Message----- From: Paulo Soares [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 12:56 PM To: Ayman Yasin; [email protected] Subject: RE: [iText-questions] Filling pdf form fields with arabic? I've no idea how Arabic should work in form fields. Send me a pdf filled in Acrobat for inspection. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Ayman Yasin > Sent: Tuesday, February 15, 2005 7:49 AM > To: [email protected] > Subject: [iText-questions] Filling pdf form fields with arabic? > > I am trying to fill a form field in an existing pdf file with > Arabic text from a java servlet using iText. > > English works great but for Arabic the field shows garbage. > > I tried to play with the text field properties using adobe > acrobat Middle Eastern edition. I changed the font to Arial > and the subset into Arabic. > > Filling fields with Arabic from inside adobe acrobat works > but from the servlet it still shows garbage until I click on > the field for edit then it shows fine. > > If I click away from the field it converts into garbage > again. If form flattening is set to true (which I want to do) > it shows unmodified garbage. > > Here is the code from the servlet doGet method: > > > > > > OutputStream out = response.getOutputStream(); > > ByteArrayOutputStream baos = new ByteArrayOutputStream(); > > try { > > PdfReader reader = new PdfReader("c:\\visa2.pdf"); > > PdfStamper stamp = new PdfStamper(reader, baos ); > > > > > > AcroFields form = stamp.getAcroFields(); > > > > form.setField("Text1", "أيمن" ); //Arabic text > in the second parameter > > > > //stamp.setFormFlattening(true); > //commented out to show the weird behavior with edit if not > commented shows unmodified garbage > > stamp.close(); > > response.setContentLength(baos.size()); > > baos.writeTo( out ); > > baos.flush(); > > baos.close(); > > out.flush(); > > out.close(); > > } > > catch(Exception e){System.out.println(e.getMessage());} > > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
