PdfTextSegment Struct

An element of a text shown with individual glyph positioning (the TJ operator, ISO 32000-2, 9.4.3): a text, or an adjustment of the position.

public readonly struct PdfTextSegment : IEquatable<PdfTextSegment>
Implements

Properties

NameDescription
AdjustmentGets the adjustment in thousandths of the font size: a positive value moves the next glyph to the left (horizontal writing).
TextGets the text, or null for an adjustment.

Gets the adjustment in thousandths of the font size: a positive value moves the next glyph to the left (horizontal writing).

public double Adjustment { get; }

Property value

double

Gets the text, or null for an adjustment.

public string? Text { get; }

Property value

string?

Methods

NameDescription
Equals(PdfTextSegment)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromAdjustment(double)Creates an adjustment.
FromText(string)Creates a text segment.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(PdfTextSegment)

PdfTextSegment.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PdfTextSegment other)
Parameters
other PdfTextSegment
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

PdfTextSegment.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromAdjustment(double)

PdfTextSegment.cs

Creates an adjustment.

public static PdfTextSegment FromAdjustment(double adjustment)

Parameters

adjustment double
The adjustment, in thousandths of the font size.

Returns

PdfTextSegment The segment.

FromText(string)

PdfTextSegment.cs

Creates a text segment.

public static PdfTextSegment FromText(string text)

Parameters

text string
The text.

Returns

PdfTextSegment The segment.

GetHashCode()

PdfTextSegment.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(PdfTextSegment, PdfTextSegment)Indicates whether two segments are equal.
implicit operator PdfTextSegment(double)Converts an adjustment to a segment.
implicit operator PdfTextSegment(string)Converts a text to a segment.
operator !=(PdfTextSegment, PdfTextSegment)Indicates whether two segments are different.

operator ==(PdfTextSegment, PdfTextSegment)

PdfTextSegment.cs

Indicates whether two segments are equal.

public static bool operator ==(PdfTextSegment left, PdfTextSegment right)

Parameters

left PdfTextSegment
The first segment.
right PdfTextSegment
The second segment.

Returns

bool true when the segments are equal.

op_Implicit overloads

implicit operator PdfTextSegment(double)

PdfTextSegment.cs

Converts an adjustment to a segment.

public static implicit operator PdfTextSegment(double adjustment)
Parameters
adjustment double
The adjustment, in thousandths of the font size.
Returns

PdfTextSegment

implicit operator PdfTextSegment(string)

PdfTextSegment.cs

Converts a text to a segment.

public static implicit operator PdfTextSegment(string text)
Parameters
text string
The text.
Returns

PdfTextSegment

operator !=(PdfTextSegment, PdfTextSegment)

PdfTextSegment.cs

Indicates whether two segments are different.

public static bool operator !=(PdfTextSegment left, PdfTextSegment right)

Parameters

left PdfTextSegment
The first segment.
right PdfTextSegment
The second segment.

Returns

bool true when the segments are different.