Represents fragment of Pdf text. More...

#include "TextFragment.h"

Inherits Aspose::Pdf::BaseParagraph.

Inherited by Aspose::Pdf::Heading.

Public Member Functions

ASPOSE_PDF_SHARED_API const System::SharedPtr< TextReplaceOptions > & get_ReplaceOptions () const
 Gets text replace options. The options define behavior when fragment text is replaced to more short/long. More...
 
ASPOSE_PDF_SHARED_API System::String get_Text ()
 Gets System::String text object that the TextFragment object represents. More...
 
ASPOSE_PDF_SHARED_API void set_Text (System::String value)
 Sets System::String text object that the TextFragment object represents. More...
 
ASPOSE_PDF_SHARED_API Aspose::Pdf::VerticalAlignment get_VerticalAlignment () override
 Gets a vertical alignment of text fragment. More...
 
ASPOSE_PDF_SHARED_API void set_VerticalAlignment (Aspose::Pdf::VerticalAlignment value) override
 Sets a vertical alignment of text fragment. More...
 
ASPOSE_PDF_SHARED_API Aspose::Pdf::HorizontalAlignment get_HorizontalAlignment () override
 Gets a horizontal alignment of text fragment. More...
 
ASPOSE_PDF_SHARED_API void set_HorizontalAlignment (Aspose::Pdf::HorizontalAlignment value) override
 Sets a horizontal alignment of text fragment. More...
 
ASPOSE_PDF_SHARED_API void set_Hyperlink (System::SharedPtr< Aspose::Pdf::Hyperlink > value) override
 Sets the fragment hyperlink More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< TextFragmentStateget_TextState ()
 Gets text state for the text that TextFragment object represents. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< TextSegmentCollectionget_Segments () const
 Gets text segments for current TextFragment. More...
 
ASPOSE_PDF_SHARED_API void set_Segments (System::SharedPtr< TextSegmentCollection > value)
 Gets text segments for current TextFragment. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::Text::Positionget_Position ()
 Gets text position for text, represented with TextFragment object. More...
 
ASPOSE_PDF_SHARED_API void set_Position (System::SharedPtr< Aspose::Pdf::Text::Position > value)
 Sets text position for text, represented with TextFragment object. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::Text::Positionget_BaselinePosition ()
 Gets text position for text, represented with TextFragment object. The YIndent of the Position structure represents baseline coordinate of the text fragment. More...
 
ASPOSE_PDF_SHARED_API void set_BaselinePosition (System::SharedPtr< Aspose::Pdf::Text::Position > value)
 Gets text position for text, represented with TextFragment object. The YIndent of the Position structure represents baseline coordinate of the text fragment. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::Rectangleget_Rectangle ()
 Gets rectangle of the TextFragment More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::Pageget_Page () const
 Gets page that contains the TextFragment More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< XFormget_Form () const
 Gets form object that contains the TextFragment More...
 
ASPOSE_PDF_SHARED_API int32_t get_WrapLinesCount () const
 Gets wrap lines count for this paragraph(for pdf generation only) More...
 
ASPOSE_PDF_SHARED_API void set_WrapLinesCount (int32_t value)
 Sets wrap lines count for this paragraph(for pdf generation only) More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Noteget_EndNote () const
 Gets the paragraph end note.(for pdf generation only) More...
 
ASPOSE_PDF_SHARED_API void set_EndNote (System::SharedPtr< Note > value)
 Sets the paragraph end note.(for pdf generation only) More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< Noteget_FootNote () const
 Gets the paragraph foot note.(for pdf generation only) More...
 
ASPOSE_PDF_SHARED_API void set_FootNote (System::SharedPtr< Note > value)
 Sets the paragraph foot note.(for pdf generation only) More...
 
ASPOSE_PDF_SHARED_API TextFragment ()
 Initializes new instance of the TextFragment object. More...
 
