PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
PDF::TextRun Class Reference

Represents a text run in a PDF document. More...

#include <pdfsdk/cxx/text_run.h>

Inheritance diagram for PDF::TextRun:

Public Member Functions

TextRun Copy () const
 
TextRun MakeEmptyCopy () const
 
bool Equals (const TextRun &that) const
 
void InsertChars (size_t index, const char *chars, size_t numChars)
 
void AppendChars (const char *chars, size_t numChars)
 
void InsertChars (size_t index, const std::string &chars)
 
void AppendChars (const std::string &chars)
 
void RemoveChars (size_t index, size_t numChars)
 
void InsertUnicodeChars (size_t index, const UnicodeChar *unicodeChars, size_t numUnicodeChars)
 
void AppendUnicodeChars (const UnicodeChar *unicodeChars, size_t numUnicodeChars)
 
void InsertUnicodeChars (size_t index, const std::wstring &unicodeChars)
 
void AppendUnicodeChars (const std::wstring &unicodeChars)
 
GState GetGState () const
 
void SetGState (const GState &gState)
 
PDETextState GetTextState () const
 
void SetTextState (const PDETextState &textState)
 
Font GetFont () const
 
void SetFont (const Font &font)
 
void SetFont (const Font &font, float fontSize)
 
float GetFontSize () const
 
void SetFontSize (float fontSize)
 
Matrix GetTextMatrix () const
 
void SetTextMatrix (const Matrix &textMatrix)
 
size_t GetNumChars () const
 
RectF GetCharsRect (size_t begindex, size_t endindex) const
 
Quad GetCharQuad (size_t index) const
 
Quad GetOutlineQuad (size_t index) const
 
std::wstring GetText () const
 
std::wstring GetNthUnicode (size_t charindex) const
 
RectF GetBBox () const
 
Matrix GetMatrix () const
 
void SetMatrix (const Matrix &matrix)
 
Element GetParent () const
 
bool IsCharWhitespace (size_t index) const
 
 TextRun (PDETextItem handle, bool adopt=false) noexcept
 
 TextRun (const TextRun &rhs) noexcept
 
TextRunoperator= (const TextRun &rhs) noexcept
 
 TextRun (TextRun &&rhs) noexcept
 
TextRunoperator= (TextRun &&rhs) noexcept
 

Static Public Member Functions

static TextRun Create ()
 

Detailed Description

Represents a text run in a PDF document.

ISO 32000-2:2020 - 9.4 Text objects

Member Function Documentation

◆ AppendChars() [1/2]

void PDF::TextRun::AppendChars ( const char * chars,
size_t numChars )

Appends characters to the TextRun object.

Parameters
charsThe characters to append.
numCharsThe number of characters to append.

◆ AppendChars() [2/2]

void PDF::TextRun::AppendChars ( const std::string & chars)

Appends characters to the TextRun object.

Parameters
charsThe characters to append.

◆ AppendUnicodeChars() [1/2]

void PDF::TextRun::AppendUnicodeChars ( const std::wstring & unicodeChars)

Appends Unicode characters to the TextRun object.

Parameters
unicodeCharsThe Unicode characters to append.

◆ AppendUnicodeChars() [2/2]

void PDF::TextRun::AppendUnicodeChars ( const UnicodeChar * unicodeChars,
size_t numUnicodeChars )

Appends Unicode characters to the TextRun object.

Parameters
unicodeCharsThe Unicode characters to append.
numUnicodeCharsThe number of Unicode characters to append.

◆ Copy()

TextRun PDF::TextRun::Copy ( ) const

Creates a copy of the TextRun object.

Returns
A copy of the TextRun object.

◆ Create()

static TextRun PDF::TextRun::Create ( )
static

Creates a new TextRun object.

Returns
The newly created TextRun object.

◆ Equals()

bool PDF::TextRun::Equals ( const TextRun & that) const

Checks if the TextRun object is equal to another TextRun object.

Parameters
thatThe TextRun object to compare with.
Returns
True if the TextRun objects are equal, false otherwise.

◆ GetBBox()

RectF PDF::TextRun::GetBBox ( ) const

Gets the bounding box of the TextRun object.

Returns
The bounding box of the TextRun object.

◆ GetCharQuad()

Quad PDF::TextRun::GetCharQuad ( size_t index) const

Gets the quad for a character in the TextRun object.

Parameters
indexThe index of the character.
Returns
The quad for the character.

◆ GetCharsRect()

RectF PDF::TextRun::GetCharsRect ( size_t begindex,
size_t endindex ) const

Gets the bounding box of a range of characters in the TextRun object.

Parameters
begindexThe beginning index of the range.
endindexThe ending index of the range.
Returns
The bounding box of the range of characters.

◆ GetFont()

Font PDF::TextRun::GetFont ( ) const

Gets the font of the TextRun object.

Returns
The font of the TextRun object.

◆ GetFontSize()

float PDF::TextRun::GetFontSize ( ) const

Gets the font size of the TextRun object.

