Releases: PHPOffice/PHPWord
v0.17.0
Added
- Add methods setValuesFromArray and cloneRowFromArray to the TemplateProcessor @geraldb-nicat #670
- Set complex type in template @troosan #1565
- implement support for section vAlign @troosan #1569
- ParseStyle for border-color @Gllrm0 #1551
- Html writer auto invert text color @SailorMax #1387
- Add RightToLeft table presentation. @troosan #1550
- Add support for page vertical alignment. @troosan #672 #1569
- Adding setNumId method for ListItem style @eweso #1329
- Add support for basic fields in RTF writer. @Samuel-BF #1717
Fixed
- Fix HTML border-color parsing. @troosan #1551 #1570
- Language::validateLocale should pass with locale 'zxx'. @efpapado #1558
- can't align center vertically with the text @ter987 #672
- fix parsing of border-color and add test @troosan #1570
- TrackChange doesn't handle all return types of \DateTime::createFromFormat(...) @superhaggis #1584
- To support PreserveText inside sub container @bhattnishant #1637
- No nested w:pPr elements in ListItemRun. @waltertamboer #1628
- Ensure that entity_loader disable variable is re-set back to the original setting @seamuslee001 #1585
Miscellaneous
v0.16.0
Added
- Add getVariableCount method in TemplateProcessor. @nicoder #1272
- Add setting Chart Title and Legend visibility @Tom-Magill #1433
- Add ability to pass a Style object in Section constructor @ndench #1416
- Add support for hidden text @Alexmg86 #1527
- Add support for setting images in TemplateProcessor @SailorMax #1170
- Add "Plain Text" type to SDT (Structured Document Tags) @morrisdj #1541
- Added possibility to index variables inside cloned block in TemplateProcessor @JPBetley #817
- Added possibility to replace variables inside cloned block with values in TemplateProcessor @DIDoS #1392
Fixed
- Fix regex in
cloneBlock
function @nicoder #1269 - HTML Title Writer loses text when Title contains a TextRun instead a string. @begnini #1436
- Fix regex in fixBrokenMacros, make it less greedy @MuriloSo @brainwood @yurii-sio2 #1502 #1345
- 240 twips are being added to line spacing, should not happen when using lineRule fixed @troosan #1509 #1505
- Adding table layout to the generated HTML @aarangara #1441
- Fix loading of Sharepoint document @Garrcomm #1498
- RTF writer: Round getPageSizeW and getPageSizeH to avoid decimals @Patrick64 #1493
- Fix parsing of Office 365 documents @Timanx #1485
- For RTF writers, sizes should should never have decimals @Samuel-BF #1536
- Style Name Parsing fails if document generated by a non-english word version @begnini #1434
Miscelaneous
- Get rid of duplicated code in TemplateProcessor @abcdmitry #1161
v0.15.0
Added
- Parsing of
align
HTML attribute - @troosan #1231 - Parse formatting inside HTML lists - @troosan @samimussbach #1239 #945 #1215 #508
- Parsing of CSS
direction
instruction, HTMLlang
attribute, formatting inside table cell - @troosan #1273 #1252 #1254 - Add support for Track changes @cip @troosan #354 #1262
- Add support for fixed Table Layout @aoloe @ekopach @troosan #841 #1276
- Add support for Cell Spacing @dox07 @troosan #1040
- Add parsing of formatting inside lists @atomicalnet @troosan #594
- Added support for Vertically Raised or Lowered Text (w:position) @anrikun @troosan #640
- Add support for MACROBUTTON field @phryneas @troosan #1021
- Add support for Hyphenation @Trainmaster #1282 (Document:
autoHyphenation
,consecutiveHyphenLimit
,hyphenationZone
,doNotHyphenateCaps
, Paragraph:suppressAutoHyphens
) - Added support for Floating Table Positioning (tblpPr) @anrikun #639
- Added support for Image text wrapping distance @troosan #1310
- Added parsing of CSS line-height and text-indent in HTML reader @troosan #1316
- Added the ability to enable gridlines and axislabels on charts @FrankMeyer #576
- Add support for table indent (tblInd) @Trainmaster #1343
- Added parsing of internal links in HTML reader @lalop #1336
- Several improvements to charts @jaek-s #1332
- Support reading of w:drawing for documents produced by word 2011+ @gthomas2 #464 #1324
- Add parsing of html image in base64 format @jgpATs2w #1382
- Added Support for Indentation & Tabs on RTF Writer. @smaug1985 #1405
- Allows decimal numbers in HTML line-height style @jgpATs2w #1413
Fixed
- Fix reading of docx default style - @troosan #1238
- Fix the size unit of when parsing html images - @troosan #1254
- Fixed HTML parsing of nested lists - @troosan #1265
- Save PNG alpha information when using remote images. @samsullivan #779
- Fix parsing of
<w:br/>
tag. @troosan #1274 - Bookmark are not writton as internal link in html writer @troosan #1263
- It should be possible to add a Footnote in a ListItemRun @troosan #1289 #1287
- Fix colspan and rowspan for tables in HTML Writer @mattbolt #1292
- Fix parsing of Heading and Title formating @troosan @gthomas2 #465
- Fix Dateformat typo, fix hours casing, add Month-Day-Year formats @ComputerTinker #591
- Fix missing column width in ODText writer @potofcoffee #413
- Disable entity loader before parsing XML to avoid XXE injection @Tom4t0 #1427
Changed
- Remove zend-stdlib dependency @Trainmaster #1284
- The default unit for
\PhpOffice\PhpWord\Style\Image
changed frompx
topt
.
Miscelaneous
v0.14.0
This release fixes several bugs and adds some new features.
PHP 7.0 and 7.1 are now supported without warnings.
Added
- Possibility to control the footnote numbering - @troosan #1068
- Image creation from string - @troosan #937
- Introduced the
\PhpOffice\PhpWord\SimpleType\NumberFormat
simple type. - @troosan - Support for ContextualSpacing - @postHawk #1088
- Possiblity to hide spelling and/or grammatical errors - @troosan #542
- Possiblity to set default document language as well as changing the language for each text element - @troosan #1108
- Support for Comments - @troosan #1067
- Support for paragraph textAlignment - @troosan #1165
- Add support for HTML underline tag in addHtml - @zNightFalLz #1186
- Allow to change cell width unit - @guillaume-ro-fr #986
- Allow to change the line height rule @troosan
- Implement PageBreak for odt writer @cookiekiller #863 #824
- Allow to force an update of all fields on opening a document - @troosan #951
- Allow adding a CheckBox in a TextRun - @irond #727
- Add support for HTML img tag - @srggroup #934
- Add support for password protection for docx - @mariahaubner #1019
Fixed
- Loosen dependency to Zend
- Images are not being printed when generating PDF - @hubertinio #1074 #431
- Fixed some PHP 7 warnings - @ likeuntomurphy #927
- Fixed Word 97 reader - @alsofronie @Benpxpx @mario-rivera #912 #920 #892
- Fixed image loading over https - @troosan #988
- Impossibility to set different even and odd page headers - @troosan #981
- Fixed Word2007 reader where unnecessary paragraphs were being created - @donghaobo #1043 #620
- Fixed Word2007 reader where margins were not being read correctly - @slowprog #885 #1008
- Impossible to add element PreserveText in Section - @rvanlaak #452
- Added missing options for numbering format - @troosan #1041
- Fixed impossibility to set a different footer for first page - @ctrlaltca #1116, @aoloe #875
- Fixed styles not being applied by HTML writer, better pdf output - @Sarke #1047 #500 #1139
- Fixed read docx error when document contains image from remote url - @FBnil #1173 #1176
- Padded the $args array to remove error - @kaigoh #1150, @reformed #870
- Fix incorrect image size between windows and mac - @bskrtich #874
- Fix adding HTML table to document - @mogilvie @arivanbastos #324
- Fix parsing on/off values (w:val="true|false|1|0|on|off") - @troosan #1221 #1219
- Fix error on Empty Dropdown Entry - @ComputerTinker #592
Deprecated
- PhpWord->getProtection(), get it from the settings instead PhpWord->getSettings()->getDocumentProtection();
v0.13.0
This release brings several improvements in TemplateProcessor
, automatic output escaping feature for OOXML, ODF, HTML, and RTF (turned off, by default). It also introduces constants for horizontal alignment options, and resolves some issues with PHP 7. Manual installation feature has been dropped since the release. Please, use Composer to install PHPWord.
Added
- Introduced the
\PhpOffice\PhpWord\SimpleType\Jc
simple type. - @RomanSyroeshko - Introduced the
\PhpOffice\PhpWord\SimpleType\JcTable
simple type. - @RomanSyroeshko - Introduced writer for the "Paragraph Alignment" element (see
\PhpOffice\PhpWord\Writer\Word2007\Element\ParagraphAlignment
). - @RomanSyroeshko - Introduced writer for the "Table Alignment" element (see
\PhpOffice\PhpWord\Writer\Word2007\Element\TableAlignment
). - @RomanSyroeshko - Supported indexed arrays in arguments of
TemplateProcessor::setValue()
. - @RomanSyroeshko #618 - Introduced automatic output escaping for OOXML, ODF, HTML, and RTF. To turn the feature on use
phpword.ini
or\PhpOffice\PhpWord\Settings
. - @RomanSyroeshko #483 - Supported processing of headers and footers in
TemplateProcessor::applyXslStyleSheet()
. - @RomanSyroeshko #335
Changed
- Improved error message for the case when
autoload.php
is not found. - @RomanSyroeshko #371 - Renamed the
align
option ofNumberingLevel
,Frame
,Table
, andParagraph
styles intoalignment
. - @RomanSyroeshko - Improved performance of
TemplateProcessor::setValue()
. - @kazitanvirahsan #614, #617
Deprecated
getAlign
andsetAlign
methods ofNumberingLevel
,Frame
,Table
, andParagraph
styles.
Use the correspondentgetAlignment
andsetAlignment
methods instead. - @RomanSyroeshkoleft
,right
, andjustify
alignment options for paragraphs (now are mapped toJc::START
,Jc::END
, andJc::BOTH
). - @RomanSyroeshkoleft
,right
, andjustify
alignment options for tables (now are mapped toJc::START
,Jc::END
, andJc::CENTER
). - @RomanSyroeshkoTCPDF
due to its limited HTML support. UseDomPDF
orMPDF
writer instead. - @RomanSyroeshko #399
Removed
\PhpOffice\PhpWord\Style\Alignment
. Style properties, which previously stored instances of this class, now deal with strings.
In each case set of available string values is defined by the correspondent simple type. - @RomanSyroeshko- Manual installation support. Since the release we have dependencies on third party libraries,
so installation via ZIP-archive download is not an option anymore. To install PHPWord use Composer.
We also removed\PhpOffice\PhpWord\Autoloader
, because the latter change made it completely useless.
Autoloaders provided by Composer are in use now (seebootstrap.php
). - @RomanSyroeshko \PhpOffice\PhpWord\Shared\Drawing
replaced by\PhpOffice\Common\Drawing
. - @Progi1984 #658\PhpOffice\PhpWord\Shared\Font
. - @Progi1984 #658\PhpOffice\PhpWord\Shared\String
replaced by\PhpOffice\Common\Text
. - @Progi1984 @RomanSyroeshko #658\PhpOffice\PhpWord\Shared\XMLReader
replaced by\PhpOffice\Common\XMLReader
. - @Progi1984 #658\PhpOffice\PhpWord\Shared\XMLWriter
replaced by\PhpOffice\Common\XMLWriter
. - @Progi1984 @RomanSyroeshko #658AbstractContainer::addMemoryImage()
. UseAbstractContainer::addImage()
instead.
Fixed
v0.12.1
Maintenance release. This release is focused primarily on TemplateProcessor
.
Changes
- Changed visibility of all private properties and methods of
TemplateProcessor
toprotected
. - @RomanSyroeshko #498 - Improved performance of
TemplateProcessor::setValue()
. - @RomanSyroeshko @nicoSWD #513
Bugfixes
- Fixed issue with "Access denied" message while opening
Sample_07_TemplateCloneRow.docx
andSample_23_TemplateBlock.docx
result files on Windows platform. - @RomanSyroeshko @AshSat #532 - Fixed
PreserveText
element alignment in footer (seeSample_12_HeaderFooter.php
). - @RomanSyroeshko @SSchwaiger #495
v0.12.0
This release added form fields (textinput, checkbox, and dropdown), drawing shapes (arc, curve, line, polyline, rect, oval), and basic 2D chart (pie, doughnut, bar, line, area, scatter, radar) elements along with some new styles. Basic MsDoc reader is introduced.
Features
- Element: Ability to add drawing shapes (arc, curve, line, polyline, rect, oval) using new
Shape
element - @ivanlanin #123 - Font: New
scale
,spacing
, andkerning
property of font style - @ivanlanin - Paragraph: Added shading to the paragraph style for full width shading - @lrobert #264
- RTF Writer: Support for sections, margins, and borders - @ivanlanin #249
- Section: Ability to set paper size, e.g. A4, A3, and Legal - @ivanlanin #249
- General: New
PhpWord::save()
method to encapsulateIOFactory
- @ivanlanin - General: New
Shared\Converter
static class - @ivanlanin - Chart: Basic 2D chart (pie, doughnut, bar, line, area, scatter, radar) - @ivanlanin #278
- Chart: 3D charts and ability to set width and height - @ivanlanin
- FormField: Ability to add textinput, checkbox, and dropdown form elements - @ivanlanin #266
- Setting: Ability to define document protection (readOnly, comments, trackedChanges, forms) - @ivanlanin
- Setting: Ability to remove [Compatibility Mode] text in the MS Word title bar - @ivanlanin
- SDT: Ability to add structured document tag elements (comboBox, dropDownList, date) - @ivanlanin
- Paragraph: Support for paragraph with borders - @ivanlanin #294
- Word2007 Writer : Support for RTL - @Progi1984 #331
- MsDOC Reader: Basic MsDOC Reader - @Progi1984 #23, #287
- "absolute" horizontal and vertical positioning of Frame - @basjan #302
- Add new-page function for PDF generation. For multiple PDF-backends - @chc88 #426
- Report style options enumerated when style unknown - @h6w
Bugfixes
- Fix rare PclZip/realpath/PHP version problem - @andrew-kzoo #261
addHTML
encoding and ampersand fixes for PHP 5.3 - @bskrtich #270- Page breaks on titles and tables - @ivanlanin #274
- Table inside vertical border does not rendered properly - @ivanlanin #280
add<elementName>
of container should be case insensitive, e.g.addToc
should be accepted, not onlyaddTOC
- @ivanlanin #294- Fix specific borders (and margins) were not written correctly in word2007 writer - @pscheit #327
- "HTML is not a valid writer" exception while running "Sample_36_RTL.php" - @RomanSyroeshko #340
- "addShape()" magic method in AbstractContainer is mistakenly named as "addObject()" - @gmta #356
Element\Section::setPageSizeW()
andElement\Section::setPageSizeH()
were mentioned in the docs but not implemented.- Special Characters (ampersand) in Title break docx output - @RomanSyroeshko #401
<th>
tag is closed with</td>
tag: - @franzholz #438
Deprecated
Element\Link::getTarget()
replaced byElement\Link::getSource()
Element\Section::getSettings()
andElement\Section::setSettings()
replaced byElement\Section::getStyle()
andElement\Section::setStyle()
Shared\Drawing
andShared\Font
merged intoShared\Converter
DocumentProperties
replaced byMetadata\DocInfo
Template
replaced byTemplateProcessor
PhpWord->loadTemplate($filename)
Miscellaneous
- Docs: Add known issue on
README
about requirement for temporary folder to be writable and updatesamples/index.php
for this requirement check - @ivanlanin #238 - Docs: Correct elements.rst about Line - @chrissharkman #292
- PclZip: Remove temporary file after used - @andrew-kzoo #265
- Autoloader: Add the ability to set the autoloader options - @bskrtich #267
- Element: Refactor elements to move set relation Id from container to element - @ivanlanin
- Introduced CreateTemporaryFileException, CopyFileException - @RomanSyroeshko
- Settings: added method to set user defined temporary directory - @RomanSyroeshko #310
- Renamed
Template
intoTemplateProcessor
- @RomanSyroeshko #216 - Reverted #51. All text escaping must be performed out of the library - @RomanSyroeshko #51
v0.11.1
This is an immediate bugfix release for HTML reader.
- HTML Reader:
<p>
and header tags puts no output - @canyildiz @ivanlanin #257
v0.11.0
This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3. Four new elements were added: TextBox, ListItemRun, Field, and Line. Relative and absolute positioning for images and textboxes were added. Writer classes were refactored into parts, elements, and styles. ODT and RTF features were enhanced. Ability to add elements to PHPWord object via HTML were implemented. RTF and HTML reader were initiated.
Features
- Image: Ability to define relative and absolute positioning - @basjan #217
- Footer: Conform footer with header by adding firstPage, evenPage and by inheritance - @basjan @ivanlanin #219
- Element: New
TextBox
element - @basjan @ivanlanin #228, #229, #231 - HTML: Ability to add elements to PHPWord object via html - @basjan #231
- Element: New
ListItemRun
element that can add a list item with inline formatting like a textrun - @basjan #235 - Table: Ability to add table inside a cell (nested table) - @ivanlanin #149
- RTF Writer: UTF8 support for RTF: Internal UTF8 text is converted to Unicode before writing - @ivanlanin #158
- Table: Ability to define table width (in percent and twip) and position - @ivanlanin #237
- RTF Writer: Ability to add links and page breaks in RTF - @ivanlanin #196
- ListItemRun: Remove fontStyle parameter because ListItemRun is inherited from TextRun and TextRun doesn't have fontStyle - @ivanlanin
- Config: Ability to use a config file to store various common settings - @ivanlanin #200
- ODT Writer: Enable inline font style in TextRun - @ivanlanin
- ODT Writer: Enable underline, strike/doublestrike, smallcaps/allcaps, superscript/subscript font style - @ivanlanin
- ODT Writer: Enable section and column - @ivanlanin
- PDF Writer: Add TCPDF and mPDF as optional PDF renderer library - @ivanlanin
- ODT Writer: Enable title element and custom document properties - @ivanlanin
- ODT Reader: Ability to read standard and custom document properties - @ivanlanin
- Word2007 Writer: Enable the missing custom document properties writer - @ivanlanin
- Image: Enable "image float left" - @ivanlanin #244
- RTF Writer: Ability to write document properties - @ivanlanin
- RTF Writer: Ability to write image - @ivanlanin
- Element: New
Field
element - @basjan #251 - RTF Reader: Basic RTF reader - @ivanlanin #72, #252
- Element: New
Line
element - @basjan #253 - Title: Ability to apply numbering in heading - @ivanlanin #193
- HTML Reader: Basic HTML reader - @ivanlanin #80, #254
- RTF Writer: Basic table writing - @ivanlanin #245
Bugfixes
- Header: All images added to the second header were assigned to the first header - @basjan #222
- Conversion: Fix conversion from cm to pixel, pixel to cm, and pixel to point - @basjan #233, #234
- PageBreak: Page break adds new line in the beginning of the new page - @ivanlanin #150
- Image:
marginLeft
andmarginTop
cannot accept float value - @ivanlanin #248 - Title: Orphan
w:fldChar
caused OpenOffice to crash when opening DOCX - @ivanlanin #236
Deprecated
- Static classes
Footnotes
,Endnotes
, andTOC
Writer\Word2007\Part
:Numbering::writeNumbering()
,Settings::writeSettings()
,WebSettings::writeWebSettings()
,ContentTypes::writeContentTypes()
,Styles::writeStyles()
,Document::writeDocument()
all changed intowrite()
Writer\Word2007\Part\DocProps
: Split intoWriter\Word2007\Part\DocPropsCore
andWriter\Word2007\Part\DocPropsApp
Element\Title::getBookmarkId()
replaced byElement\Title::getRelationId()
Writer\HTML::writeDocument
: Replaced byWriter\HTML::getContent
Miscellaneous
- License: Change the project license from LGPL 2.1 into LGPL 3.0 - #211
- Word2007 Writer: New
Style\Image
class - @ivanlanin - Refactor: Replace static classes
Footnotes
,Endnotes
, andTOC
withCollections
- @ivanlanin #206 - QA: Reactivate
phpcpd
andphpmd
on Travis - @ivanlanin - Refactor: PHPMD recommendation: Change all
get...
method that returnsboolean
intois...
orhas...
- @ivanlanin - Docs: Create gh-pages branch for API documentation - @Progi1984 #154
- QA: Add
.scrutinizer.yml
and includecomposer.lock
for preparation to Scrutinizer - @ivanlanin #186 - Writer: Refactor writer parts using composite pattern - @ivanlanin
- Docs: Show code quality and test code coverage badge on README
- Style: Change behaviour of
set...
function of boolean properties; when none is defined, assumed true - @ivanlanin - Shared: Unify PHP ZipArchive and PCLZip features into PhpWord ZipArchive - @ivanlanin
- Docs: Create VERSION file - @ivanlanin
- QA: Improve dan update requirement check in
samples
folder - @ivanlanin