ASPOSE_PDF_SHARED_API TextFragment (System::SharedPtr< TabStops > tabStops)
 Initializes new instance of the TextFragment object with predefined TabStops positions. More...
 
ASPOSE_PDF_SHARED_API TextFragment (System::String text)
 Creates TextFragment object with single TextSegment object inside. Specifies text string inside the segment. More...
 
ASPOSE_PDF_SHARED_API TextFragment (System::String text, System::SharedPtr< TabStops > tabStops)
 Creates TextFragment object with single TextSegment object inside and predefined TabStops positions. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< TextSegmentCollectionIsolateTextSegments (int32_t startIndex, int32_t length)
 Gets TextSegment(s) representing specified part of the TextFragment text. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::ObjectClone () override
 Clone the fragment. More...
 
virtual ASPOSE_PDF_SHARED_API System::SharedPtr< System::ObjectCloneWithSegments ()
 Clone the fragment with all segments. More...
 
- Public Member Functions inherited from Aspose::Pdf::BaseParagraph
ASPOSE_PDF_SHARED_API System::SharedPtr< MarginInfoget_Margin ()
 Gets a outer margin for paragraph (for pdf generation) More...
 
ASPOSE_PDF_SHARED_API void set_Margin (System::SharedPtr< MarginInfo > value)
 Sets a outer margin for paragraph (for pdf generation) More...
 
ASPOSE_PDF_SHARED_API bool get_IsFirstParagraphInColumn () const
 Gets a bool value that indicates whether this paragraph will be at next column. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API void set_IsFirstParagraphInColumn (bool value)
 Sets a bool value that indicates whether this paragraph will be at next column. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API bool get_IsKeptWithNext () const
 Gets a bool value that indicates whether current paragraph remains in the same page along with next paragraph. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API void set_IsKeptWithNext (bool value)
 Sets a bool value that indicates whether current paragraph remains in the same page along with next paragraph. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API bool get_IsInNewPage () const
 Gets a bool value that force this paragraph generates at new page. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API void set_IsInNewPage (bool value)
 Sets a bool value that force this paragraph generates at new page. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API bool get_IsInLineParagraph () const
 Gets a paragraph is inline. Default is false.(for pdf generation) More...
 
ASPOSE_PDF_SHARED_API void set_IsInLineParagraph (bool value)
 Sets a paragraph is inline. Default is false.(for pdf generation) More...
 
virtual ASPOSE_PDF_SHARED_API System::SharedPtr< Aspose::Pdf::Hyperlinkget_Hyperlink ()
 Gets the fragment hyperlink(for pdf generator). More...
 
ASPOSE_PDF_SHARED_API int32_t get_ZIndex () const
 Gets a int value that indicates the Z-order of the graph. A graph with larger ZIndex will be placed over the graph with smaller ZIndex. ZIndex can be negative. Graph with negative ZIndex will be placed behind the text in the page. More...
 
ASPOSE_PDF_SHARED_API void set_ZIndex (int32_t value)
 Sets a int value that indicates the Z-order of the graph. A graph with larger ZIndex will be placed over the graph with smaller ZIndex. ZIndex can be negative. Graph with negative ZIndex will be placed behind the text in the page. More...
 
ASPOSE_PDF_SHARED_API BaseParagraph ()
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Protected Types

enum  SegmentAdjustmentMethod { SegmentAdjustmentMethod::NoAdjustment, SegmentAdjustmentMethod::KeepOriginalPosition, SegmentAdjustmentMethod::AdjustOnTextFragmentPosition }
 The method to use to adjust the position of a trailing physical segment (created when isolating a text fragment into a single text segment) after setting new text in the text fragment. More...
 

Protected Member Functions

Aspose::Pdf::Text::TextState::AttachState get_AttachedState () const
 
void set_AttachedState (Aspose::Pdf::Text::TextState::AttachState value)
 
