DOCX2TXT
- 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
- 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
DOCX2TXT
![](/img/preview/methods_check.png)
Extracts the text contents from a Word document.
Description
public DOCX2TXT (string $source, string $target[, array $options]])
This method allows to extract the text from a DOCX document with a few styling options:
- Indent lists
- Tables as tabbed text
- Footnotes and endnotes
Parameters
source
The path to the DOCX from which you want to extract the text.
target
The path to the txt destination file.
options
The possible keys and values are:
Key | Type | Description |
---|---|---|
table | bool | True (default) if you want to parse tables as tabbed paragraps. |
list | bool | True (default) if you want to parse lists as txt lists. |
paragraph | bool | True (default) if you want to preserve the paragraph structure. |
footnote | bool | True (default) if you want to include the footnotes. |
endnote | bool | True (default) if you want to include the endnotes. |
chart | int | Possible values are:
|
Release notes
- phpdocx 15.0:
- in-memory DOCX documents.