new Paragraph()
A Paragraph is a content node that contains a list of TextRun objects.
Extends
Members
-
<static> TextJustification
-
Type:
- number
Properties:
Name Type Description e_text_justification_invalidnumber e_text_justify_leftnumber e_text_justify_rightnumber e_text_justify_centernumber
Methods
-
addChart(width, height, definition)
-
Add a chart to the paragraph.
Parameters:
Name Type Description widthnumber The chart width in points. heightnumber The chart height in points. definitionstring A JSON string describing the chart contents. Returns:
A promise that resolves to the newly created Chart object.- Type
- Promise.<PDFNet.Chart>
-
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:
A promise that resolves to the newly created Float object.- Type
- Promise.<PDFNet.Float>
-
addHyperlink(text, target)
-
Add a hyperlink text run to the paragraph.
Parameters:
Name Type Description textstring The visible hyperlink text. targetstring The hyperlink target. Returns:
A promise that resolves to an object of type: "TextRun"- Type
- Promise.<PDFNet.TextRun>
-
addImage(width, height, image_path)
-
Add an image shape to the paragraph using a file path.
Parameters:
Name Type Description widthnumber The image width in points. heightnumber The image height in points. image_pathstring The image file path. Returns:
A promise that resolves to an object of type: "PDFNet.Shape"- Type
- Promise.<PDFNet.Shape>
-
addImageWithFilter(width, height, image_filter)
-
Add an image shape to the paragraph using a filter.
Parameters:
Name Type Description widthnumber The image width in points. heightnumber The image height in points. image_filterPDFNet.Filter The image filter. Returns:
A promise that resolves to an object of type: "Shape"- Type
- Promise.<PDFNet.Shape>
-
addPageNumber(type)
-
Add a page number to the paragraph
Parameters:
Name Type Description typenumber PDFNet.PageNumber.NumberType = { e_current_page : 1 e_total_pages : 2 }The type of page number to add (current page or total pages)Returns:
A promise that resolves to the newly created PageNumber object- Type
- Promise.<PDFNet.PageNumber>
-
addShape(type, width, height)
-
Add a shape to the paragraph.
Parameters:
Name Type Description typenumber PDFNet.Shape.Type = { e_line : 1 e_line_arrow : 2 e_line_double_arrow : 3 e_rectangle : 4 e_rectangle_rounded_corners : 5 e_oval : 6 e_arrow : 7 }The shape type.widthnumber The shape width in points. heightnumber The shape height in points. Returns:
A promise that resolves to the newly created Shape object.- Type
- Promise.<PDFNet.Shape>
-
addTabStop(val)
-
Adds a tab stop to the paragraph style.
Parameters:
Name Type Description valnumber The position of the tab stop to add. Returns:
- Type
- Promise.<void>
-
addText(text)
-
Add another text run to the paragraph
Parameters:
Name Type Description textstring The text to add Returns:
A promise that resolves to the newly created TextRun object- Type
- Promise.<PDFNet.TextRun>
-
asChart()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Chart"- Type
- Promise.<PDFNet.Chart>
-
asContentNode()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.ContentNode"- Type
- Promise.<PDFNet.ContentNode>
-
asFloat()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Float"- Type
- Promise.<PDFNet.Float>
-
asList()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.List"- Type
- Promise.<PDFNet.List>
-
asListItem()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.ListItem"- Type
- Promise.<PDFNet.ListItem>
-
asPageNumber()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.PageNumber"- Type
- Promise.<PDFNet.PageNumber>
-
asParagraph()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Paragraph"- Type
- Promise.<PDFNet.Paragraph>
-
asShape()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Shape"- Type
- Promise.<PDFNet.Shape>
-
asTable()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Table"- Type
- Promise.<PDFNet.Table>
-
asTableCell()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.TableCell"- Type
- Promise.<PDFNet.TableCell>
-
asTableRow()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.TableRow"- Type
- Promise.<PDFNet.TableRow>
-
asTextRun()
-
- Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.TextRun"- Type
- Promise.<PDFNet.TextRun>
-
getBorderThickness()
-
Gets the border thickness for the paragraph style.
Returns:
A promise that resolves to the border thickness for the paragraph style.- Type
- Promise.<number>
-
getContentNodeIterator()
-
Retrieve a ContentElementIterator object from the content node
The ContentElementIterator object can be used to traverse the children of the content node.
- Inherited From:
Returns:
A promise that resolves to the ContentElementIterator object- Type
- Promise.<PDFNet.Iterator.<PDFNet.ContentElement>>
-
getDefaultTabStop()
-
Gets the default tab stop position for the paragraph style.
Returns:
A promise that resolves to the default tab stop position for the paragraph style.- Type
- Promise.<number>
-
getEndIndent()
-
Gets the end indent for the paragraph style.
Returns:
A promise that resolves to the end indent value for the paragraph style.- Type
- Promise.<number>
-
getJustificationMode()
-
Get justification mode for the paragraph
Returns:
A promise that resolves to justification mode for paragraph style- Type
- Promise.<number>
Example
Return value enum: <pre> PDFNet.Paragraph.TextJustification = { e_text_justification_invalid : 0 e_text_justify_left : 1 e_text_justify_right : 2 e_text_justify_center : 3 } </pre> -
getNextTabStop(val)
-
Gets the next tab stop position for the paragraph style, given a starting position.
Parameters:
Name Type Description valnumber The starting position. Returns:
A promise that resolves to the position of the next tab stop.- Type
- Promise.<number>
-
getSpaceAfter()
-
Get the "space after" value for the paragraph style
Returns:
A promise that resolves to "space after" value for paragraph style- Type
- Promise.<number>
-
getSpaceBefore()
-
Get the "space before" value for the paragraph style
Returns:
A promise that resolves to "space before" value for paragraph style- Type
- Promise.<number>
-
getSpacesPerTab()
-
Gets the number of spaces per tab for the paragraph style.
Returns:
A promise that resolves to the number of spaces per tab for the paragraph style.- Type
- Promise.<number>
-
getStartIndent()
-
Gets the start indent for the paragraph style.
Returns:
A promise that resolves to the start indent value for the paragraph style.- Type
- Promise.<number>
-
getTextIndent()
-
Gets the text indent for the paragraph style.
Returns:
A promise that resolves to the text indent value for the paragraph style.- Type
- Promise.<number>
-
getTextStyledElement()
-
Retrieve the TextStyledElement object for manipulating the text style of this content element.
- Inherited From:
Returns:
A promise that resolves to the TextStyledElement object- Type
- Promise.<PDFNet.TextStyledElement>
-
isDisplayRtl()
-
Checks if the paragraph style has the right-to-left (RTL) property set.
Returns:
A promise that resolves to true if the display is RTL, false otherwise.- Type
- Promise.<boolean>
-
setBorder(thickness, red, green, blue)
-
Sets the border for the paragraph style.
Parameters:
Name Type Description thicknessnumber The border thickness. rednumber The red component of the border color. greennumber The green component of the border color. bluenumber The blue component of the border color. Returns:
- Type
- Promise.<void>
-
setDefaultTabStop(val)
-
Sets the default tab stop position for the paragraph style.
Parameters:
Name Type Description valnumber The default tab stop position to set. Returns:
- Type
- Promise.<void>
-
setDisplayRtl(val)
-
Sets the right-to-left (RTL) property for the paragraph style.
Parameters:
Name Type Description valboolean The value to set. True if RTL, false if not. Returns:
- Type
- Promise.<void>
-
setEndIndent(val)
-
Sets the end indent for the paragraph style.
Parameters:
Name Type Description valnumber The end indent value to set. Returns:
- Type
- Promise.<void>
-
setJustificationMode(val)
-
Set justification mode for paragraph style
Parameters:
Name Type Description valnumber PDFNet.Paragraph.TextJustification = { e_text_justification_invalid : 0 e_text_justify_left : 1 e_text_justify_right : 2 e_text_justify_center : 3 }The justification mode to setReturns:
- Type
- Promise.<void>
-
setSpaceAfter(val)
-
Set the "space after" value for paragraph style
Parameters:
Name Type Description valnumber The "space after" value to set Returns:
- Type
- Promise.<void>
-
setSpaceBefore(val)
-
Set the "space before" value for the paragraph style
Parameters:
Name Type Description valnumber The "space before" value to set Returns:
- Type
- Promise.<void>
-
setSpacesPerTab(val)
-
Sets the number of spaces per tab for the paragraph style.
Parameters:
Name Type Description valnumber The number of spaces per tab to set. Returns:
- Type
- Promise.<void>
-
setStartIndent(val)
-
Sets the start indent for the paragraph style.
Parameters:
Name Type Description valnumber The start indent value to set. Returns:
- Type
- Promise.<void>
-
setTextIndent(val)
-
Sets the text indent for the paragraph style.
Parameters:
Name Type Description valnumber The text indent value to set. Returns:
- Type
- Promise.<void>