PHPDOCX documentation
To generate a word document, you must activate the support for ZipArchive and XSLT in PHP 5
You will find in this section a complete list of the methods included in the latest version of the PHPDOCX library.
Here we include a brief description of each method for your convenience:
- fAddBreak: allows you to insert line or page breaks into your Word document.
- fAddElement: allows you to nest different elements for more sophisticated formatting, e.g. links inside lists, images inside paragraphs, etc
- fAddEndnote: adds an endnote in you Word document allowing you, for example, to insert lists of references, etcetera.
- fAddFooter: adds a footer to your Word document in order to include the page numbering and other branding elements.
- fAddFootnote: inserts a footnote in your Word document.
- fAddGraphic: inserts different kinds of 2D and 3D graphs and charts. These elements are fully editable within the final Word Document.
- fAddHeader: adds a header where you can include different elements and fields to customize your Word document.
- fAddImage: inserts an image into your Word document. Different file formats are supported such as jpg, gif and png. These images can be scaled and positioned within the document.
- fAddLink: inserts a link to an external document or web page into your Word document.
- fAddList: inserts lists into your Word document. These lists can be nested and each level can have its own formatting.
- fAddMacro: inserts a macro in the Word document generating a .docm file. The macro is copied from an preexisting (.docm) document.
- fAddMathDocx: inserts a mathematical formula copied from a preexisting Word document.
- fAddMathEq: inserts a mathematical formula in OMML format.
- fAddMathMML: inserts a mathematical formula in OMML format. Please note that you need a copy of MML2OMML.xsl, this file is supplied with Microsoft Word so you should check for possible licensing issues.
- fAddSection: adds a new section to your Word document. You can apply different formatting to each section.
- fAddTable: inserts a table into your Word document. You can apply advanced formatting to the generated tables.
- fAddTableContents: inserts a table of Contents into your Word Document. Please note: the generated TOC needs to be updated either by the user after opening the document or programmatically using a macro.
- fAddText: inserts formatted text into your Word document.
- fAddTextBox: inserts a text box into your Word document.
- fAddTitle: inserts a title or heading into your Word document. A title is required if you want to generate a table of contents.
- fCreateDocx: generates the resulting Word document with its general configuration parameters.
- fDisableDebug: disables debugging while generating the Word document.
- fEnableDebug: enables debugging while generating the Word document.
- fGeneratePDF: generates a PDF file based on your Word document (graphs are not included).
- fGenerateXHTML: generates an XHTML document based on your Word documents (graphs are not included).
- fSetDefaultFont: set the default font for whole document.
Be aware that not all of this functionality is available in the free version. The methods that are specific to the Pro version are marked with the icon: 
You can also check the features list for the differences between both versions.
Your comments