ASPOSE_PDF_SHARED_API void set_ReplaceOptions (System::SharedPtr< TextReplaceOptions > value)
 Gets text replace options. The options define behavior when fragment text is replaced to more short/long. More...
 
System::String get_McName () const
 
int32_t get_McId () const
 
System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::SegmentsGroupState > get_SegmentsGroupState () const
 
void set_SegmentsGroupState (System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::SegmentsGroupState > value)
 
ASPOSE_PDF_SHARED_API void set_TextState (System::SharedPtr< TextFragmentState > value)
 Sets text state for the text that TextFragment object represents. More...
 
System::SharedPtr< TextFragmentCollectionget_Fragments () const
 Gets collection that contains current fragment More...
 
void set_Fragments (System::SharedPtr< TextFragmentCollection > value)
 Sets collection that contains current fragment More...
 
ASPOSE_PDF_SHARED_API void set_Rectangle (System::SharedPtr< Aspose::Pdf::Rectangle > value)
 Gets rectangle of the TextFragment More...
 
ASPOSE_PDF_SHARED_API void set_Page (System::SharedPtr< Aspose::Pdf::Page > value)
 Gets page that contains the TextFragment More...
 
System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter > get_Segmenter () const
 Gets TextSegmenter that was used for creation segments of this fragment. More...
 
bool get_IsPositionChanged () const
 Indicates whether position of the fragment is changed or default More...
 
void SetEncodedTextProperties (System::SharedPtr< Font > font, System::String text, System::ArrayPtr< int32_t > indices)
 Sets font and indices inside the font More...
 
void Attach (System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter > segmenter)
 Attaches to the segmenter More...
 
void IsolateToSingleSegment ()
 Isolates segments to single segment for simpler editing. More...
 
void IsolateToText ()
 Isolates segments to segment that represent the text only. i.e. we Trim from beginning and end More...
 
System::SharedPtr< Aspose::Pdf::RectangleComputeUnderlineRectangle ()
 
System::ArrayPtr< System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment > > GetAttachedPhysicalSegmentsArray (int32_t &firstSegmentIndex, int32_t &lastSegmentIndex)
 
void ResetTabstops ()
 
bool IsMultiline ()
 Indicates whether the fragment contains segments on different "text lines" More...
 
bool IsMultilineOrSubscript ()
 Indicates whether the fragment contains segments on different "text lines" More...
 
 TextFragment (System::String text, System::SharedPtr< TextSegmentCollection > segments)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (TextFragment, CODEPORTING_ARGS(System::String text, System::SharedPtr< TextSegmentCollection > segments))
 
 TextFragment (System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter > segmenter, System::String text, System::SharedPtr< TextSegmentCollection > segments)
 
 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION (TextFragment, CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter > segmenter, System::String text, System::SharedPtr< TextSegmentCollection > segments))
 
void SyncVerticalAlignment (Aspose::Pdf::VerticalAlignment verticalAlignment)
 
void SyncHorizontalAlignment (Aspose::Pdf::HorizontalAlignment horizontalAlignment1)
 
void LightWeightTextSetter (System::String inText, TextFragment::SegmentAdjustmentMethod adjustmentMethod=Aspose::Pdf::Text::TextFragment::SegmentAdjustmentMethod::NoAdjustment)
 Set text internally without paragraph recalculation. More...
 
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment > > > GetLineSegments (double x_indent, double y_indent, double angle)
 
void SetMarkedContentProperties (System::String name, int32_t id)
 
void Assign (System::SharedPtr< TextFragment > fragment)
 
void AssignWithSegments (System::SharedPtr< TextFragment > fragment)
 
ASPOSE_PDF_SHARED_API void Serialize (System::SharedPtr< System::Xml::XmlTextWriter > writer) override
 
ASPOSE_PDF_SHARED_API void Deserialize (System::SharedPtr< System::Xml::XmlReader > reader) override
 
virtual ASPOSE_PDF_SHARED_API ~TextFragment ()
 
