All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::Layout::Paragraph Class Reference

#include <ContentTree.h>

+ Inheritance diagram for pdftron::Layout::Paragraph:

Public Types

enum  TextJustification { e_text_justification_invalid = 0, e_text_justify_left = 1, e_text_justify_right = 2, e_text_justify_center = 3 }
 

Public Member Functions

 ~Paragraph ()
 
void Destroy ()
 
TextRun AddText (const UString &text)
 
TextRun AddHyperlink (const UString &text, const UString &target)
 
PageNumber AddPageNumber (PageNumber::NumberType type)
 
Shape AddShape (Shape::ShapeType type, double width, double height)
 
Shape AddImage (double width, double height, const UString &image_path)
 
Shape AddImage (double width, double height, const Filters::Filter &image_filter)
 
Chart AddChart (double width, double height, const UString &definition)
 
Float AddFloat ()
 
void SetSpaceBefore (double val)
 
double GetSpaceBefore ()
 
void SetSpaceAfter (double val)
 
double GetSpaceAfter ()
 
void SetJustificationMode (TextJustification val)
 
TextJustification GetJustificationMode ()
 
void SetStartIndent (double val)
 
double GetStartIndent ()
 
void SetEndIndent (double val)
 
double GetEndIndent ()
 
void SetTextIndent (double val)
 
double GetTextIndent ()
 
void SetBorder (double thickness, UInt8 red, UInt8 green, UInt8 blue)
 
double GetBorderThickness ()
 
void AddTabStop (double val)
 
double GetNextTabStop (double val)
 
void SetDefaultTabStop (double val)
 
double GetDefaultTabStop ()
 
void SetSpacesPerTab (UInt32 val)
 
UInt32 GetSpacesPerTab ()
 
void SetDisplayRtl (bool val)
 
bool IsDisplayRtl ()
 
- Public Member Functions inherited from pdftron::Layout::ContentNode
 ~ContentNode ()
 
void Destroy ()
 
ContentNodeIterator GetContentNodeIterator ()
 
- Public Member Functions inherited from pdftron::Layout::ContentElement
 ~ContentElement ()
 
void Destroy ()
 
ElementRef< List > AsList () const
 
ElementRef< ListItem > AsListItem () const
 
ElementRef< ContentNode > AsContentNode () const
 
ElementRef< TextRun > AsTextRun () const
 
ElementRef< PageNumber > AsPageNumber () const
 
ElementRef< Shape > AsShape () const
 
ElementRef< Float > AsFloat () const
 
ElementRef< Chart > AsChart () const
 
ElementRef< Paragraph > AsParagraph () const
 
ElementRef< Table > AsTable () const
 
ElementRef< TableRow > AsTableRow () const
 
ElementRef< TableCell > AsTableCell () const
 
TextStyledElement GetTextStyledElement ()
 

Friends

class ContentContainer
 
class ListItem
 
class ElementRef< Paragraph >
 

Additional Inherited Members

- Public Attributes inherited from pdftron::Layout::ContentElement
TRN_ContentElement m_impl
 
- Protected Member Functions inherited from pdftron::Layout::ContentNode
 ContentNode (TRN_ContentNode impl)
 
- Protected Member Functions inherited from pdftron::Layout::ContentElement
 ContentElement (TRN_ContentElement impl)
 

Detailed Description

A Paragraph is a content node that contains a list of TextRun objects.

Definition at line 1097 of file ContentTree.h.

Member Enumeration Documentation

Enumerator
e_text_justification_invalid 

Text justification is invalid

e_text_justify_left 

Text is left justified

e_text_justify_right 

Text is right justified

e_text_justify_center 

Text is justified centered

Definition at line 1106 of file ContentTree.h.

Constructor & Destructor Documentation

pdftron::Layout::Paragraph::~Paragraph ( )

Member Function Documentation

Chart pdftron::Layout::Paragraph::AddChart ( double  width,
double  height,
const UString &  definition 
)

Add a chart to the paragraph.

Parameters
widthThe chart width in points.
heightThe chart height in points.
definitionA JSON string describing the chart contents.
Returns
The newly created Chart object.
Float pdftron::Layout::Paragraph::AddFloat ( )

Add a float to the paragraph.

The content added to the returned Float is taken out of the main document flow and positioned relative to the chosen reference points, with the main document content wrapped around it (depending on the obstruction type).

Returns
The newly created Float object.
TextRun pdftron::Layout::Paragraph::AddHyperlink ( const UString &  text,
const UString &  target 
)

Add a hyperlink text run to the paragraph.

Parameters
textThe visible hyperlink text.
targetThe hyperlink target.
Returns
The newly created TextRun object.
Shape pdftron::Layout::Paragraph::AddImage ( double  width,
double  height,
const UString &  image_path 
)

Add an image shape to the paragraph using a file path.

Internally this calls AddShape() and sets the image as shape background.

Parameters
widthThe image width in points.
heightThe image height in points.
image_pathThe image file path.
Returns
The newly created Shape object.
Shape pdftron::Layout::Paragraph::AddImage ( double  width,
double  height,
const Filters::Filter &  image_filter 
)

