This is the changelog between releases of PHPWord. Releases are listed in reverse chronological order with the latest version listed on top, while additions/changes in each release are listed in chronological order. Changes in each release are divided into three parts: added or change features, bugfixes, and miscellaneous improvements. Each line contains short information about the change made, the person who made it, and the related issue number(s) in GitHub.
This release marked heavy refactorings on internal code structure with the creation of some abstract classes to reduce code duplication. Element
subnamespace is introduced in this release to replace Section
. Word2007 reader capability is greatly enhanced. Endnote is introduced. List numbering is now customizable. Basic HTML and PDF writing support is enabled. Basic ODText reader is introduced.
- Image: Get image dimensions without EXIF extension - @andrew-kzoo GH-184
- Table: Add
tblGrid
element for Libre/Open Office table sizing - @gianis6 GH-183 - Footnote: Ability to insert textbreak in footnote
$footnote->addTextBreak()
- @ivanlanin - Footnote: Ability to style footnote reference mark by using
FootnoteReference
style - @ivanlanin - Font: Add
bgColor
to font style to define background using HEX color - @jcarignan GH-168 - Table: Add
exactHeight
to row style to define whether row height should be exact or atLeast - @jcarignan GH-168 - Element: New
CheckBox
element for sections and table cells - @ozilion GH-156 - Settings: Ability to use PCLZip as alternative to ZipArchive - @bskrtich @ivanlanin GH-106 GH-140 GH-185
- Template: Ability to find & replace variables in headers & footers - @dgudgeon GH-190
- Template: Ability to clone & delete block of text using
cloneBlock
anddeleteBlock
- @diego-vieira GH-191 - TOC: Ability to have two or more TOC in one document and to set min and max depth for TOC - @Pyreweb GH-189
- Table: Ability to add footnote in table cell - @ivanlanin GH-187
- Footnote: Ability to add image in footnote - @ivanlanin GH-187
- ListItem: Ability to add list item in header/footer - @ivanlanin GH-187
- CheckBox: Ability to add checkbox in header/footer - @ivanlanin GH-187
- Link: Ability to add link in header/footer - @ivanlanin GH-187
- Object: Ability to add object in header, footer, textrun, and footnote - @ivanlanin GH-187
- Media: Add
Media::resetElements()
to reset all media data - @juzi GH-19 - General: Add
Style::resetStyles()
,Footnote::resetElements()
, andTOC::resetTitles()
- @ivanlanin GH-187 - DOCX Reader: Ability to read header, footer, footnotes, link, preservetext, textbreak, pagebreak, table, list, image, and title - @ivanlanin
- Endnote: Ability to add endnotes - @ivanlanin
- ListItem: Ability to create custom list and reset list number - @ivanlanin GH-10 GH-198
- ODT Writer: Basic table writing support - @ivanlanin
- Image: Keep image aspect ratio if only 1 dimension styled - @japonicus GH-194
- HTML Writer: Basic HTML writer: text, textrun, link, title, textbreak, table, image (as Base64), footnote, endnote - @ivanlanin GH-203 GH-67 GH-147
- PDF Writer: Basic PDF writer using DomPDF: All HTML element except image - @ivanlanin GH-68
- DOCX Writer: Change
docProps/app.xml
Application
toPHPWord
- @ivanlanin - DOCX Writer: Create
word/settings.xml
andword/webSettings.xml
dynamically - @ivanlanin - ODT Writer: Basic image writing - @ivanlanin
- ODT Writer: Link writing - @ivanlanin
- ODT Reader: Basic ODText Reader - @ivanlanin GH-71
- Section: Ability to define gutter and line numbering - @ivanlanin
- Font: Small caps, all caps, and double strikethrough - @ivanlanin GH-151
- Settings: Ability to use measurement unit other than twips with
setMeasurementUnit
- @ivanlanin GH-199 - Style: Remove
bgColor
fromFont
,Table
, andCell
and put it into the newShading
style - @ivanlanin - Style: New
Indentation
andSpacing
style - @ivanlanin - Paragraph: Ability to define first line and right indentation - @ivanlanin
- Footnote: Footnote content doesn't show footnote reference number - @ivanlanin GH-170
- Documentation: Error in a function - @theBeerNut GH-195
createTextRun
replaced byaddTextRun
createFootnote
replaced byaddFootnote
createHeader
replaced byaddHeader
createFooter
replaced byaddFooter
createSection
replaced byaddSection
Element\Footnote::getReferenceId
replaced byElement\AbstractElement::getRelationId
Element\Footnote::setReferenceId
replaced byElement\AbstractElement::setRelationId
Footnote::addFootnoteLinkElement
replaced byMedia::addElement
Footnote::getFootnoteLinkElements
replaced byMedia::getElements
- All current methods on
Media
Element\Link::getLinkSrc
replaced byElement\Link::getTarget
Element\Link::getLinkName
replaced byElement\Link::getText
Style\Cell::getDefaultBorderColor
- Documentation: Simplify page level docblock - @ivanlanin GH-179
- Writer: Refactor writer classes and create a new
Write\AbstractWriter
abstract class - @ivanlanin GH-160 - General: Refactor folders:
Element
andException
- @ivanlanin GH-187 - General: Remove legacy
HashTable
andShared\ZipStreamWrapper
and all related properties/methods - @ivanlanin GH-187 - Element: New
AbstractElement
abstract class - @ivanlanin GH-187 - Media: Refactor media class to use one method for all docPart (section, header, footer, footnote) - @ivanlanin GH-187
- General: Remove underscore prefix from all private properties name - @ivanlanin GH-187
- General: Move Section
Settings
toStyle\Section
- @ivanlanin GH-187 - General: Give
Abstract
prefix andInterface
suffix for all abstract classes and interfaces as per PHP-FIG recommendation - @ivanlanin GH-187 - Style: New
Style\AbstractStyle
abstract class - @ivanlanin GH-187 - Writer: New 'ODText\Base` class - @ivanlanin GH-187
- General: Rename
Footnote
toFootnotes
to reflect the nature of collection - @ivanlanin - General: Add some unit tests for Shared & Element (100%!) - @Progi1984
- Test: Add some samples and tests for image wrapping style - @brunocasado GH-59
- Refactor: Remove Style\Tabs - @ivanlanin
- Refactor: Apply composite pattern for writers - @ivanlanin
- Refactor: Split
AbstractContainer
fromAbstractElement
- @ivanlanin - Refactor: Apply composite pattern for Word2007 reader - @ivanlanin
This is a bugfix release for PSR-4 compatibility.
- Fixed PSR-4 composer autoloader - @AntonTyutin
This release marked the transformation to namespaces (PHP 5.3+).
- Image: Ability to use remote or GD images using
addImage()
on sections, headers, footer, cells, and textruns - @ivanlanin - Header: Ability to use remote or GD images using
addWatermark()
- @ivanlanin
- Preserve text doesn't render correctly when the text is not the first word, e.g. 'Page {PAGE}' - @ivanlanin
- Move documentation to Read The Docs - @Progi1984 @ivanlanin GH-82
- Reorganize and redesign samples folder - @ivanlanin GH-137
- Use
PhpOffice\PhpWord
namespace for PSR compliance - @RomanSyroeshko @gabrielbull GH-159 GH-58 - Restructure folders and change folder name
Classes
tosrc
andTests
totest
for PSR compliance - @RomanSyroeshko @gabrielbull - Compliance to phpDocumentor - @ivanlanin
- Merge Style\TableFull into Style\Table. Style\TableFull is deprecated - @ivanlanin GH-160
- Merge Section\MemoryImage into Section\Image. Section\Image is deprecated - @ivanlanin GH-160
This is a bugfix release for image detection functionality.
- Added fallback for computers that do not have exif_imagetype - @bskrtich, @gabrielbull
This release merged a lot of improvements from the community. Unit tests introduced in this release and has reached 90% code coverage.
- Template: Permit to save a template generated as a file (PHPWord_Template::saveAs()) - @RomanSyroeshko GH-56 GH-57
- Word2007: Support sections page numbering - @gabrielbull
- Word2007: Added line height methods to mirror the line height settings in Word in the paragraph styling - @gabrielbull
- Word2007: Added support for page header & page footer height - @JillElaine GH-5
- General: Add ability to manage line breaks after image insertion - @bskrtich GH-6 GH-66 GH-84
- Template: Ability to limit number of replacements performed by setValue() method of Template class - @RomanSyroeshko GH-52 GH-53 GH-85
- Table row: Repeat as header row & allow row to break across pages - @ivanlanin GH-48 GH-86
- Table: Table width in percentage - @ivanlanin GH-48 GH-86
- Font: Superscript and subscript - @ivanlanin GH-48 GH-86
- Paragraph: Hanging paragraph - @ivanlanin GH-48 GH-86
- Section: Multicolumn and section break - @ivanlanin GH-48 GH-86
- Template: Ability to apply XSL style sheet to Template - @RomanSyroeshko GH-46 GH-47 GH-83
- General: PHPWord_Shared_Font::pointSizeToTwips() converter - @ivanlanin GH-87
- Paragraph: Ability to define normal paragraph style with PHPWord::setNormalStyle() - @ivanlanin GH-87
- Paragraph: Ability to define parent style (basedOn) and style for following paragraph (next) - @ivanlanin GH-87
- Clone table rows on the fly when using a template document - @jeroenmoors GH-44 GH-88
- Initial addition of basic footnote support - @deds GH-16
- Paragraph: Ability to define paragraph pagination: widow control, keep next, keep lines, and page break before - @ivanlanin GH-92
- General: PHPWord_Style_Font refactoring - @ivanlanin GH-93
- Font: Use points instead of halfpoints internally. Conversion to halfpoints done during XML Writing. - @ivanlanin GH-93
- Paragraph: setTabs() function - @ivanlanin GH-92
- General: Basic support for TextRun on ODT and RTF - @ivanlanin GH-99
- Reader: Basic Reader for Word2007 - @ivanlanin GH-104
- TextRun: Allow Text Break in Text Run - @bskrtich GH-109
- General: Support for East Asian fontstyle - @jhfangying GH-111 GH-118
- Image: Use exif_imagetype to check image format instead of extension name - @gabrielbull GH-114
- General: Setting for XMLWriter Compatibility option - @bskrtich GH-103
- MemoryImage: Allow remote image when allow_url_open = on - @ivanlanin GH-122
- TextBreak: Allow font and paragraph style for text break - @ivanlanin GH-18
- Fixed bug with cell styling - @gabrielbull
- Fixed bug list items inside of cells - @gabrielbull
- Adding a value that contains "&" in a template breaks it - @SiebelsTim GH-51
- Example in README.md is broken - @Progi1984 GH-89
- General: PHPWord_Shared_Drawing::centimetersToPixels() conversion - @ivanlanin GH-94
- Footnote: Corrupt DOCX reported by MS Word when sections > 1 and not every sections have footnote - @ivanlanin GH-125
- UnitTests - @Progi1984
This is the first release after a long development hiatus in CodePlex. This release initialized ODT and RTF Writer, along with some other new features for the existing Word2007 Writer, e.g. tab, multiple header, rowspan and colspan. Composer and Travis were added.
- Implement RTF Writer - @Progi1984 GH-1
- Implement ODT Writer - @Progi1984 GH-2
- Word2007: Add rowspan and colspan to cells - @kaystrobach
- Word2007: Support for tab stops - @RLovelett
- Word2007: Support Multiple headers - @RLovelett
- Word2007: Wrapping Styles to Images - @gabrielbull
- Added support for image wrapping style - @gabrielbull
- "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found - @RomanSyroeshko GH-32
- PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input - @RomanSyroeshko GH-34
- Temporary files naming logic in PHPWord_Template can lead to a collision - @RomanSyroeshko GH-38
- Add superscript/subscript styling in Excel2007 Writer - @MarkBaker
- add indentation support to paragraphs - @deds
- Support for Composer - @Progi1984 GH-27
- Basic CI with Travis - @Progi1984
- Added PHPWord_Exception and exception when could not copy the template - @Progi1984
- IMPROVED: Moved examples out of Classes directory - @Progi1984
- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo CP-49