- Protected Member Functions inherited from Aspose::Pdf::BaseParagraph
System::String get_Id () const
 Gets a paragraph id. More...
 
void set_Id (System::String value)
 Sets a paragraph id. More...
 
const System::SharedPtr< Annotations::LinkAnnotation > & get_ReferencedFrom () const
 Gets the fragment hyperlink(for pdf generator internal use). More...
 
void set_ReferencedFrom (System::SharedPtr< Annotations::LinkAnnotation > value)
 Sets the fragment hyperlink(for pdf generator internal use). More...
 
void ChangePosition (double &curX, double &curY, double newX, double newY, bool isNextParagraphInline)
 
void ProcessHyperlink (System::SharedPtr< Page > page, System::SharedPtr< Rectangle > rect)
 

Static Protected Member Functions

static System::SharedPtr< Aspose::Pdf::RectangleGetGroupRectangle (System::SharedPtr< TextSegmentCollection > segments, int32_t firstSegmentBeginIndex, int32_t lastSegmentEndIndex, bool measureLastTechnicalSpacings)
 
- Static Protected Member Functions inherited from Aspose::Pdf::BaseParagraph
static bool get_IsZIndexSet ()
 Gets the fragment hyperlink(for pdf generator performance internal use). More...
 
static void set_IsZIndexSet (bool value)
 Sets the fragment hyperlink(for pdf generator performance internal use). More...
 

Protected Attributes

System::EventHandler OnRectChanged
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Detailed Description

Represents fragment of Pdf text.

In a few words, TextFragment object contains list of TextSegment objects.

In details: Text of pdf document in Aspose::Pdf is represented by two basic objects: TextFragment and TextSegment

The differences between them is mostly context-dependent.

Let's consider following scenario. User searches text "hello world" to operate with it, change it's properties, look etc.

Document doc = new Document(docFile);
TextFragmentAbsorber absorber = new TextFragmentAbsorber("hello world");
doc.Pages[1].Accept(absorber);

Phisycally pdf text's representation is very complex. The text "hello world" may consist of several phisycally independent text segments.

The Aspose.Pdf text model basically establishes that TextFragment object provides single logic operation set over physical TextSegment objects set that represent user's query.

In text search scenario, TextFragment is logical "hello world" text representation, and TextSegment object collection represents all physical segments that construct "hello world" text object.

So, TextFragment is close to logical text representation. And TextSegment is close to physical text representation.

Obviously each TextSegment object may have it's own font, coloring, positioning properties.

TextFragment provides simple way to change text with it's properties: set font, set font size, set font color etc. Meanwhile TextSegment objects are accessible and users are able to operate with TextSegment objects independently.

Note that changing TextFragment properties may change inner Segments collection because TextFragment is an aggregate object and it may rearrange internal segments or merge them into single segment. If your requirement is to leave the Segments collection unchanged, please change inner segments individually.

Member Enumeration Documentation

◆ SegmentAdjustmentMethod

The method to use to adjust the position of a trailing physical segment (created when isolating a text fragment into a single text segment) after setting new text in the text fragment.

Enumerator
NoAdjustment 

Don't change the automatically calculated physical segment position.

KeepOriginalPosition 

Keep the physical segment at the position it was before setting new text.

AdjustOnTextFragmentPosition 

Place the physical segment after the new text fragment rectangle.

Constructor & Destructor Documentation

◆ TextFragment() [1/6]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Text::TextFragment::TextFragment ( )

Initializes new instance of the TextFragment object.

◆ TextFragment() [2/6]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Text::TextFragment::TextFragment ( System::SharedPtr< TabStops tabStops)

Initializes new instance of the TextFragment object with predefined TabStops positions.

Parameters
tabStopsTabulation positions

◆ TextFragment() [3/6]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Text::TextFragment::TextFragment ( System::String  text)

Creates TextFragment object with single TextSegment object inside. Specifies text string inside the segment.

Parameters
textText fragment's text.

