This is an example of Acrobat not following their own specifications. Your 
embedded font uses what is called "StandardEncoding" and in this encoding the 
char "ü" is not defined. Acrobat doesn't care and puts the char anyway probably 
checking the actual embedded font.The simplest way to fix this:

PdfReader pdf = new PdfReader("C:\\VorlageOnline.pdf");
PdfStamper stp = new PdfStamper(pdf, new FileOutputStream("c:\\out.pdf"));
AcroFields af = stp.getAcroFields();
BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\l_10646.ttf", 
BaseFont.IDENTITY_H, true);
af.addSubstitutionFont(bf);
af.setField("field1","This is a Test Müller");
stp.close();

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 29, 2006 4:07 PM
> To: Paulo Soares
> Cc: [email protected]
> Subject: RE: [iText-questions] Using Unicode Fields with Unicode Fonts
> 
> Hi Paulo,
> 
> the code :
> 
> PdfReader reader = new
> PdfReader(session.getSession().getServletContext().getResource
> AsStream("VorlageOnline.pdf"));
> PdfStamper stamp = new PdfStamper(reader,pdfStream);
> form.setField("field1","This is a Test Müller");
> stamp.close();
> 
> The pdf template and the resulting pdf are attached.
> 
> Thank for your help.
> 
> Volker
> 
> Am Mittwoch, den 29.03.2006, 15:36 +0100 schrieb Paulo Soares:
> > Post the PDF and the code and text you are using to fill the field.
> > 
> > Paulo 
> > 
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] 
> > > [mailto:[EMAIL PROTECTED] On 
> > > Behalf Of Volker Jordan
> > > Sent: Wednesday, March 29, 2006 1:35 PM
> > > To: [email protected]
> > > Subject: [iText-questions] Using Unicode Fields with Unicode Fonts
> > > 
> > > Hi,
> > > as I read in the revision history, itext1.4 is capable of 
> > > using unicode
> > > fields. This works for me, only if I use a non unicode fonts. 
> > > If I fill
> > > a field predefined with a unicode font with the 
> setField() method the
> > > german umlaute disapear.
> > > Is there a solution ?
> > > Regards
> > > Volker Jordan
> > > 
> > > 
> > > 
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by xPML, a groundbreaking 
> > > scripting language
> > > that extends applications into web and mobile media. Attend 
> > > the live webcast
> > > and join the prime developer group breaking into this new 
> > > coding territory!
> > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&;
> > > dat=121642
> > > _______________________________________________
> > > iText-questions mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/itext-questions
> > > 
> 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to