XML API - pdx:replacePlaceholderImage
- 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:replacePlaceholderImage
Replaces a single variable within a list by a list of items.
Note
You are reading the XML API documentation. For the PHP API method please go to replacePlaceholderImage.
Description
Element definition
This element allows to replace a placeholder image that may be fully formatted in Word (border, shadows, effects...) by an image of our choice.
If one does not set the width, height and/or dpi options the element will use the corresponding data taken from the original placeholder image.
The placeholder image should be tagged using the alternate text option of your Word interface (this may depend on your Word version).
Attributes and sub-elements
name
The name of the variable that identifies the placeholder image.
path
The path to the image that you want to insert into the Word document.
options
Key | Description |
---|---|
firstMatch | If the variable appears more than once within the Word document and firstMatch is set to true, phpdocx will only replace the first ocurrence of the variable within the Word document. |
target | Possible values are: document, header, footer, footnote, endnote or comment. |
height | The value in cm (float) or 'auto' (use image size). |
width | The value in cm (float) or 'auto' (use image size). |
dpi | Dots per inch. This parameter is only taken into account if width or height are set to auto. |