Class: FlowDocument

PDFNet. FlowDocument


new FlowDocument()

The class FlowDocument. Encapsulates document creation API.

Extends

Methods


<static> create()

A constructor. Creates an empty document.
Returns:
A promise that resolves to an object of type: "PDFNet.FlowDocument"
Type
Promise.<PDFNet.FlowDocument>

addList()

Adds a list to the document.
Returns:
A promise that resolves to the list object
Type
Promise.<PDFNet.List>

addParagraph()

Adds a paragraph to the document.
Returns:
A promise that resolves to the paragraph object
Type
Promise.<PDFNet.Paragraph>

addParagraphWithText(text)

Adds a paragraph to the document and sets the text.
Parameters:
Name Type Description
text string
Returns:
A promise that resolves to the paragraph object
Type
Promise.<PDFNet.Paragraph>

addTable()

Adds a table to the document.
Returns:
A promise that resolves to the table object
Type
Promise.<PDFNet.Table>

destroy()

Destructor
Inherited From:
Returns:
Type
Promise.<void>

getBody()

Gets the body of the document.

The body is the root of the content tree. It can be used to traverse the content tree via the ContentNodeIterator object.

Returns:
A promise that resolves to the body of the document
Type
Promise.<PDFNet.ContentNode>

paginateToPDF()

Paginates the content tree into a PDFDoc object.
Returns:
A promise that resolves to the PDFDoc object
Type
Promise.<PDFNet.PDFDoc>

setDefaultMargins(left, top, right, bottom)

Set the default margins for the document.
Parameters:
Name Type Description
left number The left margin in points
top number The top margin in points
right number The right margin in points
bottom number The bottom margin in points
Returns:
Type
Promise.<void>

setDefaultPageSize(width, height)

Set the default page size for the document.
Parameters:
Name Type Description
width number The width in points
height number The height in points
Returns:
Type
Promise.<void>

takeOwnership()

Take the ownership of this object, so that PDFNet.runWithCleanup won't destroy this object.
Inherited From:
Returns:
Type
void