Hello Paolo, thank You for Your fast answer. Can You give me another tip or workaround for my problem? In my solution I first create a PDF form from XML with some text fields. In the second step I fill the form with the personal data like names, addresses etc. So far it works, but now I've got a request from an arabic costumer. Because I need Unicode, I can't simply fill the text fields and have to place the text directly using ColumnText. But at this point I don't have the information, wich font and size was defined for the fields in the XML and to obtain it directly from the pdf. Would it be possible to solve the problem using non unicode fonts with the appropriate arabic code pages (CP1256)?
Any hints are welcome. Regarding, Sven Hansen. Paulo Soares schrieb: > If it was that easy it would already have been implemented. For that to work > DocumentFont would have to process the ToUnicode table which it doesn't. > > >>-----Original Message----- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On >>Behalf Of Sven Hansen >>Sent: Wednesday, August 31, 2005 6:46 PM >>To: [email protected] >>Subject: [iText-questions] Reusing the Font from a Textfield >> >>Hello, >> >>I need to fill a TextField with Unicode characters. Because >>this is not >>implemented, I would like to make a workaround. The original code: >> >>private void setText(PdfStamper stamp, String fieldName, >>String text) throws >>IOException, DocumentException >>{ >> AcroFields form = stamp.getAcroFields(); >> >> form.setField(fieldName, filter(text)); >>} >> >>The replacement should look like: >> >>private void setText(PdfStamper stamp, String fieldName, >>String text) throws >>IOException, DocumentException >>{ >> AcroFields form = stamp.getAcroFields(); >> float[] position = >>form.getFieldPositions(fieldName); >> float page = position[0], >> left = position[1], >> bottom = position[2]; >> PdfContentByte cb = stamp.getOverContent((int)page); >> BaseFont baseFont = ...; >> float fontSize = ...; >> Font font = new Font(baseFont, fontSize); >> Phrase ph = new Phrase(filter(text), font); >> >> ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, ph, x, y, 0, >>PdfWriter.RUN_DIRECTION_LTR, 0); >>} >> >>My Problem is: How can I obtain the fontSize and get the >>correct reference >>to make a call to BaseFont.createFont(iRef)? >> >>Any Help is welcome. >> >>Thanks, Sven Hansen. >> >>-- >>5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail >>+++ GMX - die erste Adresse für Mail, Message, More +++ >> >> >>------------------------------------------------------- >>SF.Net email is Sponsored by the Better Software Conference & EXPO >>September 19-22, 2005 * San Francisco, CA * Development >>Lifecycle Practices >>Agile & Plan-Driven Development * Managing Projects & Teams * >>Testing & QA >>Security * Process Improvement & Measurement * >>http://www.sqe.com/bsce5sf >>_______________________________________________ >>iText-questions mailing list >>[email protected] >>https://lists.sourceforge.net/lists/listinfo/itext-questions >> > > > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
