public class PDFString extends PDFObject
| Constructor and Description |
|---|
PDFString(byte[] value,
Document doc,
boolean indirect,
boolean storedAsHex)
General constructor
|
PDFString(byte[] value,
PDFObject docFromObj,
boolean indirect,
boolean storedAsHex)
General constructor
|
PDFString(java.lang.String value,
Document doc,
boolean indirect,
boolean storedAsHex)
String constructor
|
PDFString(java.lang.String value,
Document doc,
boolean indirect,
boolean storedAsHex,
boolean storedAsUTF16)
String constructor
|
PDFString(java.lang.String value,
PDFObject docFromObj,
boolean indirect,
boolean storedAsHex)
String constructor
|
PDFString(java.lang.String value,
PDFObject docFromObj,
boolean indirect,
boolean storedAsHex,
boolean storedAsUTF16)
String constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
byte[] |
getBytes()
Byte array of this PDFString.
|
boolean |
getStoredAsHex()
Indicates that the data is stored as hexadecimal values.
|
java.lang.String |
getValue()
The byte array as a native string object.
|
java.lang.String |
toString() |
clone, clone, clone, clone, clone, compareTo, destroy, enumPDFObjects, equals, getDocument, getGeneration, getID, getIndirect, getPDFHashValuepublic PDFString(byte[] value,
Document doc,
boolean indirect,
boolean storedAsHex)
value - Array of bytes stored in this PDFStringdoc - Document object containing this PDFStringindirect - flag marking this as an indirect PDFObjectstoredAsHex - flag indicating this PDFString should be stored as hex valuespublic PDFString(byte[] value,
PDFObject docFromObj,
boolean indirect,
boolean storedAsHex)
value - Array of bytes stored in this PDFStringdocFromObj - The new PDFString will be created in the same document as this object.indirect - flag marking this as an indirect PDFObjectstoredAsHex - flag indicating this PDFString should be stored as hex valuespublic PDFString(java.lang.String value,
Document doc,
boolean indirect,
boolean storedAsHex,
boolean storedAsUTF16)
The provided string value is a Unicode string object. If storedAsUTF16 is true, it will be stored in the document at UTF-16BE. Otherwise it will be stored as PDFDocEncoding if it only contains characters within the PDFDocEncoding character set, else it will be stored as UTF-16BE.
value - String stored in this PDFStringdoc - Document object containing this PDFStringindirect - flag marking this as an indirect PDFObjectstoredAsHex - flag indicating this PDFString should be stored as hex valuesstoredAsUTF16 - flag indicating this PDFString should be stored as UTF-16BE, even if it could be encoded as PDFDocEncodingpublic PDFString(java.lang.String value,
PDFObject docFromObj,
boolean indirect,
boolean storedAsHex,
boolean storedAsUTF16)
The provided string value is a Unicode string object. If storedAsUTF16 is true, it will be stored in the document at UTF-16BE. Otherwise it will be stored as PDFDocEncoding if it only contains characters within the PDFDocEncoding character set, else it will be stored as UTF-16BE.
value - String stored in this PDFStringdocFromObj - The new PDFString will be created in the same document as this object.indirect - flag marking this as an indirect PDFObjectstoredAsHex - flag indicating this PDFString should be stored as hex valuesstoredAsUTF16 - flag indicating this PDFString should be stored as UTF-16BE, even if it could be encoded as PDFDocEncodingpublic PDFString(java.lang.String value,
Document doc,
boolean indirect,
boolean storedAsHex)
The provided string value is a Unicode string object. If it only contains characters within the PDFDocEncoding character set, it will be stored in that encoding; otherwise it will be stored in the document as UTF-16BE.
value - String stored in this PDFStringdoc - Document object containing this PDFStringindirect - flag marking this as an indirect PDFObjectstoredAsHex - flag indicating this PDFString should be stored as hex valuespublic PDFString(java.lang.String value,
PDFObject docFromObj,
boolean indirect,
boolean storedAsHex)
The provided string value is a Unicode string object. If it only contains characters within the PDFDocEncoding character set, it will be stored in that encoding; otherwise it will be stored in the document as UTF-16BE.
value - String stored in this PDFStringdocFromObj - The new PDFString will be created in the same document as this object.indirect - flag marking this as an indirect PDFObjectstoredAsHex - flag indicating this PDFString should be stored as hex valuespublic byte[] getBytes()
This method returns the raw data of the PDFString, without respect to any encoding. It should be used when the contents of the object represent data instead of human readable text, or when direct access to the underlying data is required.
public java.lang.String getValue()
The text may be encoded within the PDF as either UTF-16BE or PDFDocEncoding; in either case, it will be converted to a Unicode string object appropriate to the platform.
If you need to access the contents of the PDFString object without respect to an encoding, use the Bytes property.
public boolean getStoredAsHex()