XML API - pdx:processTemplate
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createCharacterStyle
- createListStyle
- createParagraphStyle
- docxSettings
- importHeadersAndFooters
- importListStyle
- importStyles
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- addBookmark
- addBreak
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addStructuredDocumentTag
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteBlock
- modifyInputFields
- processTemplate
- rawSearchAndReplace
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
pdx:processTemplate
Preprocesses a given Word template in order to speed up further manipulations over it.
Note
You are reading the XML API documentation. For the PHP API method please go to processTemplate.
Element definition
This element allows the preprocessing of a Word template in order to improve performance in the process of replacing placeholder variables by their corresponding values.
Due to various reasons the Word interface may split internally the placeholder variables making direct substitution impossible. Even if you may see the placeholder variable correctly displayed in the Word interface the associated XML node may contain the associated text included in a very cumbersome way (with XML tags splitting the variable name in different chunks).
Although phpdocx deals by itself with that extra complications the process may require multiple manipulations, which for documents with a very large number of placeholders variables, may considerably slow down the output.
By preprocessing the Word template you make sure that all variables are already properly cleaned so the substitution may be carried out at a very fast pace.