> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Frank Fischer > Sent: Tuesday, October 10, 2006 11:10 AM > To: [email protected] > Subject: [iText-questions] problem choosing charset in pdf > > Hi list > > i have a problem with charsets. It's the first time ever i > have to deal with charsets, so my basic knowledge of how > charsets are working is a little bit small. So i would be > very thankfull for a little advice. > > I have created a pdf and that works fine so far. Now in the > pdf i have to use a (swiss) german charset since i have to > print names and addresses containing special chars like "ä" > or "é". So i set the charset to Cp1252 (Latin1): > > > PdfContentByte cb = writer.getDirectContent(); > cb.beginText(); > BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, > BaseFont.CP1252, BaseFont.EMBEDDED); > cb.setFontAndSize(bf, 10); > int abstand_adressat = 65; > cb.showTextAligned(PdfContentByte.ALIGN_LEFT, company, > getHorizontalPosition(linkerRand), > getVerticalPosition(abstand_adressat), 0); > cb.endText(); > > Unfortunally the output is not as expected. I.e. instead of > "ü" i get "ü". >
Looks like you're saving the source as UTF-8 and compiling as Cp1252. Paulo > The java app runs on a Windows 2000 Server ENGLISH, but the > swiss german charset is loaded and activated (meaning when > creating a new text document i can type "ä" and so on). > Another thing i experienced, is, that instead of HELVETICA, > which obv. is not installed in the system, windows uses ARIAL > to display the text in the pdf (at least it states so in the > pdf properties). But, when change to Times Roman in the java > app, the effect remains the same, so i think it has nothing > to do with the font substitution. > > Does anyone has an idea what the problem could be? > > > Thanks a lot for your help, > > Frank > Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
