Class PdfString
A
PdfString
-class is the PDF-equivalent of a
JAVA-
String
-object.
public class PdfString : PdfPrimitiveObject
- Inheritance
-
PdfString
- Inherited Members
Remarks
A
PdfString
-class is the PDF-equivalent of a
JAVA-
String
-object.
This object is described in the 'Portable Document Format Reference Manual version 1.7' section 3.2.3 (page 53-56).
Constructors
PdfString(byte[])
public PdfString(byte[] content)
Parameters
content
byte[]
- See Also
PdfString(byte[], bool)
Only PdfReader can use this method!
protected PdfString(byte[] content, bool hexWriting)
Parameters
content
byte[]byte content the PdfString will be created from
hexWriting
boolboolean indicating if hex writing will be used
- See Also
PdfString(string)
public PdfString(string value)
Parameters
value
string
- See Also
PdfString(string, string)
public PdfString(string value, string encoding)
Parameters
- See Also
Fields
encoding
protected string encoding
Field Value
- See Also
hexWriting
protected bool hexWriting
Field Value
- See Also
value
protected string value
Field Value
- See Also
Methods
CopyContent(PdfObject, PdfDocument, ICopyFilter)
protected override void CopyContent(PdfObject from, PdfDocument document, ICopyFilter copyFilter)
Parameters
from
PdfObjectdocument
PdfDocumentcopyFilter
ICopyFilter
- See Also
DecodeContent()
protected virtual byte[] DecodeContent()
Returns
- byte[]
- See Also
EncodeBytes(byte[])
Escape special symbols or convert to hexadecimal string.
protected virtual byte[] EncodeBytes(byte[] bytes)
Parameters
bytes
byte[]byte array to manipulate with.
Returns
- byte[]
Hexadecimal string or string with escaped symbols in byte array view.
Remarks
Escape special symbols or convert to hexadecimal string.
This method don't change either
value
or
content
ot the
PdfString
.
- See Also
Encrypt(PdfEncryption)
Encrypt content of
value
and set as content.
protected virtual bool Encrypt(PdfEncryption encrypt)
Parameters
encrypt
PdfEncryptionPdfEncryption instance
Returns
- bool
true if value was encrypted, otherwise false.
Remarks
Encrypt content of
value
and set as content.
generateContent()
won't be called.
- See Also
Equals(object)
public override bool Equals(object o)
Parameters
o
object
Returns
- See Also
GenerateContent()
protected override void GenerateContent()
- See Also
GenerateValue()
protected virtual void GenerateValue()
- See Also
GetEncoding()
Gets the encoding of this string.
public virtual string GetEncoding()
Returns
- See Also
GetHashCode()
public override int GetHashCode()
Returns
- See Also
GetObjectType()
public override byte GetObjectType()
Returns
- See Also
GetValue()
public virtual string GetValue()
Returns
- See Also
GetValueBytes()
Gets bytes of String-value considering encoding.
public virtual byte[] GetValueBytes()
Returns
- byte[]
byte array
- See Also
IsHexWriting()
public virtual bool IsHexWriting()
Returns
- See Also
MarkAsUnencryptedObject()
Marks this string object as not encrypted in the encrypted document.
public virtual void MarkAsUnencryptedObject()
Remarks
Marks this string object as not encrypted in the encrypted document.
If it's marked so, it will be considered as already in plaintext and decryption will not be performed for it. In order to have effect, this method shall be called before GetValue() and GetValueBytes() methods. NOTE: this method is only needed in a very specific cases of encrypted documents. E.g. digital signature dictionary /Contents entry shall not be encrypted. Also this method isn't meaningful in non-encrypted documents.- See Also
NewInstance()
protected override PdfObject NewInstance()
Returns
- See Also
SetHexWriting(bool)
public virtual PdfString SetHexWriting(bool hexWriting)
Parameters
hexWriting
bool
Returns
- See Also
ToString()
public override string ToString()
Returns
- See Also
ToUnicodeString()
Returns the Unicode
String
value of this
PdfString
-object.
public virtual string ToUnicodeString()
Returns
- See Also