public class PDFText extends PDFObject
DATE_FORMAT, log
Constructor and Description |
---|
PDFText() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
escapeByteArray(byte[] data)
Escape a byte array for output to PDF (Used for encrypted strings)
|
static java.lang.String |
escapeString(java.lang.String s)
Escaped a String as described in section 4.4 in the PDF 1.3 specs.
|
static void |
escapeStringChar(char c,
java.lang.StringBuffer target)
Escapes a character conforming to the rules established in the PostScript
Language Reference (Search for "Literal Text Strings").
|
static java.lang.String |
escapeText(java.lang.String text)
Escape text (see 4.4.1 in PDF 1.3 specs)
|
static java.lang.String |
escapeText(java.lang.String text,
boolean forceHexMode)
Escape text (see 4.4.1 in PDF 1.3 specs)
|
java.lang.String |
getText()
Returns the text.
|
void |
setText(java.lang.String text)
Sets the text.
|
static java.lang.String |
toHex(byte[] data)
Converts a byte array to a Hexadecimal String (3.2.3 in PDF 1.4 specs)
|
static java.lang.String |
toHex(byte[] data,
boolean brackets)
Converts a byte array to a Hexadecimal String (3.2.3 in PDF 1.4 specs)
|
protected java.lang.String |
toPDFString()
This method returns a String representation of the PDF object.
|
static java.lang.String |
toUnicodeHex(char c)
Convert a char to a multibyte hex representation
|
static byte[] |
toUTF16(java.lang.String text)
Converts a String to UTF-16 (big endian).
|
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF
public java.lang.String getText()
public void setText(java.lang.String text)
text
- the textprotected java.lang.String toPDFString()
toPDFString
in class PDFObject
public static final java.lang.String escapeText(java.lang.String text)
text
- the text to encodepublic static final java.lang.String escapeText(java.lang.String text, boolean forceHexMode)
text
- the text to encodeforceHexMode
- true if the output should follow the hex encoding rulespublic static final java.lang.String toHex(byte[] data, boolean brackets)
data
- the data to encodebrackets
- true if enclosing brackets should be includedpublic static final java.lang.String toHex(byte[] data)
data
- the data to encodepublic static final byte[] toUTF16(java.lang.String text)
text
- text to convertpublic static final java.lang.String toUnicodeHex(char c)
c
- character to encodepublic static final java.lang.String escapeString(java.lang.String s)
s
- String to escapepublic static final void escapeStringChar(char c, java.lang.StringBuffer target)
c
- character to escapetarget
- target StringBuffer to write the escaped character topublic static final byte[] escapeByteArray(byte[] data)
data
- data to encodeCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.