Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.font.encoding

public Class DictionaryEncoding

extends Encoding
Class Inheritance
Imports
java.util.HashMap, .Map, org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSName, .COSNumber

This will perform the encoding from a dictionary.
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private final Encoding
private final Map<Integer, String>
private final COSDictionary
Inherited from org.apache.pdfbox.pdmodel.font.encoding.Encoding:
CHAR_CODECHAR_NAMEcodeToNameinverted

Constructor Summary

AccessConstructor and Description
public
DictionaryEncoding(COSName
the base encoding of this encoding
baseEncoding
,
COSArray
the differences of this encoding with regard to the base encoding
differences
)

Creates a new DictionaryEncoding for embedding.

public
DictionaryEncoding(COSDictionary
The Type 3 encoding dictionary.
fontEncoding
)

Creates a new DictionaryEncoding for a Type 3 font from a PDF.

public
DictionaryEncoding(COSDictionary
The encoding dictionary.
fontEncoding
,
boolean
True if the font is non-symbolic. False for Type 3 fonts.
isNonSymbolic
,
Encoding
The font's built-in encoding. Null for Type 3 fonts.
builtIn
)

Creates a new DictionaryEncoding from a PDF.

Method Summary

Modifier and TypeMethod and Description
private void
public Encoding

Returns:

the base encoding or null
getBaseEncoding
()

Returns the base encoding.

public COSBase
getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

public Map<Integer, String>

Returns:

a map containing all differences
getDifferences
()

Returns the Differences array.

public String
getEncodingName()

Implements abstract org.apache.pdfbox.pdmodel.font.encoding.Encoding.getEncodingName.

Returns the name of this encoding.

Inherited from org.apache.pdfbox.pdmodel.font.encoding.Encoding:
addcontainscontainsgetCodeToNameMapgetInstancegetNamegetNameToCodeMapoverwrite

Field Detail

baseEncodingback to summary
private final Encoding baseEncoding
differencesback to summary
private final Map<Integer, String> differences
encodingback to summary
private final COSDictionary encoding

Constructor Detail

DictionaryEncodingback to summary
public DictionaryEncoding(COSName baseEncoding, COSArray differences)

Creates a new DictionaryEncoding for embedding.

Parameters
baseEncoding:COSName

the base encoding of this encoding

differences:COSArray

the differences of this encoding with regard to the base encoding

DictionaryEncodingback to summary
public DictionaryEncoding(COSDictionary fontEncoding)

Creates a new DictionaryEncoding for a Type 3 font from a PDF.

Parameters
fontEncoding:COSDictionary

The Type 3 encoding dictionary.

DictionaryEncodingback to summary
public DictionaryEncoding(COSDictionary fontEncoding, boolean isNonSymbolic, Encoding builtIn)

Creates a new DictionaryEncoding from a PDF.

Parameters
fontEncoding:COSDictionary

The encoding dictionary.

isNonSymbolic:boolean

True if the font is non-symbolic. False for Type 3 fonts.

builtIn:Encoding

The font's built-in encoding. Null for Type 3 fonts.

Method Detail

applyDifferencesback to summary
private void applyDifferences()
getBaseEncodingback to summary
public Encoding getBaseEncoding()

Returns the base encoding. Will be null for Type 3 fonts.

Returns:Encoding

the base encoding or null

getCOSObjectback to summary
public COSBase getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Doc from org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSBase

The cos object that matches this Java object.

Annotations
@Override
getDifferencesback to summary
public Map<Integer, String> getDifferences()

Returns the Differences array.

Returns:Map<Integer, String>

a map containing all differences

getEncodingNameback to summary
public String getEncodingName()

Implements abstract org.apache.pdfbox.pdmodel.font.encoding.Encoding.getEncodingName.

Doc from org.apache.pdfbox.pdmodel.font.encoding.Encoding.getEncodingName.

Returns the name of this encoding.

Returns:String

the name of the encoding

Annotations
@Override