Api Documentation

Api 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:

Layout and General
Word Content
  • addBookmark

    Inserts a bookmarks into the Word document

  • addBreak

    Inserts a line/column/page break into the Word document

  • addChart

    Inserts a chart into the Word document

  • addComment

    Adds a Word comment to the current Word document.

  • addCrossReference

    Inserts a cross-reference into the Word document

  • addDateAndHour

    This method allows to insert the current date and/or hour in different formats.

  • addEndnote

    Inserts an endnote into the Word document

  • addExternalFile

    Adds an external DOCX, HTML, MHT, RTF or TXT file

  • addFootnote

    Inserts a footnote into the Word document

  • addFormElement

    Inserts form elements into the Word document

  • addHeading

    Inserts a heading into the Word document

  • addImage

    Inserts an image into the Word document

  • addLink

    Inserts a link into the Word document

  • addList

    Inserts (nested) lists into the Word document

  • addMathEquation

    Imports a math equation from another Word document or inserrts a math equation in OMML or MathML format

  • addMergeField

    Adds a merge field to the Word document

  • addPageNumber

    Inserts the current page number into the Word document

  • addShape

    Inserts different types of shapes into a Word document

  • addSimpleField

    Adds a simple field to your Word document

  • addStructuredDocumentTag

    Inserts different types of Structured Document Tags into the Word document

  • addTable

    Inserts a table into a Word document

  • addTableContents

    Inserts a Table of Contents (TOC) into the Word document

  • addText

    Inserts a paragraph into a Word document

  • addTextBox

    Inserts a Text Box in the Word document

  • addWordML

    Inserts raw WordML code into the Word document

  • embedHTML

    Inserts HTML content into the Word document

Templates
Format Conversion
  • DOCX2TXT

    Extracts the text contents from a Word document

  • getStatistics

    Counts and prints the number of pages, words, characters, paragraphs, lines, tables and images of a document

  • transformDocument

    Transforms DOCX documents into another formats (PDF, DOC, RTF, HTML)

  • transformDocxUsingMSWord

    Transforms docx to other formats with the help of Microsoft Office

  • TXT2DOCX

    Transforms plain text into WordML with custom styles

DOCXPath
DocxUtilities
Indexer
  • indexer

    Parses DOCX documents and return their contents (body, images, links, comments, headers...)

Performance
  • optimizeTemplate

    Process a DOCX to get the best performance when using the document as a template

  • parseDocx

    Allows to serialize a DOCX in memory, database... to be reused later

  • zipStream

    Generates a DOCX stream without saving the document to the file system

Cryptophpdocx
Digital Signature Package