new PdfSection()
A PdfSection is an object defining a group of pages within a Pdf that all share the same page style. To make a new PdfSection, call 'addSection' on the Pdf you wish to add the section to. [NON-INSTANTIABLE]
MEMBERS
-
backgroundImage :PdfImage
-
The path of the backgroundImage within this PdfSection.
- Default Value:
- undefined
-
bottomMargin :number
-
The size of the bottom margin of the pages within this PdfSection.
- Default Value:
- 150
-
footer :PdfFooter
-
The footer element for this PdfSection.
-
header :PdfHeader
-
The header element for this PdfSection.
-
inheritedTypes :object
-
Dictionary object listing all of the types this object is compatible with.
-
leftMargin :number
-
The size of the left margin of the pages within this PdfSection.
- Default Value:
- 150
-
pageHeight :number
-
The height of the pages within this PdfSection.
- Default Value:
- 3300
-
pageWidth :number
-
The width of the pages within this PdfSection.
- Default Value:
- 2550
-
rightMargin :number
-
The size of the right margin of the pages within this PdfSection.
- Default Value:
- 150
-
topMargin :number
-
The size of the top margin of the pages within this PdfSection.
- Default Value:
- 150
-
type :string
-
Type identifier.
METHODS
-
addBackgroundImage(imagePath, isPathRelative (opt), justificationH (opt), justificationV (opt))
-
Adds a background image to this PdfSection.
Parameters:
Name Type Attributes Default Description imagePath
string The path of the background image being added within this PdfSection.
isPathRelative
boolean <optional>
Bool stating if the given path is relative to the project path or an absolute path. If an absolute path is used that is outside of the project directory, the 'allowUniversalFileIO' item in application settings must be set to true. [DEFAULT: true]
justificationH
string <optional>
The horizontal justification of the background image being added to this PdfSection. For acceptable values, see 'nc.constants.justfications'. [DEFAULT: "center"]
justificationV
string <optional>
The vertical justification of the background image being added to this PdfSection. For acceptable values, see 'nc.constants.justfications'. [DEFAULT: "center"]
-
addImage(imagePath, isPathRelative (opt), justificationH (opt), justificationV (opt)) returns {PdfImage}
-
Adds a new Image to this PdfSection and returns it.
Parameters:
Name Type Attributes Default Description imagePath
string The path of the image being added within this PdfSection.
isPathRelative
boolean <optional>
Bool stating if the given path is relative to the project path or an absolute path. If an absolute path is used that is outside of the project directory, the 'allowUniversalFileIO' item in application settings must be set to true. [DEFAULT: true]
justificationH
string <optional>
The horizontal justification of the image being added to this PdfSection. For acceptable values, see 'nc.constants.justfications'. [DEFAULT: "center"]
justificationV
string <optional>
The vertical justification of the image being added to this PdfSection. For acceptable values, see 'nc.constants.justfications'. [DEFAULT: "center"]
Returns:
PdfImage -
addPageBreak()
-
Adds a page break after this PdfSection.
-
addParagraph() returns {PdfParagraph}
-
Adds a new PdfParagraph to this PdfSection and returns it. A PdfParagraph is simply a block of text.
Returns:
PdfParagraph -
addTable(numRows, numCols, columnWidths) returns {PdfTable}
-
Adds a new PdfTable to this PdfSection and returns it.
Parameters:
Name Type Attributes Default Description numRows
number The number of rows to add to this PdfTable.
numCols
number The number of columns to add to each PdfRow in this PdfTable.
columnWidths
Array.<number> | number An array containing the desired widths for each column in this PdfTable.
Returns:
PdfTable -
addTextFrame(width, height) returns {PdfTextFrame}
-
Adds a new PdfTextFrame to this PdfSection and returns it.
Parameters:
Name Type Attributes Default Description width
number The width of the PdfTextFrame being added.
height
number The height of the PdfTextFrame being added.
Returns:
PdfTextFrame -
setMargins(margin)
-
Sets all the margins of this PdfSection to a specified value.
Parameters:
Name Type Attributes Default Description margin
number Value to set all margins on this PdfSection to.