addPageNumber
- addBibliography
- addBookmark
- addBreak
- addCaption
- 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
- addTableAuthorities
- 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
addPageNumber


Inserts page numbers into a PDF document.
Description
public addPageNumber (string $source, string $target, [array $options])
Inserts page numbers into a PDF document.
Parameters
source
Path to the PDF document.
target
Path to the output PDF.
options
The possible keys and values are:
key | Type | Description |
---|---|---|
annotations | bool | Import annotations (links, comments and others). Default as false. |
bold | bool | Default as false. |
color | array | Default as array(255, 255, 255). |
excludeFirstPage | bool | Default as false. |
font | string | Default as 'Helvetica'. |
fontSize | int | Default as 7. |
format | string | Default as 'Page INDEXPAGE of TOTALPAGES'. |
italic | bool | Default as false. |
position | array | Default as array(0, 0) => (x, y). |
startNumber | int | Default as 1. |
underline | bool | Default as false. |
useFixedAnnotationPositions | bool | Force annotation page link IDs. Useful when using PDF readers that don't detect all PDF contents automatically. Default as false. |
Exceptions
File doesn't exist.
Code samples
Example #1
Release notes
- phpdocx 16.0:
- new method.