Class: Shape

Core.PDFNet. Shape


new Shape()

A shape content element that can be inserted into a paragraph. Shapes support geometry, rotation, fill/outline styling, optional background image, and an internal text box content container.

Extends

Members


<static> Type

Properties:
Name Type Description
e_line number
e_line_arrow number
e_line_double_arrow number
e_rectangle number
e_rectangle_rounded_corners number
e_oval number
e_arrow number

Methods


asChart()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Chart"
Type
Promise.<Core.PDFNet.Chart>

asContentNode()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.ContentNode"
Type
Promise.<Core.PDFNet.ContentNode>

asFloat()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Float"
Type
Promise.<Core.PDFNet.Float>

asList()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.List"
Type
Promise.<Core.PDFNet.List>

asListItem()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.ListItem"
Type
Promise.<Core.PDFNet.ListItem>

asPageNumber()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.PageNumber"
Type
Promise.<Core.PDFNet.PageNumber>

asParagraph()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Paragraph"
Type
Promise.<Core.PDFNet.Paragraph>

asShape()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Shape"
Type
Promise.<Core.PDFNet.Shape>

asTable()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.Table"
Type
Promise.<Core.PDFNet.Table>

asTableCell()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.TableCell"
Type
Promise.<Core.PDFNet.TableCell>

asTableRow()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.TableRow"
Type
Promise.<Core.PDFNet.TableRow>

asTextRun()

Inherited From:
Returns:
A promise that resolves to an object of type: "PDFNet.TextRun"
Type
Promise.<Core.PDFNet.TextRun>

getArrowHeadSize()

Get arrow head size in points.
Returns:
A promise that resolves to the arrow head size in points.
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.<Core.PDFNet.Iterator.<Core.PDFNet.ContentElement>>

getCornerRadius()

Get rounded rectangle corner radius in points.
Returns:
A promise that resolves to the corner radius in points.
Type
Promise.<number>

getFlipHorizontal()

Get the shape horizontal flip state.
Returns:
A promise that resolves to true if the shape is horizontally flipped.
Type
Promise.<boolean>

getFlipVertical()

Get the shape vertical flip state.
Returns:
A promise that resolves to true if the shape is vertically flipped.
Type
Promise.<boolean>

getHeight()

Get the shape height in points.
Returns:
A promise that resolves to the shape height in points.
Type
Promise.<number>

getOutlineThickness()

Get the shape outline thickness in points.
Returns:
A promise that resolves to the outline thickness in points.
Type
Promise.<number>

getRotation()

Get the shape rotation angle in degrees.
Returns:
A promise that resolves to the rotation angle in degrees.
Type
Promise.<number>

getTextBox()

Get the shape text box content container.
Returns:
A promise that resolves to the shape text box content container.
Type
Promise.<Core.PDFNet.ContentContainer>

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.<Core.PDFNet.TextStyledElement>

getType()

Gets the shape type.
Returns:
A promise that resolves to the shape type.
Type
Promise.<number>
Example
Return value enum:
<pre>
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
}
</pre>

getWidth()

Get the shape width in points.
Returns:
A promise that resolves to the shape width in points.
Type
Promise.<number>

setArrowHeadSize(size)

Set arrow head size in points. Applies to arrow shapes.
Parameters:
Name Type Description
size number The arrow head size in points.
Returns:
Type
Promise.<void>

setBackgroundColor(r, g, b)

Set the shape background color.
Parameters:
Name Type Description
r number The red component [0..255].
g number The green component [0..255].
b number The blue component [0..255].
Returns:
Type
Promise.<void>

setBackgroundImageFilter(filter)

Set the shape background image from a filter.
Parameters:
Name Type Description
filter Core.PDFNet.Filter The image filter.
Returns:
Type
Promise.<void>

setCornerRadius(radius)

Set rounded rectangle corner radius in points.
Parameters:
Name Type Description
radius number The corner radius in points.
Returns:
Type
Promise.<void>

setFlipHorizontal(value)

Set the shape horizontal flip.
Parameters:
Name Type Description
value boolean True to flip the shape horizontally.
Returns:
Type
Promise.<void>

setFlipVertical(value)

Set the shape vertical flip.
Parameters:
Name Type Description
value boolean True to flip the shape vertically.
Returns:
Type
Promise.<void>

setHeight(height)

Set the shape height in points.
Parameters:
Name Type Description
height number The shape height in points.
Returns:
Type
Promise.<void>

setOutlineColor(r, g, b)

Set the shape outline color.
Parameters:
Name Type Description
r number The red component [0..255].
g number The green component [0..255].
b number The blue component [0..255].
Returns:
Type
Promise.<void>

setOutlineThickness(thickness)

Set the shape outline thickness in points.
Parameters:
Name Type Description
thickness number The outline thickness in points.
Returns:
Type
Promise.<void>

setRotation(angle)

Set the shape rotation angle in degrees.
Parameters:
Name Type Description
angle number The rotation angle in degrees.
Returns:
Type
Promise.<void>

setType(type)

Sets the shape type.
Parameters:
Name Type Description
type number
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.
Returns:
Type
Promise.<void>

setWidth(width)

Set the shape width in points.
Parameters:
Name Type Description
width number The shape width in points.
Returns:
Type
Promise.<void>