org.pdfbox.encoding
Class Encoding

java.lang.Object
  extended byorg.pdfbox.encoding.Encoding
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
AFMEncoding, DictionaryEncoding, MacRomanEncoding, PdfDocEncoding, StandardEncoding, WinAnsiEncoding

public abstract class Encoding
extends Object
implements COSObjectable

This is an interface to a text encoder.

Version:
$Revision: 1.13 $
Author:
Ben Litchfield

Constructor Summary
Encoding()
           
 
Method Summary
static String getCharacter(COSName name)
          This will get the character from the name.
 String getCharacter(int code)
          This will get the character from the code.
 int getCode(COSName name)
          This will get the character code for the name.
 COSName getName(int code)
          This will take a character code and get the name from the code.
 COSName getNameFromCharacter(char c)
          This will take a character code and get the name from the code.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pdfbox.pdmodel.common.COSObjectable
getCOSObject
 

Constructor Detail

Encoding

public Encoding()
Method Detail

getCode

public int getCode(COSName name)
            throws IOException
This will get the character code for the name.

Parameters:
name - The name of the character.
Returns:
The code for the character.
Throws:
IOException - If there is no character code for the name.

getName

public COSName getName(int code)
                throws IOException
This will take a character code and get the name from the code.

Parameters:
code - The character code.
Returns:
The name of the character.
Throws:
IOException - If there is no name for the code.

getNameFromCharacter

public COSName getNameFromCharacter(char c)
                             throws IOException
This will take a character code and get the name from the code.

Parameters:
c - The character.
Returns:
The name of the character.
Throws:
IOException - If there is no name for the character.

getCharacter

public String getCharacter(int code)
                    throws IOException
This will get the character from the code.

Parameters:
code - The character code.
Returns:
The printable character for the code.
Throws:
IOException - If there is not name for the character.

getCharacter

public static String getCharacter(COSName name)
This will get the character from the name.

Parameters:
name - The name of the character.
Returns:
The printable character for the code.


Copyright null EGIZ - E-Government Innovation Center. All Rights Reserved.