You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by spud <sp...@gmail.com> on 2010/03/22 16:56:46 UTC

Retrieve PDF Encoding

Does PDFBox allow one to extract the encoding used for the PDF, for
example Unicode or ASCII?

Re: Retrieve PDF Encoding

Posted by Mikael Komu <mi...@gmail.com>.
I'm not sure if this is what you meant, but PDFont has getter and setter for
Encoding. I used like this:

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));

  -Mikael


On Mon, Mar 22, 2010 at 5:56 PM, spud <sp...@gmail.com> wrote:

> Does PDFBox allow one to extract the encoding used for the PDF, for
> example Unicode or ASCII?
>