new FlowDocument()
The class FlowDocument.
Encapsulates document creation API.
Extends
Methods
-
<static> create()
-
A constructor. Creates an empty document containing a single section.
Returns:
A promise that resolves to an object of type: "PDFNet.FlowDocument"- Type
- Promise.<Core.PDFNet.FlowDocument>
-
addSection()
-
Add a new section at the end of the document and make it the current section.
Content added directly to the FlowDocument afterwards is added to the newly created section.
Returns:
A promise that resolves to the newly created Section object.- Type
- Promise.<Core.PDFNet.Section>
-
destroy()
-
Destructor
- Inherited From:
Returns:
- Type
- Promise.<void>
-
getContentContainer()
-
Returns:
A promise that resolves to an object of type: "PDFNet.ContentContainer"- Type
- Promise.<Core.PDFNet.ContentContainer>
-
getCurrentSection()
-
Get the current section, i.e. the section that content added directly to the FlowDocument goes into.
Returns:
A promise that resolves to the current Section object.- Type
- Promise.<Core.PDFNet.Section>
-
getNumSections()
-
Get the number of sections in the document.
Returns:
A promise that resolves to the number of sections.- Type
- Promise.<number>
-
getSection(index)
-
Get a section of the document by index.
Parameters:
Name Type Description indexnumber The zero based index of the section. Returns:
A promise that resolves to the Section object at the given index.- Type
- Promise.<Core.PDFNet.Section>
-
paginateToPDF()
-
Paginates the content tree into a PDFDoc object.
Returns:
A promise that resolves to the PDFDoc object- Type
- Promise.<Core.PDFNet.PDFDoc>
-
setDefaultMargins(left, top, right, bottom)
-
Set the default margins for the document.
Parameters:
Name Type Description leftnumber The left margin in points topnumber The top margin in points rightnumber The right margin in points bottomnumber The bottom margin in points Returns:
- Type
- Promise.<void>
-
setDefaultPageSize(width, height)
-
Set the default page size for the document.
Parameters:
Name Type Description widthnumber The width in points heightnumber 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