◆ TextFragment() [4/6]

ASPOSE_PDF_SHARED_API Aspose::Pdf::Text::TextFragment::TextFragment ( System::String  text,
System::SharedPtr< TabStops tabStops 
)

Creates TextFragment object with single TextSegment object inside and predefined TabStops positions.

Parameters
textText fragment's text.
tabStopsTabulation positions

◆ TextFragment() [5/6]

Aspose::Pdf::Text::TextFragment::TextFragment ( System::String  text,
System::SharedPtr< TextSegmentCollection segments 
)
protected

◆ TextFragment() [6/6]

Aspose::Pdf::Text::TextFragment::TextFragment ( System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter >  segmenter,
System::String  text,
System::SharedPtr< TextSegmentCollection segments 
)
protected

◆ ~TextFragment()

virtual ASPOSE_PDF_SHARED_API Aspose::Pdf::Text::TextFragment::~TextFragment ( )
protectedvirtual

Member Function Documentation

◆ Assign()

void Aspose::Pdf::Text::TextFragment::Assign ( System::SharedPtr< TextFragment fragment)
protected

◆ AssignWithSegments()

void Aspose::Pdf::Text::TextFragment::AssignWithSegments ( System::SharedPtr< TextFragment fragment)
protected

◆ Attach()

void Aspose::Pdf::Text::TextFragment::Attach ( System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter >  segmenter)
protected

Attaches to the segmenter

Parameters
segmenter

◆ Clone()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Aspose::Pdf::Text::TextFragment::Clone ( )
overridevirtual

Clone the fragment.

Returns
The cloned object

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ CloneWithSegments()

virtual ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Aspose::Pdf::Text::TextFragment::CloneWithSegments ( )
virtual

Clone the fragment with all segments.

Returns
The cloned object

Reimplemented in Aspose::Pdf::Heading.

◆ ComputeUnderlineRectangle()

System::SharedPtr<Aspose::Pdf::Rectangle> Aspose::Pdf::Text::TextFragment::ComputeUnderlineRectangle ( )
protected

◆ Deserialize()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::Deserialize ( System::SharedPtr< System::Xml::XmlReader reader)
overrideprotectedvirtual

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ get_AttachedState()

Aspose::Pdf::Text::TextState::AttachState Aspose::Pdf::Text::TextFragment::get_AttachedState ( ) const
protected

◆ get_BaselinePosition()

ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Text::Position> Aspose::Pdf::Text::TextFragment::get_BaselinePosition ( )

Gets text position for text, represented with TextFragment object. The YIndent of the Position structure represents baseline coordinate of the text fragment.

◆ get_EndNote()

ASPOSE_PDF_SHARED_API System::SharedPtr<Note> Aspose::Pdf::Text::TextFragment::get_EndNote ( ) const

Gets the paragraph end note.(for pdf generation only)

◆ get_FootNote()

ASPOSE_PDF_SHARED_API System::SharedPtr<Note> Aspose::Pdf::Text::TextFragment::get_FootNote ( ) const

Gets the paragraph foot note.(for pdf generation only)

◆ get_Form()

ASPOSE_PDF_SHARED_API System::SharedPtr<XForm> Aspose::Pdf::Text::TextFragment::get_Form ( ) const

Gets form object that contains the TextFragment

The value can be null in case the TextFragment object doesn't belong to a form.

◆ get_Fragments()

System::SharedPtr<TextFragmentCollection> Aspose::Pdf::Text::TextFragment::get_Fragments ( ) const
protected

Gets collection that contains current fragment

◆ get_HorizontalAlignment()

ASPOSE_PDF_SHARED_API Aspose::Pdf::HorizontalAlignment Aspose::Pdf::Text::TextFragment::get_HorizontalAlignment ( )
overridevirtual

Gets a horizontal alignment of text fragment.

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ get_IsPositionChanged()

