PDFFormattedContent¶
Namespace: O2S.Components.PDF4NET.Graphics.FormattedContent
Defines a piece of formatted content that can be drawn on a page.
Inheritance Object → PDFFormattedContent
Constructors¶
PDFFormattedContent()¶
Initializes a new PDFFormattedContent object.
PDFFormattedContent(String)¶
Initializes a new PDFFormattedContent object with a text paragraph.
Parameters
text String
Paragraph text.
PDFFormattedContent(String, PDFFont)¶
Initializes a new PDFFormattedContent object with a text paragraph.
Parameters
text String
Paragraph text.
font PDFFont
Paragraph font
PDFFormattedContent(PDFFormattedContent)¶
Initializes a new PDFFormattedContent object with another formatted content.
Parameters
source PDFFormattedContent
Source content
Properties¶
Height¶
Gets the height of the formatted content.
Property Value
Double
The height of the formatted content wrapped at a specific width.
Remarks
The PDFFormattedContent.Wrap(Double) method must be called before reading this property. This property can also be read after the formatted content has been drawn on the page.
ParagraphHeights¶
Gets the height of each paragraph in the formatted content.
Property Value
Double[]
The height of each paragraph in the formatted content wrapped at a specific width.
Remarks
The PDFFormattedContent.Wrap(Double) method must be called before reading this property. This property can also be read after the formatted content has been drawn on the page.
Paragraphs¶
Gets the list of paragraphs.
Property Value
PDFFormattedParagraphCollection
The list of paragraphs that compose this formatted piece of content.
StructureElement¶
Gets or sets the structure element.
Property Value
PDFStructureElement
The PDFStructureElement object associated with this formatted content object.
Remarks
When a formatted content object has an associated structure element, the paragraphs within the formatted content should not have their own structure elements otherwise the content will be tagged incorrectly.
Width¶
Gets the width of the formatted content.
Property Value
Double
The actual width of the formatted content after is has been wrapped at a given width.
Remarks
The PDFFormattedContent.Wrap(Double) method must be called before reading this property. This property can also be read after the formatted content has been drawn on the page.
Methods¶
ClearWordWrapState()¶
Clears the internal word wrap state.
Remarks
This method must be called before re-drawing the PDFFormattedContent object if its content has changed.
SplitByBox(Double, Double)¶
Gets the formatted content that fits in the given box.
Parameters
width Double
The box width.
height Double
The box height.
Returns
PDFFormattedContent
The formatted content that fits in the given box.
Remarks
This method modifies the current object, the formatted content that fits the given box is removed from current object and returned as a new object.
SplitByBox(Double, Double, Boolean)¶
Gets the formatted content that fits in the given box.
Parameters
width Double
The box width.
height Double
The box height.
updateParagraphs Boolean
If true, the list of paragraphs is also updated to reflect the split.
Returns
PDFFormattedContent
The formatted content that fits in the given box.
Remarks
This method modifies the current object, the formatted content that fits the given box is removed from current object
and returned as a new object.
If this method is called multiple times but with a different width then the 'updateParagraphs' parameter should be set to true.
ToString()¶
Converts the object to string.
Returns
Wrap(Double)¶
Executes a wrap operation on the formatted content at the specified width.
Parameters
width Double
The width at which the formatted content is wrapped.