Table of Contents

Class Paragraph

Namespace
PDFjet.NET
Assembly
PDFjet.dll

Used to create paragraph objects. See the TextColumn class for more information.

public class Paragraph
Inheritance
Paragraph
Inherited Members

Constructors

Paragraph()

Constructor for creating paragraph objects.

public Paragraph()

Paragraph(TextLine)

Creates a paragraph with the specified text line.

public Paragraph(TextLine text)

Parameters

text TextLine

Methods

Add(TextLine)

Adds a text line to this paragraph.

public Paragraph Add(TextLine text)

Parameters

text TextLine

the text line to add to this paragraph.

Returns

Paragraph

this paragraph.

AddJoined(TextLine)

Adds a text line that goes on from the text before it with no space between them, so that a word can change its font or its color partway through: a word in bold followed by a comma in the regular font, or a link that ends before the period after it. A row of text does not break between the two. When the text line starts with a space, or the text before it ends with one, the two are apart as they are with Add. Text in Chinese, Japanese or Korean is not joined.

public Paragraph AddJoined(TextLine text)

Parameters

text TextLine

the text line to add to this paragraph.

Returns

Paragraph

this paragraph.

GetTextLines()

Returns the text lines of this paragraph.

public List<TextLine> GetTextLines()

Returns

List<TextLine>

GetTextX()

Returns the x coordinate where the text of this paragraph starts, once a TextFrame or TextColumn has drawn it.

public float GetTextX()

Returns

float

GetTextY()

Returns the baseline y coordinate of the first line of this paragraph, once a TextFrame or TextColumn has drawn it.

public float GetTextY()

Returns

float

GetX1()

Returns the x coordinate of the top left corner of this paragraph, once a TextFrame or TextColumn has drawn it.

public float GetX1()

Returns

float

GetX2()

Returns the x coordinate where the last line of this paragraph ends, once a TextFrame or TextColumn has drawn it.

public float GetX2()

Returns

float

GetY1()

Returns the y coordinate of the top left corner of this paragraph, once a TextFrame or TextColumn has drawn it.

public float GetY1()

Returns

float

GetY2()

Returns the y coordinate of the bottom of the last line of this paragraph, once a TextFrame or TextColumn has drawn it.

public float GetY2()

Returns

float

ParagraphsFromFile(Font, string)

Reads a text file and returns its paragraphs. An empty line separates the paragraphs.

public static List<Paragraph> ParagraphsFromFile(Font f1, string filePath)

Parameters

f1 Font
filePath string

Returns

List<Paragraph>

SetHighlightColors(Dictionary<string, int>)

Sets the word highlight colors of all lines in this paragraph.

public Paragraph SetHighlightColors(Dictionary<string, int> colorMap)

Parameters

colorMap Dictionary<string, int>

Returns

Paragraph

SetListLabel(TextLine, float)

Makes this paragraph an item of a list, labelled by the text line, which is drawn indent points to the left of the text of the paragraph and on the baseline of its first line. A run of paragraphs that have a label is a list: in a PDF/UA document it is an L of an LI for each paragraph, each holding the Lbl of its label and the LBody of its text, so that a reader reads the label of an item before the item, however the two are drawn.

public Paragraph SetListLabel(TextLine label, float indent)

Parameters

label TextLine
indent float

Returns

Paragraph

SetStructureType(StructElem)

Sets the structure element type of this paragraph, for a PDF/UA document: StructElem.H1 to StructElem.H6 for a heading, and StructElem.P, which it is, for a paragraph. The paragraph is one element however many lines and words it is drawn in.

public Paragraph SetStructureType(StructElem structureType)

Parameters

structureType StructElem

Returns

Paragraph

SetTextAlignment(Alignment)

Sets the alignment of the text in this paragraph. A paragraph with no alignment set takes the alignment of the text column it is drawn in.

public Paragraph SetTextAlignment(Alignment alignment)

Parameters

alignment Alignment

the alignment code: Alignment.LEFT, Alignment.RIGHT, Alignment.CENTER or Alignment.JUSTIFY.

Returns

Paragraph

this paragraph.

SetTextColor(int)

Sets the text color of all lines in this paragraph as a 0xRRGGBB value. Color.transparent leaves it unchanged.

public Paragraph SetTextColor(int color)

Parameters

color int

Returns

Paragraph

SetTextColor(float[])

Sets the text color of all lines in this paragraph.

public Paragraph SetTextColor(float[] rgbColor)

Parameters

rgbColor float[]

the color as red, green and blue components from 0.0 to 1.0.

Returns

Paragraph

this Paragraph object.

StartsWith(string)

Returns true if the first line of this paragraph starts with the specified token.

public bool StartsWith(string token)

Parameters

token string

Returns

bool