phpdocx v4.0 release notes

  • Jun 03, 2014

This new major version represents a big step forward regarding the functionality and scope of phpdocx.
The most important change introduced in this new version is that it removes all the restrictions regarding custom templates that were limitating previous versions.
With phpdocx 4.0 one may use concurrently the standard template methods of the past (that have also been improved and refactored) with any of the core phpdocx methods. This means in practice that one is not limited to modify the contents of a custom by simply replacing variables but that one may insert arbitrary Word content anywhere within the template.
Another important new feature is the introduction of "Word fragments" that allow for a simpler and more flexible creation of content. One may create a Word fragment with arbitrary content: paragraphs, lists, charts, images, footnote, etcetera and later insert it anywhere in the Word document in a truly simple and transparent way.
The main changes can be summarized as follows:
  • Completely refactored CreateDocx class and a completely new CreateDocxFromTemplate class that extends the former and allows for a complete control of documents based on custom templates.
  • New WordFragment class that greatly simplifies the process of nesting content within the Word document.
  • Complete refactoring of the prior template methods that allow for higher control and the replacement of variables by arbitrarily complex Word fragments.
  • createListStyle: greater choice of options for the creation of custom list styles.
  • addTextBox: includes now new formatting options and it is easier to include arbitrary content within textboxes.
  • insertWordFragmentBefore/After: allows to include content anywhere within a Word template.
  • MultiMerge: much faster API that allows for the merging of an arbitrarily large number of Word documents with just one line of code.
  • The conversion of numbered lists has been greatly improved as well as the handling of sections with multiple columns. Besides these new classes and methods we have also included some minor bug fixes and multiple improvements in the API including extra options and a uniformization of the typing and units conventions.