PDFsharp-net6

PdfStringObject

Namespace: PdfSharp.Pdf

Represents an indirect text string value. This type is not used by PDFsharp. If it is imported from an external PDF file, the value is converted into a direct object.

public sealed class PdfStringObject : PdfObject, System.ICloneable

Inheritance ObjectPdfItemPdfObjectPdfStringObject
Implements ICloneable

Properties

Length

Gets the number of characters in this string.

public int Length { get; }

Property Value

Int32

Encoding

Gets or sets the encoding.

public PdfStringEncoding Encoding { get; set; }

Property Value

PdfStringEncoding

HexLiteral

Gets a value indicating whether the string is a hexadecimal literal.

public bool HexLiteral { get; set; }

Property Value

Boolean

Value

Gets or sets the value as string

public string Value { get; set; }

Property Value

String

Owner

Gets the PdfDocument this object belongs to.

public PdfDocument Owner { get; }

Property Value

PdfDocument

IsIndirect

Indicates whether the object is an indirect object.

public bool IsIndirect { get; }

Property Value

Boolean

Internals

Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.

public PdfObjectInternals Internals { get; }

Property Value

PdfObjectInternals

Reference

Gets the indirect reference of this object. If the value is null, this object is a direct object.

public PdfReference Reference { get; internal set; }

Property Value

PdfReference

ReferenceNotNull

Gets the indirect reference of this object. Throws if it is null.

public PdfReference ReferenceNotNull { get; }

Property Value

PdfReference

Exceptions

InvalidOperationException
The indirect reference must be not null here.

Constructors

PdfStringObject()

Initializes a new instance of the PdfStringObject class.

public PdfStringObject()

PdfStringObject(PdfDocument, String)

Initializes a new instance of the PdfStringObject class.

public PdfStringObject(PdfDocument document, string value)

Parameters

document PdfDocument
The document.

value String
The value.

PdfStringObject(String, PdfStringEncoding)

Initializes a new instance of the PdfStringObject class.

public PdfStringObject(string value, PdfStringEncoding encoding)

Parameters

value String
The value.

encoding PdfStringEncoding
The encoding.

Methods

ToString()

Returns the string.

public string ToString()

Returns

String

WriteObject(PdfWriter)

Writes the string literal with encoding DOCEncoded.

internal void WriteObject(PdfWriter writer)

Parameters

writer PdfWriter