Add an image shape to the paragraph using a filter.

Internally this calls AddShape() and sets the image as shape background.

Parameters
widthThe image width in points.
heightThe image height in points.
image_filterThe image filter.
Returns
The newly created Shape object.
PageNumber pdftron::Layout::Paragraph::AddPageNumber ( PageNumber::NumberType  type)

Add a page number to the paragraph

Parameters
typeThe type of page number to add (current page or total pages)
Returns
The newly created PageNumber object
Shape pdftron::Layout::Paragraph::AddShape ( Shape::ShapeType  type,
double  width,
double  height 
)

Add a shape to the paragraph.

Parameters
typeThe shape type.
widthThe shape width in points.
heightThe shape height in points.
Returns
The newly created Shape object.
void pdftron::Layout::Paragraph::AddTabStop ( double  val)

Adds a tab stop to the paragraph style.

Parameters
valThe position of the tab stop to add.
TextRun pdftron::Layout::Paragraph::AddText ( const UString &  text)

Add another text run to the paragraph

Parameters
textThe text to add
Returns
The newly created TextRun object
void pdftron::Layout::Paragraph::Destroy ( )
double pdftron::Layout::Paragraph::GetBorderThickness ( )

Gets the border thickness for the paragraph style.

Returns
The border thickness for the paragraph style.
double pdftron::Layout::Paragraph::GetDefaultTabStop ( )

Gets the default tab stop position for the paragraph style.

Returns
The default tab stop position for the paragraph style.
double pdftron::Layout::Paragraph::GetEndIndent ( )

Gets the end indent for the paragraph style.

Returns
The end indent value for the paragraph style.
TextJustification pdftron::Layout::Paragraph::GetJustificationMode ( )

Get justification mode for the paragraph

Returns
Justification mode for paragraph style
double pdftron::Layout::Paragraph::GetNextTabStop ( double  val)

Gets the next tab stop position for the paragraph style, given a starting position.

Parameters
valThe starting position.
Returns
The position of the next tab stop.
double pdftron::Layout::Paragraph::GetSpaceAfter ( )

Get the "space after" value for the paragraph style

Returns
"space after" value for paragraph style
double pdftron::Layout::Paragraph::GetSpaceBefore ( )

Get the "space before" value for the paragraph style

Returns
"space before" value for paragraph style
UInt32 pdftron::Layout::Paragraph::GetSpacesPerTab ( )

Gets the number of spaces per tab for the paragraph style.

Returns
The number of spaces per tab for the paragraph style.
double pdftron::Layout::Paragraph::GetStartIndent ( )

Gets the start indent for the paragraph style.

Returns
The start indent value for the paragraph style.
double pdftron::Layout::Paragraph::GetTextIndent ( )

Gets the text indent for the paragraph style.

Returns
The text indent value for the paragraph style.
bool pdftron::Layout::Paragraph::IsDisplayRtl ( )

Checks if the paragraph style has the right-to-left (RTL) property set.

Returns
True if the display is RTL, false otherwise.
void pdftron::Layout::Paragraph::SetBorder ( double  thickness,
UInt8  red,
UInt8  green,
UInt8  blue 
)

Sets the border for the paragraph style.

Parameters
thicknessThe border thickness.
redThe red component of the border color.
greenThe green component of the border color.
blueThe blue component of the border color.
void pdftron::Layout::Paragraph::SetDefaultTabStop ( double  val)

Sets the default tab stop position for the paragraph style.

Parameters
valThe default tab stop position to set.
void pdftron::Layout::Paragraph::SetDisplayRtl ( bool  val)

Sets the right-to-left (RTL) property for the paragraph style.

Parameters
valThe value to set. True if RTL, false if not.
void pdftron::Layout::Paragraph::SetEndIndent ( double  val)

Sets the end indent for the paragraph style.

Parameters
valThe end indent value to set.
void pdftron::Layout::Paragraph::SetJustificationMode ( TextJustification  val)

Set justification mode for paragraph style

Parameters
valThe justification mode to set
void pdftron::Layout::Paragraph::SetSpaceAfter ( double  val)

Set the "space after" value for paragraph style

Parameters
valThe "space after" value to set
void pdftron::Layout::Paragraph::SetSpaceBefore ( double  val)

Set the "space before" value for the paragraph style

Parameters
valThe "space before" value to set
void pdftron::Layout::Paragraph::SetSpacesPerTab ( UInt32  val)

Sets the number of spaces per tab for the paragraph style.

Parameters
valThe number of spaces per tab to set.
void pdftron::Layout::Paragraph::SetStartIndent ( double  val)

Sets the start indent for the paragraph style.

Parameters
valThe start indent value to set.
void pdftron::Layout::Paragraph::SetTextIndent ( double  val)

Sets the text indent for the paragraph style.

Parameters
valThe text indent value to set.

Friends And Related Function Documentation

friend class ContentContainer
friend

Definition at line 1099 of file ContentTree.h.

friend class ElementRef< Paragraph >
friend

Definition at line 1101 of file ContentTree.h.

friend class ListItem
friend

Definition at line 1100 of file ContentTree.h.


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