Returns
The font size of the TextRun object.

◆ GetGState()

GState PDF::TextRun::GetGState ( ) const

Gets the graphics state of the TextRun object.

Returns
The graphics state of the TextRun object.

◆ GetMatrix()

Matrix PDF::TextRun::GetMatrix ( ) const

Gets the matrix of the TextRun object.

Returns
The matrix of the TextRun object.

◆ GetNthUnicode()

std::wstring PDF::TextRun::GetNthUnicode ( size_t charindex) const

Gets the nth Unicode character in the TextRun object.

Parameters
charindexThe index of the Unicode character.
Returns
The nth Unicode character.

◆ GetNumChars()

size_t PDF::TextRun::GetNumChars ( ) const

Gets the number of characters in the TextRun object.

Returns
The number of characters in the TextRun object.

◆ GetOutlineQuad()

Quad PDF::TextRun::GetOutlineQuad ( size_t index) const

Gets the outline quad for a character in the TextRun object.

Parameters
indexThe index of the character.
Returns
The outline quad for the character.

◆ GetParent()

Element PDF::TextRun::GetParent ( ) const

Gets the parent element of the TextRun object.

Returns
The parent element of the TextRun object.

◆ GetText()

std::wstring PDF::TextRun::GetText ( ) const

Gets the text of the TextRun object.

Returns
The text of the TextRun object.

◆ GetTextMatrix()

Matrix PDF::TextRun::GetTextMatrix ( ) const

Gets the text matrix of the TextRun object.

Returns
The text matrix of the TextRun object.

◆ GetTextState()

PDETextState PDF::TextRun::GetTextState ( ) const

Gets the text state of the TextRun object.

Returns
The text state of the TextRun object.

◆ InsertChars() [1/2]

void PDF::TextRun::InsertChars ( size_t index,
const char * chars,
size_t numChars )

Inserts characters into the TextRun object at the specified index.

Parameters
indexThe index at which to insert the characters.
charsThe characters to insert.
numCharsThe number of characters to insert.

◆ InsertChars() [2/2]

void PDF::TextRun::InsertChars ( size_t index,
const std::string & chars )

Inserts characters into the TextRun object at the specified index.

Parameters
indexThe index at which to insert the characters.
charsThe characters to insert.

◆ InsertUnicodeChars() [1/2]

void PDF::TextRun::InsertUnicodeChars ( size_t index,
const std::wstring & unicodeChars )

Inserts a Unicode character into the TextRun object at the specified index.

Parameters
indexThe index at which to insert the Unicode character.
unicodeCharsThe Unicode characters to insert.

◆ InsertUnicodeChars() [2/2]

void PDF::TextRun::InsertUnicodeChars ( size_t index,
const UnicodeChar * unicodeChars,
size_t numUnicodeChars )

Inserts a Unicode character into the TextRun object at the specified index.

Parameters
indexThe index at which to insert the Unicode character.
unicodeCharsThe Unicode characters to insert.
numUnicodeCharsThe number of Unicode characters to insert.

◆ IsCharWhitespace()

bool PDF::TextRun::IsCharWhitespace ( size_t index) const

Checks if a character in the TextRun object is whitespace.

Parameters
indexThe index of the character.
Returns
True if the character is whitespace, false otherwise.

◆ MakeEmptyCopy()

TextRun PDF::TextRun::MakeEmptyCopy ( ) const

Creates an empty copy of the TextRun object.

Returns
An empty copy of the TextRun object.

◆ RemoveChars()

void PDF::TextRun::RemoveChars ( size_t index,
size_t numChars )

Removes characters from the TextRun object starting at the specified index.

Parameters
indexThe index at which to start removing characters.
numCharsThe number of characters to remove.

◆ SetFont() [1/2]

void PDF::TextRun::SetFont ( const Font & font)

Sets the font of the TextRun object.

Parameters
fontThe font to set.

◆ SetFont() [2/2]

void PDF::TextRun::SetFont ( const Font & font,
float fontSize )

Sets the font of the TextRun object.

Parameters
fontThe font to set.
fontSizeThe font size to set.

◆ SetFontSize()

void PDF::TextRun::SetFontSize ( float fontSize)

Sets the font size of the TextRun object.

Parameters
fontSizeThe font size to set.

◆ SetGState()

void PDF::TextRun::SetGState ( const GState & gState)

Sets the graphics state of the TextRun object.

Parameters
gStateThe graphics state to set.

◆ SetMatrix()

void PDF::TextRun::SetMatrix ( const Matrix & matrix)

Sets the matrix of the TextRun object.

Parameters
matrixThe matrix to set.

◆ SetTextMatrix()

void PDF::TextRun::SetTextMatrix ( const Matrix & textMatrix)

Sets the text matrix of the TextRun object.

Parameters
textMatrixThe text matrix to set.

◆ SetTextState()

void PDF::TextRun::SetTextState ( const PDETextState & textState)

Sets the text state of the TextRun object.

Parameters
textStateThe text state to set.

The documentation for this class was generated from the following file: