phpdocx v12 release notes
- Sep 01, 2021
We are pleased to announce phpdocx 12, the latest major version of the library, which is now available for download.
To get phpdocx 12 just go to Pricing and choose the license that best suits your needs.
Users with previous phpdocx versions can upgrade by going to MY PHPDOCX and clicking on the Upgrade to button.
Users with a valid LUS (License Update Service) can get the new version at no cost.
phpdocx 12 comes with a whole new set of features designed to boost your business documentation and report tasks. Here is the complete list:
- Support for MS Word 2021.
- New methods to insert citations, sources and bibliographies: addCitation, addSource, addBibliography (Advanced and Premium licenses).
- New SignPDFPlus feature to sign the same PDF document more than once. PHP 5.6 or newer is required (Premium licenses).
- replaceVariableByWordFragment: new stylesReplacementType option to keep and mix existing placeholder pPr and rPr styles (Premium licenses).
- New method to insert SVG contents: addSVG (ImageMagick PHP extension is required).
- New inline-block type replacement in replaceVariableByWordFragment and replaceVariableByHTML methods to replace placeholders keeping inline and block elements and placeholder styles (Premium licenses).
- New option in mergeDocx to rename styles of the DOCX documents to be merged: renameStyles (Advanced and Premium licenses).
- Drupal 9 module: A new module to use phpdocx with Drupal 9 (Advanced and Premium licenses).
- Removed phpseclib to sign documents using SignDOCX, SignXLSX and SignPPTX. OpenSSL functions from PHP are now used to increase PEM formats compatibility (Premium licenses).
- Improved working with East Asian fonts with the addText method.
- Improved mergeDocx when working with embedded images in shapes, SVG images, numbering styles applied to custom styles, multiple altChunk tag, hyperlinks in images tags with the same ID, external charts (Advanced and Premium licenses).
- addImage and replacePlaceholderImage methods support base64 images and set a default 96 dpi if the image to be added has a 0 dpi and no custom dpi is set.
- addShape supports adding image contents in shapes.
- replaceListVariable allows using sub-arrays.
- HTML to DOCX: no direction style is set as default, added a descr default value when adding base64 images to avoid a PHP warning with PHP 8, improved parseAnchors options when the anchor tag is not added in a paragraph, float casting to sizes to avoid a warning when using PHP 8 and not valid values.
- DOCX to HTML: w:vanish, better support for cell margins when only table margins are set, supported on/off, 1/0 and true/false values for w:pPr and w:rPr styles, improved hyperlinks transformation, improved border sizes (Advanced and Premium licenses).
- DOCX to PDF using native conversion plugin: endnotes, footnotes and comments support (appear at the end of the document) w:vanish, better support for cell margins when only table margins are set, supported on/off, 1/0 and true/false values for w:pPr and w:rPr styles, improved hyperlinks transformation, improved list margins, improved border sizes (Advanced and Premium licenses).
- New option in replacePlaceholderImage to replace images in shapes: replaceShapes.
- DOCX documents without a section tag are automatically fixed.
- addSection and modifyPageLayout include new options to position, start, restart and format endnotes and footnotes, and allow generating multiple sections with more than one column applying custom widths and spaces.
- importListStyle and importStyles methods support importing linked numbering styles.
- New bookmarkName option added to captions in addImage and addTable methods to set a custom name to the caption bookmark.
- DOCXCustomizer: added strike, dstrike and vanish support (Premium licenses).
- Handle autonumeric id by the style name when adding captions: Caption, Figure, Table...
- Bookmarks wrap the full content of the caption when adding a caption (image or table).
- Indexer extracts signatures and sources information (Advanced and Premium licenses).
- Tracking supports accepting and rejecting section changes (w:sectPrChange tag) (Premium licenses).
- The addText method adds a parseLineBreaks option to make possible to parse line breaks ('\n', "\n", '\n\r', "\n\r" and others).
- Added an extra check in getWordStyles to avoid null Exceptions if some DOCX styles are missing (Advanced and Premium licenses).
- Bulk processing allows adding WordFragment values that contain external file dependencies (images, charts and external files), keeps and restores the preset value of CreateDocx::$returnDocxStructure, replaceList allows using sub-arrays and applies htmlspecialchars to all contents when using replaceText (Premium licenses).
- Added hidden, semiHidden, unhideWhenUsed, locked and next options to createParagraphStyle, createCharacterStyle and createTableStyle methods.
- New descr option in addImage to set a custom descr value instead of the image path.
- Uppercase DOCX extension can be used in the whole library.
- importStyles generates a random name value when importing a custom paragraph style with a numbering style.
- importHeadersAndFooters includes a new parameter to set extra options such as setDefault to set the imported headers/footers as default instead of the preset type.
- Added to the internal base template the w15 namespace in the numbering XML file.
- Improved PDF methods when working with documents that include annotations (Premium licenses).
- watermarkRemove uses DOCXStructure to read and save documents (Advanced and Premium licenses).
- The htmlspecialchars PHP function to convert protected XML characters has been added to be applied automatically to the following methods and options: url option in addLink; name, title, haxLabel and vaxLabel options in addChart; textComment, initials and author options in addComment; textEndnote option in addEndnote; textFootnote option in addFootnote; defaultValue and selectOptions options in addFormElement; descr option in addImage; textBefore and textAfter options in addMergeField; createProperties method; placeholderText and alias options in addStructuredDocumentTag; text option in watermarkDocx; modifyInputFields method.
- Replaced exit calls in chart, watermark and sign classes by exceptions.
- replaceChartData uses the default temp folder to generate the temp XLSX files to be added to the document (Advanced and Premium licenses).
- Removed the old symfony bundle from the namespaces package. A standard integration with Symfony is available on the documentation pages of the website (Advanced and Premium licenses).
- Removed OdfConverter and openoffice folders from the package. Only used by the deprecated conversion plugin based on OpenOffice (Advanced and Premium licenses).
- Removed TCPDF as conversion plugin native method and unnecessary files in the fonts folder. DOMPDF is now used by default as conversion plugin native method (Advanced and Premium licenses).
Update 12.0.1 - 10/06/2021
- PHP 8.1 support.
- Improved HTML Extended to allow mixing standard HTML tags and HTML Extended tags.
- inline-block replacement type can be used with the same placeholder name more than once.
- replacePlaceholderImage sets a new random ID to the replaced image.
- MultiMerge supports links with mixed IDs and anchors.
- Fixed a bug with PHP 5.2 when transforming HTML.
- Tracking feature supports inline replacement when using replaceVariableByWordFragment.