Package org.apache.fop.pdf
Class PDFEncoding
- java.lang.Object
-
- org.apache.fop.pdf.PDFObject
-
- org.apache.fop.pdf.PDFDictionary
-
- org.apache.fop.pdf.PDFEncoding
-
- All Implemented Interfaces:
PDFWritable
public class PDFEncoding extends PDFDictionary
Class representing an /Encoding object. A small object expressing the base encoding name and the differences from the base encoding. The three base encodings are given by their name. Encodings are specified in section 5.5.5 of the PDF 1.4 spec.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PDFEncoding.DifferencesBuilder
Builder class for constructing the Differences array.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAC_EXPERT_ENCODING
the name for the Mac Export encoding schemestatic java.lang.String
MAC_ROMAN_ENCODING
the name for the Mac Roman encoding schemestatic java.lang.String
PDF_DOC_ENCODING
the name for the PDF document encoding schemeprivate static java.util.Set
PREDEFINED_ENCODINGS
the set of predefined encodings that can be assumed present in a PDF viewerstatic java.lang.String
STANDARD_ENCODING
the name for the standard encoding schemestatic java.lang.String
WIN_ANSI_ENCODING
the name for the WinAnsi encoding scheme-
Fields inherited from class org.apache.fop.pdf.PDFDictionary
entries, order
-
-
Constructor Summary
Constructors Constructor Description PDFEncoding(java.lang.String basename)
Create a new /Encoding object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PDFEncoding.DifferencesBuilder
createDifferencesBuilder()
Creates and returns a new DifferencesBuilder instance for constructing the Differences array.(package private) static java.lang.Object
createPDFEncoding(SingleByteEncoding encoding, java.lang.String fontName)
Creates a PDFEncoding instance from a CodePointMapping instance.(package private) static boolean
hasStandardEncoding(java.lang.String encodingName)
Indicates whether the given encoding type is that of standard encodingstatic boolean
isPredefinedEncoding(java.lang.String name)
Indicates whether a given encoding is one of the predefined encodings.void
setDifferences(PDFArray differences)
Sets the Differences value.-
Methods inherited from class org.apache.fop.pdf.PDFDictionary
containsKey, get, getChildren, getChildren, keySet, output, put, put, remove, writeDictionary
-
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
-
-
-
Field Detail
-
STANDARD_ENCODING
public static final java.lang.String STANDARD_ENCODING
the name for the standard encoding scheme- See Also:
- Constant Field Values
-
MAC_ROMAN_ENCODING
public static final java.lang.String MAC_ROMAN_ENCODING
the name for the Mac Roman encoding scheme- See Also:
- Constant Field Values
-
MAC_EXPERT_ENCODING
public static final java.lang.String MAC_EXPERT_ENCODING
the name for the Mac Export encoding scheme- See Also:
- Constant Field Values
-
WIN_ANSI_ENCODING
public static final java.lang.String WIN_ANSI_ENCODING
the name for the WinAnsi encoding scheme- See Also:
- Constant Field Values
-
PDF_DOC_ENCODING
public static final java.lang.String PDF_DOC_ENCODING
the name for the PDF document encoding scheme- See Also:
- Constant Field Values
-
PREDEFINED_ENCODINGS
private static final java.util.Set PREDEFINED_ENCODINGS
the set of predefined encodings that can be assumed present in a PDF viewer
-
-
Method Detail
-
createPDFEncoding
static java.lang.Object createPDFEncoding(SingleByteEncoding encoding, java.lang.String fontName)
Creates a PDFEncoding instance from a CodePointMapping instance.- Parameters:
encoding
- the code point mapping (encoding)fontName
- ...- Returns:
- the PDF Encoding dictionary (or a String with the predefined encoding)
-
isPredefinedEncoding
public static boolean isPredefinedEncoding(java.lang.String name)
Indicates whether a given encoding is one of the predefined encodings.- Parameters:
name
- the encoding name (ex. "StandardEncoding")- Returns:
- true if it is a predefined encoding
-
hasStandardEncoding
static boolean hasStandardEncoding(java.lang.String encodingName)
Indicates whether the given encoding type is that of standard encoding- Parameters:
name
- The encoding name- Returns:
- Returns true if it is of type standard encoding
-
createDifferencesBuilder
public PDFEncoding.DifferencesBuilder createDifferencesBuilder()
Creates and returns a new DifferencesBuilder instance for constructing the Differences array.- Returns:
- the DifferencesBuilder
-
setDifferences
public void setDifferences(PDFArray differences)
Sets the Differences value.- Parameters:
differences
- the differences.
-
-