bool Aspose::Pdf::Text::TextFragment::get_IsPositionChanged ( ) const
protected

Indicates whether position of the fragment is changed or default

◆ get_McId()

int32_t Aspose::Pdf::Text::TextFragment::get_McId ( ) const
protected

◆ get_McName()

System::String Aspose::Pdf::Text::TextFragment::get_McName ( ) const
protected

◆ get_Page()

ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Page> Aspose::Pdf::Text::TextFragment::get_Page ( ) const

Gets page that contains the TextFragment

The value can be null in case the TextFragment object doesn't belong to any page.

◆ get_Position()

ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Text::Position> Aspose::Pdf::Text::TextFragment::get_Position ( )

Gets text position for text, represented with TextFragment object.

See also
TextFragmentAbsorber
See also
Document
See also
TextSegment

◆ get_Rectangle()

ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Rectangle> Aspose::Pdf::Text::TextFragment::get_Rectangle ( )

Gets rectangle of the TextFragment

◆ get_ReplaceOptions()

ASPOSE_PDF_SHARED_API const System::SharedPtr<TextReplaceOptions>& Aspose::Pdf::Text::TextFragment::get_ReplaceOptions ( ) const

Gets text replace options. The options define behavior when fragment text is replaced to more short/long.

◆ get_Segmenter()

System::SharedPtr<Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter> Aspose::Pdf::Text::TextFragment::get_Segmenter ( ) const
protected

Gets TextSegmenter that was used for creation segments of this fragment.

◆ get_Segments()

ASPOSE_PDF_SHARED_API System::SharedPtr<TextSegmentCollection> Aspose::Pdf::Text::TextFragment::get_Segments ( ) const

Gets text segments for current TextFragment.

In a few words, TextSegment objects are children of TextFragment object. Advanced users may access segments directly to perform more complex text edit scenarios. For details, please look at TextFragment object description.

See also
TextFragmentAbsorber
See also
Document
See also
TextSegment

◆ get_SegmentsGroupState()

System::SharedPtr<Aspose::Pdf::Engine::CommonData::Text::Segmenting::SegmentsGroupState> Aspose::Pdf::Text::TextFragment::get_SegmentsGroupState ( ) const
protected

◆ get_Text()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Text::TextFragment::get_Text ( )

Gets System::String text object that the TextFragment object represents.

See also
TextFragmentAbsorber
See also
Document

◆ get_TextState()

ASPOSE_PDF_SHARED_API System::SharedPtr<TextFragmentState> Aspose::Pdf::Text::TextFragment::get_TextState ( )

Gets text state for the text that TextFragment object represents.

Provides a way to change following properties of the text: Font FontSize FontStyle ForegroundColor BackgroundColor

See also
TextFragmentAbsorber
See also
Document

◆ get_VerticalAlignment()

ASPOSE_PDF_SHARED_API Aspose::Pdf::VerticalAlignment Aspose::Pdf::Text::TextFragment::get_VerticalAlignment ( )
overridevirtual

Gets a vertical alignment of text fragment.

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ get_WrapLinesCount()

ASPOSE_PDF_SHARED_API int32_t Aspose::Pdf::Text::TextFragment::get_WrapLinesCount ( ) const

Gets wrap lines count for this paragraph(for pdf generation only)

◆ GetAttachedPhysicalSegmentsArray()

System::ArrayPtr<System::SharedPtr<Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment> > Aspose::Pdf::Text::TextFragment::GetAttachedPhysicalSegmentsArray ( int32_t &  firstSegmentIndex,
int32_t &  lastSegmentIndex 
)
protected

◆ GetGroupRectangle()

static System::SharedPtr<Aspose::Pdf::Rectangle> Aspose::Pdf::Text::TextFragment::GetGroupRectangle ( System::SharedPtr< TextSegmentCollection segments,
int32_t  firstSegmentBeginIndex,
int32_t  lastSegmentEndIndex,
bool  measureLastTechnicalSpacings 
)
staticprotected

