Text strings are used for character strings that contain information intended to be human-readable, such as text annotations, bookmark names, article names, document information, and so forth.
PDFDocEncoded strings are used for characters that are represented in a single byte.
ASCII strings are used for characters that are represented in a single byte using ASCII encoding.
Byte strings are used for binary data represented as a series of bytes, but the encoding is not known. The bytes of the string need not represent characters.
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| public static final boolean | |
| private boolean | |
| private static final Log |
| Access | Constructor and Description |
|---|---|
| public | COSString(byte[]
The raw bytes of the PDF text string or byte string. bytes)Creates a new PDF string from a byte array. |
| public | COSString(byte[]
The raw bytes of the PDF text string or byte string. bytes, boolean forces the hexadecimal presentation of the string if set to true forceHex)Creates a new PDF string from a byte array. |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(ICOSVisitor
The object to notify when visiting this object. visitor)Implements abstract org. Visitor pattern double dispatch method. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | Returns: the ASCII string representation of the COSStringReturns the content of this string as a PDF ASCII string. |
| public byte[] | Returns: a clone of the underlying byte[] representation of the COSStringReturns the raw bytes of the string using a new byte array. |
| public boolean | Returns: true if the COSString is written in hex formReturns true if the string is to be written in hex form. |
| public String | Returns: the PDF string representation of the COSStringReturns the content of this string as a PDF text string. |
| public int | |
| public static COSString | |
| public void | setForceHexForm(boolean
True to force hex. value)
Deprecated
to be removed in a future release.
Sets whether to force the string is to be written in hex form. |
| public void | setValue(byte[]
The raw bytes of the PDF text string or byte string. value)
Deprecated
to be removed in a future release.
Sets the raw value of this string. |
| public String | Returns: A hex string representing the bytes in this string.This will take this string and create a hex representation of the bytes that make the string. |
| public String |
| bytes | back to summary |
|---|---|
| private byte[] bytes | |
| FORCE_PARSING | back to summary |
|---|---|
| public static final boolean FORCE_PARSING | |
| forceHexForm | back to summary |
|---|---|
| private boolean forceHexForm | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| COSString | back to summary |
|---|---|
| public COSString(byte[] bytes) Creates a new PDF string from a byte array. This method can be used to read a string from an existing PDF file, or to create a new byte string.
| |
| COSString | back to summary |
|---|---|
| public COSString(byte[] bytes, boolean forceHex) Creates a new PDF string from a byte array. This method can be used to read a string from an existing PDF file, or to create a new byte string.
| |
| COSString | back to summary |
|---|---|
| public COSString(String text) Creates a new text string from a Java String.
| |
| COSString | back to summary |
|---|---|
| public COSString(String text, boolean forceHex) Creates a new text string from a Java String.
| |
| accept | back to summary |
|---|---|
| public void accept(ICOSVisitor visitor) throws IOException Implements abstract org. Visitor pattern double dispatch method.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getASCII | back to summary |
|---|---|
| public String getASCII() Returns the content of this string as a PDF ASCII string.
| |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() Returns the raw bytes of the string using a new byte array. Best used with a PDF byte string.
| |
| getForceHexForm | back to summary |
|---|---|
| public boolean getForceHexForm() Returns true if the string is to be written in hex form.
| |
| getString | back to summary |
|---|---|
| public String getString() Returns the content of this string as a PDF text string.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| parseHex | back to summary |
|---|---|
| public static COSString parseHex(String hex) throws IOException This will create a COS string from a string of hex characters.
| |
| setForceHexForm | back to summary |
|---|---|
| public void setForceHexForm(boolean value)
Deprecated to be removed in a future release. Sets whether to force the string is to be written in hex form. This is needed when signing PDF files.
| |
| setValue | back to summary |
|---|---|
| public void setValue(byte[] value)
Deprecated to be removed in a future release. Sets the raw value of this string.
| |
| toHexString | back to summary |
|---|---|
| public String toHexString() This will take this string and create a hex representation of the bytes that make the string.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |