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();
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
"ü".
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
------------------------------------------------------------------------- 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