◆ GetLineSegments()

System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment> > > Aspose::Pdf::Text::TextFragment::GetLineSegments ( double  x_indent,
double  y_indent,
double  angle 
)
protected

◆ IsMultiline()

bool Aspose::Pdf::Text::TextFragment::IsMultiline ( )
protected

Indicates whether the fragment contains segments on different "text lines"

<remark> Multiline text fragments may appeared for example as a result of hyphenation during text replacement or as a result of user manipulations. This implementation ignores the sub/superscript. </remark>

Returns
True - if segments placed in a few lines; otherwise, false.

◆ IsMultilineOrSubscript()

bool Aspose::Pdf::Text::TextFragment::IsMultilineOrSubscript ( )
protected

Indicates whether the fragment contains segments on different "text lines"

<remark> Multiline text fragments may appeared for example as a result of hyphenation during text replacement or as a result of user manipulations. This implementation interprets the sub/superscript segment as another line. </remark>

Returns
True - if segments placed in a few lines; otherwise, false.

◆ IsolateTextSegments()

ASPOSE_PDF_SHARED_API System::SharedPtr<TextSegmentCollection> Aspose::Pdf::Text::TextFragment::IsolateTextSegments ( int32_t  startIndex,
int32_t  length 
)

Gets TextSegment(s) representing specified part of the TextFragment text.

Parameters
startIndexPosition in text from which new TextSegment(s) will start.
lengthLength of the text that will isolated into TextSegment(s).
Returns
TextSegmentCollection containing text segments represeting text substring starting at a specifing position and having a specified length.

◆ IsolateToSingleSegment()

void Aspose::Pdf::Text::TextFragment::IsolateToSingleSegment ( )
protected

Isolates segments to single segment for simpler editing.

◆ IsolateToText()

void Aspose::Pdf::Text::TextFragment::IsolateToText ( )
protected

Isolates segments to segment that represent the text only. i.e. we Trim from beginning and end

◆ LightWeightTextSetter()

void Aspose::Pdf::Text::TextFragment::LightWeightTextSetter ( System::String  inText,
TextFragment::SegmentAdjustmentMethod  adjustmentMethod = Aspose::Pdf::Text::TextFragment::SegmentAdjustmentMethod::NoAdjustment 
)
protected

Set text internally without paragraph recalculation.

It is useful for cases of small changes like changing font size.

Parameters
inTextString representing new text value.
adjustmentMethodMethod for adjusting position of the text segment directly after current fragment.

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [1/2]

Aspose::Pdf::Text::TextFragment::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( TextFragment  ,
CODEPORTING_ARGS(System::String text, System::SharedPtr< TextSegmentCollection > segments)   
)
protected

◆ MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION() [2/2]

Aspose::Pdf::Text::TextFragment::MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION ( TextFragment  ,
CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter > segmenter, System::String text, System::SharedPtr< TextSegmentCollection > segments)   
)
protected

◆ ResetTabstops()

void Aspose::Pdf::Text::TextFragment::ResetTabstops ( )
protected

◆ Serialize()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::Serialize ( System::SharedPtr< System::Xml::XmlTextWriter writer)
overrideprotectedvirtual

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ set_AttachedState()

void Aspose::Pdf::Text::TextFragment::set_AttachedState ( Aspose::Pdf::Text::TextState::AttachState  value)
protected

◆ set_BaselinePosition()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_BaselinePosition ( System::SharedPtr< Aspose::Pdf::Text::Position value)

Gets text position for text, represented with TextFragment object. The YIndent of the Position structure represents baseline coordinate of the text fragment.

◆ set_EndNote()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_EndNote ( System::SharedPtr< Note value)

Sets the paragraph end note.(for pdf generation only)

◆ set_FootNote()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_FootNote ( System::SharedPtr< Note value)

Sets the paragraph foot note.(for pdf generation only)

◆ set_Fragments()

