Class: Section

Core.PDFNet. Section


new Section()

A Section is a content container representing a group of consecutive pages of a FlowDocument that share the same headers and footers.

A FlowDocument always contains at least one section. Content added directly to the FlowDocument is added to the current (last) section.

Extends

Members


<static> PageGroup

Properties:
Name Type Description
e_first_page number
e_even_pages number
e_odd_pages number

Methods


addList()

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

addParagraph()

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

addParagraphWithText(text)

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

addTable()

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

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>

getBottomMargin()

Get the bottom margin used by this section.
Returns:
A promise that resolves to the bottom margin 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>>

getFooter(pages)

Parameters:
Name Type Description
pages number
PDFNet.Section.PageGroup = {
	e_first_page : 1
	e_even_pages : 2
	e_odd_pages : 3
}
Returns:
A promise that resolves to an object of type: "PDFNet.ContentContainer"
Type
Promise.<Core.PDFNet.ContentContainer>

getHeader(pages)

Parameters:
Name Type Description
pages number
PDFNet.Section.PageGroup = {
	e_first_page : 1
	e_even_pages : 2
	e_odd_pages : 3
}
Returns:
A promise that resolves to an object of type: "PDFNet.ContentContainer"
Type
Promise.<Core.PDFNet.ContentContainer>

getLeftMargin()

Get the left margin used by this section.
Returns:
A promise that resolves to the left margin in points.
Type
Promise.<number>

getOrCreateFooter(pages)

Retrieve the footer of the section for the given page group, creating an empty one if it does not exist yet.

The content of an already existing footer is preserved.

Parameters:
Name Type Description
pages number
PDFNet.Section.PageGroup = {
	e_first_page : 1
	e_even_pages : 2
	e_odd_pages : 3
}
The group of pages the footer applies to.
Returns:
A promise that resolves to the footer content container.
Type
Promise.<Core.PDFNet.ContentContainer>

getOrCreateHeader(pages)

Retrieve the header of the section for the given page group, creating an empty one if it does not exist yet.

The content of an already existing header is preserved.

Parameters:
Name Type Description
pages number
PDFNet.Section.PageGroup = {
	e_first_page : 1
	e_even_pages : 2
	e_odd_pages : 3
}
The group of pages the header applies to.
Returns:
A promise that resolves to the header content container.
Type
Promise.<Core.PDFNet.ContentContainer>

getPageHeight()

Get the page height used by this section.
Returns:
A promise that resolves to the page height in points.
Type
Promise.<number>

getPageWidth()

Get the page width used by this section.
Returns:
A promise that resolves to the page width in points.
Type
Promise.<number>

getRightMargin()

Get the right margin used by this section.
Returns:
A promise that resolves to the right margin in points.
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.<Core.PDFNet.TextStyledElement>

getTopMargin()

Get the top margin used by this section.
Returns:
A promise that resolves to the top margin in points.
Type
Promise.<number>

removeFooter(pages)

Remove the footer of the section for the given page group.

Does nothing if no such footer exists.

Parameters:
Name Type Description
pages number
PDFNet.Section.PageGroup = {
	e_first_page : 1
	e_even_pages : 2
	e_odd_pages : 3
}
The group of pages the footer applies to.
Returns:
Type
Promise.<void>

removeHeader(pages)

Remove the header of the section for the given page group.

Does nothing if no such header exists.

Parameters:
Name Type Description
pages number
PDFNet.Section.PageGroup = {
	e_first_page : 1
	e_even_pages : 2
	e_odd_pages : 3
}
The group of pages the header applies to.
Returns:
Type
Promise.<void>

setMargins(left, top, right, bottom)

Set the margins for the pages of this section, overriding the document default margins.
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>

setPageSize(width, height)

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