addExternalFile
- 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
- addTab
- addTable
- 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
addExternalFile
TRIAL / ADVANCED / PREMIUM
Inserts an external document (DOCX, HTML, RTF or MHT) into the current Word document.
Description
public addExternalFile ( array $options )
This method allows the insertion of an external DOCX, HTML, RTF or MHT document within the current Word document.
When inserting a DOCX document, it is recommended that the page layout of the inserted DOCX coincides with the one of the Word document you are generating with phpdocx, if not you may expect certain formatting problems.
Only compatible with MS Word 2007 or newer.
Parameters
options
An array with the available options.
The possible keys and values are:
key | Type | Description |
---|---|---|
src | string | The path to the document (.docx) that you want to insert within our current Word document. |
matchSource | bool | If true (default value), it tries to preserve as much as possible the styles of the DOCX to be included. |
preprocess | bool | If true it does some preprocessing on the DOCX file to add. |
Exceptions
Invalid file extension.
File does not exist.