addSection
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addSVG
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
addSection

Inserts a new section into the Word document.
Description
public addSection ( string $sectionType [, string $paperType [, array $options ] ] ] )
This method allows the creation of new sections in your Word document.
This option is needed if you wish to change the page properties, for example, from portrait to landscape orientation in part of your Word document.
All content inserted after a call to this method will be incorporated into the new section.
Parameters
sectionType
These parameters determine the kind of break (if any) used. The possible values are:
- nextPage (default value): the new section starts in a new page
- nextColumn: the new section starts in the following column
- continuous: there is no break between sections
- evenPage: the new section starts in the next available even page
- oddPage: the new section starts in the next available odd page
paperType
The type of paper to be used. The possible values are:
- A4
- A3
- letter
- legal
- A4-landscape
- letter-landscape
- legal-landscape
- custom
options
This parameter is only required if the paperType parameter has been set up to custom.
Key | Type | Description |
---|---|---|
height | int | Section height in twips. |
width | int | Section width in twips (twentieths of a point). |
marginTop | int | Top margin for this section in twips. |
marginRight | int | Right margin for this section in twips. |
marginBottom | int | Bottom margin for this section in twips. |
marginLeft | int | Left margin for this section in twips. |
marginHeader | int | Header margin in twips. |
marginFooter | int | Footer margin in twips. |
numberCols | int | Number of columns for this section. |
orient | string | Section page orientation (portrait or landscape). |
gutter | int | Gutter in twips (used for binding). |
bidi | bool | Set to true for right to left languages (default value is false). |
rtl | bool | Set to true for right to left languages (default value is false). |
pageNumberType | array | Keys and values:
|
columns | array | Keys and values:
|
endnotes | array | Keys and values:
|
footnotes | array | Keys and values:
|