News

phpdocx v13 release notes

  • Jun 16, 2022

It is a pleasure to announce that phpdocx 13 is now live and ready for download. This new major version includes many powerful features designed to help you create, convert and transform amazing documents, simplify your taskforce and save lots of development time.

To get phpdocx, please visit our Pricing section and choose the license that best suits your needs.

Users with previous phpdocx versions can upgrade to phpdocx 13: just go to MY PHPDOCX, select the license(s) you want and click on the Upgrade button.

Users with a valid License Update Service (LUS) can upgrade to the latest version at no charge, at MY PHPDOCX.

This is the full list of phpdocx 13 features:

  • Compiled mode (Premium licenses):
    •  Linux (64-bit and ARM64), Windows (64-bit) and macOS (64-bit).
    • Replace lists, tables, texts and checkboxes.
    • Remove placeholders.
    • Get placeholders and styles.
  • New PDF indexer method to get information from PDF files (Advanced and Premium licenses).
  • PHP 8.2 support.
  • HTML to DOCX:
    • New CSS selector supported: ~
    • Added 'data-font-size: initial' as new style in text contents to CSS Extended (Premium licenses).
    • Improved transforming br tags when being added before list tags.
    • Added new issets when reading CSS styles.
    • Added an extra check when adding images without a src attribute to avoid a PHP Warning using PHP 8.
  • The static variables $_preprocessed, $_templateSymbolStart, $_templateSymbolEnd and $_templateBlockSymbol available in the CreateDocxFromTemplate class have been changed to class attributes. Added getter and setter methods for _preprocessed: getPreprocessed and setPreprocessed.
  • Optimized the replacePlaceholderImage method when working with documents with many images.
  • Optimized BulkProcessing when working with documents with many images (Premium licenses).
  • DOCXUtilities: new searchAndColor method to search and color text strings (Advanced and Premium licenses).
  • DocxUtilities: searchAndReplace, searchAndRemove and searchAndHighlight methods allow setting headers and footers as scopes (Advanced and Premium licenses).
  • Native DOCX to PDF (Advanced and Premium licenses):
    •  Headers and footers support: default header/footer type, contents and styles supported in the document body, page number, page total.
    •  Replaced empty paragraphs with   paragraphs to avoid hiding them in the output. Added a new includeBlankSpacesInEmptyParagraphs option to avoid this default behavior.
    •  Replaced &nbsp; with <br> when the includeBlankSpacesInEmptyParagraphs is enabled to keep empty paragraphs.
    •  Use &nbsp; to set tabs instead of a margin-left style.
    •  Added #fff as border color in table styles when nil border is used.
    • Added UTF-8 as meta charset.
  • Native DOCX to HTML (Advanced and Premium licenses):
    •  Replaced &nbsp; with <br> when the includeBlankSpacesInEmptyParagraphs is enabled to keep empty paragraphs.
  • The importHeadersAndFooters method has been improved when working with multiple contents that include external relationships.
  • DOCXCustomizer: added color support in run content types (Premium licenses).
  • Bulk processing allows using the parseLineBreaks option in replaceList (Premium licenses).
  • Added new PHPDOCX_VERSION const in CreateDocx to get the phpdocx version.
  • MultiMerge: new importEmbeddedFonts option to import embedded fonts in the DOCX documents to be merged and supported OLE objects not using bin extensions (Advanced and Premium licenses).
  • New typeCustom option in createListStyle to set custom types such as 001.
  • Added support for in-memory documents in protectDOCX, changeStatusComments and importHeadersAndFooters methods (Premium licenses).
  • CryptoPHPDOCX: removed external files (Premium licenses).
  • Optimized TCPDF class and improved when working with indirect objects (Advanced and Premium licenses).
  • Clone document source in splitDocx to avoid overwriting contents when using DOCXStructure objects (Premium licenses).
  • Added the cellBackgroundColor option to createTableStyle.
  • New resolution option in addSVG to set the resolution used by ImageMagick.
  • New parseLineBreaks option in replaceListVariable with multiple levels.
  • Updated the algorithm used to embed fonts (Advanced and Premium licenses).
  • Added libxml_use_internal_errors when importing HTML to hide the PHP warnings shown by specific custom error levels when no standard tags are used with the PHP DOM loadHTML method.
  • Removed @ to hide automatically XML warnings related to missing XML namespaces in the following classes and methods: CreateDocx, CreateDocxFromTemplate, Fonts, ThemeCharts, BulkProcessing, WordFragmentExtended. Added required namespaces when the XML contents are generated and libxml_use_internal_errors/libxml_clear_errors methods.
  • Removed CreateChartImageJpgraph and CreateChartImageEzComponents classes. Only used in previous versions by the deprecated conversion plugin based on OpenOffice to transform charts to images (Advanced and Premium licenses).
  • XLSXUtilities: splitXlsx cleans activeTab if set (Premium licenses).
  • Improved working with temp files. Generated a specific class.
  • Updated placeholder names used internally by phpdocx to generate XML contents adding '__PHX=' prefixes.
  • CreateDocxFromTemplate allows setting a custom base DOCX.
  • New setRTL example added to the packages.

Update 13.0.1 - Jun 22, 2022

  • Added an extra check to avoid a PHP warning when importing HTML with the customListStyles option enabled and custom list styles are not available.

The changes applied in this new version to the static variables avoid the need of executing:

CreateDocxFromTemplate::$_preprocessed = false;

when the same template is reused without preprocessing with block methods in order to generate multiple documents.

This static variable ($_preprocessed) is no longer available. It has been replaced with an attribute of the CreateDocxFromTemplate class, which is accesible from the constructor:

/** * Construct * @param mixed $docxTemplatePath path to the template to use or DOCXStructure * @param array $options * The available keys and values are: * 'baseTemplatePath' (string) set the base template path * 'preprocessed' (bool) if true the variables will not be 'repaired'. Default value is false * @access public * @throws Exception empty template */ public function __construct($docxTemplatePath, $options = array())

and from its own function:

public function setPreprocessed($preprocessed)