searchAndColor
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- 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
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
searchAndColor


Searches for keywords within a Word document and colors them.
Description
public searchAndColor (string $source, string $target, string $search [, array $options])
This method colors plain text in a DOCX document.
Parameters
Source
The path to the source Word document.
target
The path to the Word document output.
search
The string of text or array that you want to color.
options
The possible keys and values are:
Key | Type | Description |
---|---|---|
color | string | FF0000, BDAD00... |
document | bool | If true colors the search string in the body of the document. The default value is true. |
endnotes | bool | If true colors the search string in the document endnotes. The default value is false. |
comments | bool | If true colors the search string in the document comments. The default value is false. |
headersAndFooters | bool | If true colors the search string in headers and footers. The default value is false. |
footnotes | bool | If true colors the search string in the document footnotes. The default value is false. |
headers | bool | If true colors the search string in headers. The default value is false. |
footers | bool | If true colors the search string in footers. The default value is false. |
Exceptions
Error while trying to open the (base) template as a zip file.