JSON API - replaceVariableByExternalFile
- addBarcode
- addBookmark
- addBreak
- addCaption
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addDropCap
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addPageNumber
- addRuby
- addSimpleField
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordML
- addWordFragment
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setCompatibilityMode
- setDefaultFont
- setDocumentDefaultStyles
- 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
replaceVariableByExternalFile
PREMIUM
TRIAL / ADVANCED
Replaces placeholder variables by external files.
Note
You are reading the JSON API documentation. For the PHP API method please go to replaceVariableByExternalFile.
JSON data
| Key | Description |
|---|---|
| variables | This is an object with the placeholder variables as keys and the corresponding external document as value. Path to the local file or Base64 string or remote file to be inserted into the Word document. |
| firstMatch | If the variable appears more than once within the Word document and firstMatch is set to true, phpdocx will only replace the first occurrence of the variable within the Word document. |
| matchSource | If true (default value) tries to preserve as much as possible the formatting of the inserted document. |
Code samples
Example #1
A template can be a local file, a Base64 string, or a remote file.
Release notes
- phpdocx 18.0:
- new action.
