PdfString
Vue de l’ensemble
‘PdfString’ est une classe dans Aspose.PDF FOSS pour Java.Déduit de: PdfBase.
Objet de fil PDF (§7.3.4, ISO 32000-1:2008).
Cette classe fournit 20 méthodes pour travailler avec des objets PdfString dans les programmes Java. Les méthodologies disponibles comprennent: Pdf String, accept , ’equals;fromHex; getAsDate : getBytes:getHeksStrin. getObjectKeyetGetStren.hashCode., isBinary,, sDirtyainsi que 7 méthodi supplémentaires. Tous les membres publics sont accessibles à toute application Java après l'installation de l’ASPOSE.PDF FOSS pour le package Java . Propriétés :asDatas, 'binary‘, ‘bytes', dirty’, forceHEx``etxStr, et plus.
Propriétés
| Name | Type | Access | Description |
|---|---|---|---|
bytes | byte[] | Read | Returns the raw bytes of this string. |
string | String | Read | Decodes the bytes as text: if BOM present, UTF-16BE; otherwise PDFDocEncoding. |
forceHex | boolean | Read | Returns whether this string forces hex serialization. |
asDate | LocalDateTime | Read | Attempts to parse the string as a PDF date. |
hexString | String | Read | Returns the string in hex representation: <AABBCC…> |
| Used for binary strings (IDs, encryption keys). | |||
binary | boolean | Read | Returns true if this string contains non-printable bytes |
| (likely binary data like file ID or encryption key). | |||
dirty | boolean | Read | Returns {@code true} if this object was modified since loading. |
indirect | boolean | Read | Returns whether this object is an indirect object (has an object key). |
objectKey | PdfObjectKey | Read | Returns the indirect object key, or {@code null} for direct objects. |
méthodes
| Signature | Description |
|---|---|
PdfString(bytes: byte[]) | Creates a PdfString from raw bytes. |
PdfString(text: String) | Creates a PdfString from a Java string. |
fromHex(hex: String) → PdfString | Creates a PdfString from a hex string (without angle brackets). |
getBytes() → byte[] | Returns the raw bytes of this string. |
getString() → String | Decodes the bytes as text: if BOM present, UTF-16BE; otherwise PDFDocEncoding. |
setForceHex(forceHex: boolean) | Sets whether this string should always be serialized in hex form. |
isForceHex() → boolean | Returns whether this string forces hex serialization. |
getAsDate() → LocalDateTime | Attempts to parse the string as a PDF date. |
getHexString() → String | Returns the string in hex representation: <AABBCC…> |
| Used for binary strings (IDs, encryption keys). | |
isBinary() → boolean | Returns true if this string contains non-printable bytes |
| (likely binary data like file ID or encryption key). | |
writeTo(os: OutputStream) | |
accept(visitor: IPdfVisitor<T>) → T | |
equals(o: Object) → boolean | |
hashCode() → int | |
toString() → String | |
isDirty() → boolean | Returns {@code true} if this object was modified since loading. |
setDirty(dirty: boolean) | Sets the dirty flag on this object. |
isIndirect() → boolean | Returns whether this object is an indirect object (has an object key). |
getObjectKey() → PdfObjectKey | Returns the indirect object key, or {@code null} for direct objects. |
setObjectKey(key: PdfObjectKey) | Sets the indirect object key. |
Voir aussi
- Aspose.PDF pour Java — API d’entreprise