void Aspose::Pdf::Text::TextFragment::set_Fragments ( System::SharedPtr< TextFragmentCollection value)
protected

Sets collection that contains current fragment

◆ set_HorizontalAlignment()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_HorizontalAlignment ( Aspose::Pdf::HorizontalAlignment  value)
overridevirtual

Sets a horizontal alignment of text fragment.

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ set_Hyperlink()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_Hyperlink ( System::SharedPtr< Aspose::Pdf::Hyperlink value)
overridevirtual

Sets the fragment hyperlink

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ set_Page()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_Page ( System::SharedPtr< Aspose::Pdf::Page value)
protected

Gets page that contains the TextFragment

The value can be null in case the TextFragment object doesn't belong to any page.

◆ set_Position()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_Position ( System::SharedPtr< Aspose::Pdf::Text::Position value)

Sets text position for text, represented with TextFragment object.

See also
TextFragmentAbsorber
See also
Document
See also
TextSegment

◆ set_Rectangle()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_Rectangle ( System::SharedPtr< Aspose::Pdf::Rectangle value)
protected

Gets rectangle of the TextFragment

◆ set_ReplaceOptions()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_ReplaceOptions ( System::SharedPtr< TextReplaceOptions value)
protected

Gets text replace options. The options define behavior when fragment text is replaced to more short/long.

◆ set_Segments()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_Segments ( System::SharedPtr< TextSegmentCollection value)

Gets text segments for current TextFragment.

In a few words, TextSegment objects are children of TextFragment object. Advanced users may access segments directly to perform more complex text edit scenarios. For details, please look at TextFragment object description.

See also
TextFragmentAbsorber
See also
Document
See also
TextSegment

◆ set_SegmentsGroupState()

void Aspose::Pdf::Text::TextFragment::set_SegmentsGroupState ( System::SharedPtr< Aspose::Pdf::Engine::CommonData::Text::Segmenting::SegmentsGroupState >  value)
protected

◆ set_Text()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_Text ( System::String  value)

Sets System::String text object that the TextFragment object represents.

See also
TextFragmentAbsorber
See also
Document

◆ set_TextState()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_TextState ( System::SharedPtr< TextFragmentState value)
protected

Sets text state for the text that TextFragment object represents.

Provides a way to change following properties of the text: Font FontSize FontStyle ForegroundColor BackgroundColor

See also
TextFragmentAbsorber
See also
Document

◆ set_VerticalAlignment()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_VerticalAlignment ( Aspose::Pdf::VerticalAlignment  value)
overridevirtual

Sets a vertical alignment of text fragment.

Reimplemented from Aspose::Pdf::BaseParagraph.

◆ set_WrapLinesCount()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Text::TextFragment::set_WrapLinesCount ( int32_t  value)

Sets wrap lines count for this paragraph(for pdf generation only)

◆ SetEncodedTextProperties()

void Aspose::Pdf::Text::TextFragment::SetEncodedTextProperties ( System::SharedPtr< Font font,
System::String  text,
System::ArrayPtr< int32_t >  indices 
)
protected

Sets font and indices inside the font

Parameters
fontFont of the fragment.
textText value.
indicesGlyph indices inside the font.

◆ SetMarkedContentProperties()

void Aspose::Pdf::Text::TextFragment::SetMarkedContentProperties ( System::String  name,
int32_t  id 
)
protected

◆ SyncHorizontalAlignment()

void Aspose::Pdf::Text::TextFragment::SyncHorizontalAlignment ( Aspose::Pdf::HorizontalAlignment  horizontalAlignment1)
protected

◆ SyncVerticalAlignment()

void Aspose::Pdf::Text::TextFragment::SyncVerticalAlignment ( Aspose::Pdf::VerticalAlignment  verticalAlignment)
protected

Member Data Documentation

◆ OnRectChanged

System::EventHandler Aspose::Pdf::Text::TextFragment::OnRectChanged
protected