setLineNumbering
- 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
- addTab
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- importStylesWordDefault
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDecimalSymbol
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
setLineNumbering
ADVANCED / PREMIUM
TRIAL
Inserts line numbering into an already existing Word document.
Description
public setLineNumbering ( string $source, string $target [, array $options ] )
This method allows to insert or modify the line numbering properties of an existing Word document in .docx format.
The available options include:
- Line number increments to display.
- Start number.
- Distance between line numbers and text.
- Restarting conditions: continuous or restarted in each new document page or section.
Parameters
source
The path to the source Word document.
target
The path to the resulting Word document.
options
This is an array including all the available styling options. The possible keys and values of this array are:
Key | Type | Description |
---|---|---|
countBy | int | An integer indicating the line number increments to display. If left empty is set to 1. |
start | int | An integer indicating which number must be associated with the first line. The default value is 1. |
distance | int | An integer indicating the distance, in twentieths of a point, between the number and the associated line. If left empty is dealt automatically by Word. |
restart | string | A string that can take the following values:
|
Exceptions
Error while trying to open the (base) template as a zip file.
Release notes
- phpdocx 14.0:
- return DOCXStructure.
- phpdocx 13.5:
- DOCXStructure and in-memory DOCX documents.