Am Donnerstag, den 20.05.2010, 13:06 +0300 schrieb Mikael Komu:
> Hi,
> 
> I had the same problem with ä and ö characters as I had to create pdf's from
> Finnish texts. I used the TextToPDF.createPDFFromText method so I'm not sure
> if the same solution works for you. I needed to change the encoding of the
> font to get it working. Here's an example:
> 
> String text = "opqrstuvwxyzåäö";
> org.apache.pdfbox.TextToPDF textToPdf = new org.apache.pdfbox.TextToPDF();
> EncodingManager encodingManager = new EncodingManager();
> textToPdf.getFont().setEncoding(encodingManager.getEncoding(COSName.WIN_ANSI_ENCODING));
> PDDocument doc = textToPdf.createPDFFromText(new StringReader(text));
> 
> Hope this helps.
> 

Hi,

it did, thank you. It works fine with latin-1 (i.e. U+0000 - U+00FF),
which is sufficient for me. Nevertheless a drawString which accepts more
than a subset of string (given the font can handle it) would be a nice
thing to have.

Regards
        Michael

Reply via email to