Class PDFString
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.datalogics.PDFL.PDFObject
clone, clone, clone, clone, clone, compareTo, destroy, enumPDFObjects, equals, getDocument, getGeneration, getID, getIndirect, getPDFHashValue
-
Constructor Details
-
PDFString
General constructor- Parameters:
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 values
-
PDFString
General constructor- Parameters:
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 values
-
PDFString
public PDFString(String value, Document doc, boolean indirect, boolean storedAsHex, boolean storedAsUTF16) String constructorThe 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.
- Parameters:
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 PDFDocEncoding
-
PDFString
public PDFString(String value, PDFObject docFromObj, boolean indirect, boolean storedAsHex, boolean storedAsUTF16) String constructorThe 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.
- Parameters:
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 PDFDocEncoding
-
PDFString
String constructorThe 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.
- Parameters:
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 values
-
PDFString
String constructorThe 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.
- Parameters:
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 values
-
-
Method Details
-
delete
public void delete() -
toString
-
getBytes
public byte[] getBytes()Byte array of this PDFString.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.
-
getValue
The byte array as a native string object. This is a convenience for typical uses where a PDFString holds a human readable string instead of a byte array.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.
-
getStoredAsHex
public boolean getStoredAsHex()Indicates that the data is stored as hexadecimal values.
-