A pure PHP library for reading and writing word processing documents

Overview

PHPWord

Master: Latest Stable Version Build Status Code Quality Coverage Status Total Downloads License Join the chat at https://gitter.im/PHPOffice/PHPWord

Develop: Latest Development Version Build Status Code Quality Coverage Status

PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. The current version of PHPWord supports Microsoft Office Open XML (OOXML or OpenXML), OASIS Open Document Format for Office Applications (OpenDocument or ODF), Rich Text Format (RTF), HTML, and PDF.

PHPWord is an open source project licensed under the terms of LGPL version 3. PHPWord is aimed to be a high quality software product by incorporating continuous integration and unit testing. You can learn more about PHPWord by reading the Developers' Documentation.

If you have any questions, please ask on StackOverFlow

Read more about PHPWord:

Features

With PHPWord, you can create OOXML, ODF, or RTF documents dynamically using your PHP 5.3.3+ scripts. Below are some of the things that you can do with PHPWord library:

  • Set document properties, e.g. title, subject, and creator.
  • Create document sections with different settings, e.g. portrait/landscape, page size, and page numbering
  • Create header and footer for each sections
  • Set default font type, font size, and paragraph style
  • Use UTF-8 and East Asia fonts/characters
  • Define custom font styles (e.g. bold, italic, color) and paragraph styles (e.g. centered, multicolumns, spacing) either as named style or inline in text
  • Insert paragraphs, either as a simple text or complex one (a text run) that contains other elements
  • Insert titles (headers) and table of contents
  • Insert text breaks and page breaks
  • Insert and format images, either local, remote, or as page watermarks
  • Insert binary OLE Objects such as Excel or Visio
  • Insert and format table with customized properties for each rows (e.g. repeat as header row) and cells (e.g. background color, rowspan, colspan)
  • Insert list items as bulleted, numbered, or multilevel
  • Insert hyperlinks
  • Insert footnotes and endnotes
  • Insert drawing shapes (arc, curve, line, polyline, rect, oval)
  • Insert charts (pie, doughnut, bar, line, area, scatter, radar)
  • Insert form fields (textinput, checkbox, and dropdown)
  • Create document from templates
  • Use XSL 1.0 style sheets to transform headers, main document part, and footers of an OOXML template
  • ... and many more features on progress

Requirements

PHPWord requires the following:

Installation

PHPWord is installed via Composer. To add a dependency to PHPWord in your project, either

Run the following to use the latest stable version

    composer require phpoffice/phpword

or if you want the latest master version

    composer require phpoffice/phpword:dev-master

You can of course also manually edit your composer.json file

{
    "require": {
       "phpoffice/phpword": "v0.16.*"
    }
}

Getting started

The following is a basic usage example of the PHPWord library.

<?php
require_once 'bootstrap.php';

// Creating the new document...
$phpWord = new \PhpOffice\PhpWord\PhpWord();

/* Note: any element you append to a document must reside inside of a Section. */

// Adding an empty Section to the document...
$section = $phpWord->addSection();
// Adding Text element to the Section having font styled by default...
$section->addText(
    '"Learn from yesterday, live for today, hope for tomorrow. '
        . 'The important thing is not to stop questioning." '
        . '(Albert Einstein)'
);

/*
 * Note: it's possible to customize font style of the Text element you add in three ways:
 * - inline;
 * - using named font style (new font style object will be implicitly created);
 * - using explicitly created font style object.
 */

// Adding Text element with font customized inline...
$section->addText(
    '"Great achievement is usually born of great sacrifice, '
        . 'and is never the result of selfishness." '
        . '(Napoleon Hill)',
    array('name' => 'Tahoma', 'size' => 10)
);

// Adding Text element with font customized using named font style...
$fontStyleName = 'oneUserDefinedStyle';
$phpWord->addFontStyle(
    $fontStyleName,
    array('name' => 'Tahoma', 'size' => 10, 'color' => '1B2232', 'bold' => true)
);
$section->addText(
    '"The greatest accomplishment is not in never falling, '
        . 'but in rising again after you fall." '
        . '(Vince Lombardi)',
    $fontStyleName
);

// Adding Text element with font customized using explicitly created font style object...
$fontStyle = new \PhpOffice\PhpWord\Style\Font();
$fontStyle->setBold(true);
$fontStyle->setName('Tahoma');
$fontStyle->setSize(13);
$myTextElement = $section->addText('"Believe you can and you\'re halfway there." (Theodor Roosevelt)');
$myTextElement->setFontStyle($fontStyle);

// Saving the document as OOXML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('helloWorld.docx');

// Saving the document as ODF file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText');
$objWriter->save('helloWorld.odt');

// Saving the document as HTML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
$objWriter->save('helloWorld.html');

/* Note: we skip RTF, because it's not XML-based and requires a different example. */
/* Note: we skip PDF, because "HTML-to-PDF" approach is used to create PDF documents. */

More examples are provided in the samples folder. For an easy access to those samples launch php -S localhost:8000 in the samples directory then browse to http://localhost:8000 to view the samples. You can also read the Developers' Documentation for more detail.

Contributing

We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute.

Issues
  • Source code migration to PHP 5.3 features

    Source code migration to PHP 5.3 features

    As soon as minimal supported PHP version of PHPWord is 5.3 for now, it would be really cool to refactor source code and use new features (namespaces, for example).

    Migration guide from PHP 5.2.x to PHP 5.3.x could be found here. Tasks to do:

    @Progi1984, @gavroche, do we plan to do something like that?

    Change Request 
    opened by syroeshko 92
  • TemplateProcessor->setImageValue()

    TemplateProcessor->setImageValue()

    Allow to put images in templates.

    Fixes #1079 Fixes #939 Fixes #708

    Template Processor 
    opened by SailorMax 35
  • row span?

    row span?

    how do I create cells with rowspan more than 1?

    Consulting Request 
    opened by carlosrochap 34
  • Template too slow after 100 record.

    Template too slow after 100 record.

    Hi, Thanks for your product. I have problem with template clonerow. I have approx 150 record and template create document approx 500 second. is it normal?

    Consulting Request Responded Template Processor 
    opened by exproof 33
  • Impossible to open /results/Sample_07_TemplateCloneRow.docx (windows only)

    Impossible to open /results/Sample_07_TemplateCloneRow.docx (windows only)

    Hello,

    I have a problem with templates, using a WAMP server. I don't have any issue with the same process with a LAMP server.

    It's a LOCAL application, NOT on the internet. Word documents have been tested with LibreOffice and OpenOffice, same results.

    I'm working with the Sample_07_TemplateCloneRow example. With Linux : It works perfectly, I can open the file via http://...., but it is a "read only" version (that's fine, but NOT what I need) I can open, read and modify the "/results/Sample_07_TemplateCloneRow.docx" file in his folder (direct access in the folder)

    With Windows 7 (I tried with 2 different computers, same issue) I can open the file via http://, it works but it's NOT what I need ! I can save the document in my "downloads" folder. After that, I can open the new document but it is NOT what I need neither !

    I CANNOT open the "c:/[...]/results/Sample_07_TemplateCloneRow.docx", the file is "corrupted" (access denied) but it IS this one I need to open !

    After many, many, many tests, I found a way to open those files : right-click on the file -> Properties -> Security -> Modify -> Add a user -> I added my windows "username" (my OS is in french, i'm not quite sure with the english labels !)

    and then, it works, I can open my "c:/[...]/results/Sample_07_TemplateCloneRow.docx" It works, but it's really not an easy way for a daily use.

    Templates (07 & 23) are the only ones who makes troubles. IE, "/results/Sample_06_Footnote.docx" didn't need any manipulation before beeing open and have no owner neither. I have no problem with other generated files with or without PHPWord, only with those using TemplateProcessor.

    I do not understand what's the problem and think a little bit ironic to have rights/permissions issues with windows...

    Has someone a solution with this issue ? How can I solve it ?

    Without this problem, PHPWord is awesome !

    Windows 7 64bits Wamp Server 2.5 Apache 2.4.9 (Win 32) php 5.5.12 PHPWord Master 0.12.0

    Bug Report Open XML (Word 2007+) Template Processor 
    opened by AshSat 32
  • Update Requirments in the Readme

    Update Requirments in the Readme

    Please update the requirement in the ReadMe to include:

    PHP Extension ZipArchive PHP Extension libxml

    Change Request Documentation 
    opened by bskrtich 29
  • Regular releases

    Regular releases

    I've initiated two minor releases scheduled by the first day of the month. We will release those minor versions with whatever we have done by that date. Anything we can't finish, we will put to the next version. What do you think, guys?

    Consulting Request 
    opened by ivanlanin 28
  • Release 0.8.0

    Release 0.8.0

    Before release 0.8.0, could you

    • [x] 1 Test samples and test that the render is correct
    • [x] 2 Test unit test and verify no errors
    • [x] 3 Test PHPWord with your code and valid it
    • [x] 4 Verify Changelog and verify that nothing has been forgotten
    • [x] 5 Verify Readme.md and verify no errors

    Link : https://github.com/PHPOffice/PHPWord/blob/develop/changelog.txt

    CC : @gabrielbull (OK) @ivanlanin @RomanSyroeshko

    Change Request 
    opened by Progi1984 28
  • Special Characters (ampersand) in Title break docx output

    Special Characters (ampersand) in Title break docx output

    Hi,

    if you change Sample_17_TitleTOC.php to add a title including an &-sign

    $section->addTitle('Foo & Bar', 1);
    

    and select docx-Result the document won't open (tested in Word 2013): "The file ____ cannot be opened because of problems with the contents" Details: "Invalid char" Position: [position of the ampersand in document.xml]

    I did not test this with other characters but there might also be problems with ",',< and >

    I found this post which might indicate the problem. Escaping the character does not really help (see the StackOveflow-Thread linked above).

    If I find some time I will try to solve this issue and make a patch, but I just wanted to note it down here already. Maybe someone has a note or already solved it somehow :-)

    Regards

    Bug Report Open XML (Word 2007+) 
    opened by jonnsn 27
  • Table of contents numbers missing

    Table of contents numbers missing

    I have an issue where my TOC is being generated without the page numbers,

    image

    can someone help me with this, thanks in advance


    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    opened by kemar-stpatrick876 25
  • Update elements.rst

    Update elements.rst

    Fix error on comments code snippet.

    Description

    Changed the wrong call setCommentStart to setCommentRangeStart in the documentation.

    Fixes # (issue)

    Not working example.

    Checklist:

    • [X ] I have updated the documentation to describe the changes

    There are no code changes.

    • [ ] I have run composer run-script check --timeout=0 and no errors were reported
    • [ ] The new code is covered by unit tests (check build/coverage for coverage report)
    opened by laminga 0
  • Copy Header and Footer from one document to another

    Copy Header and Footer from one document to another

    Greetings,

    we are reading the footer and header from one Word doc and trying to write it to another but are stuck. We were thinking something like this:

    
        $originalFooter = $template->getSection(0)->getFooter();
        $newFooter = $newDoc->getSection(0)->addFooter($originalFooter);
    
    

    That does not work, addFooter doesn't take parameters as far as I can tell. Then we've spent an hour trying around a dozen different ways along the lines of

    $originalFooterText = $template->getSection(0)->getFooter()->getText();
      $newFooter = $newDoc->getSection(0)->addFooter();
      $newFooter->addText($originalFooterText);
    

    and getElements and some forEaches and whatnot but to no avail. From what I can tell, there is no way to do this.

    If this is correct, we are asking to add another function to addText etc. in the form of ->setFooter($footerClassElement).

    Is there any other way to do this?

    Change Request 
    opened by halest 0
  • Paragraph styling isn't recognised

    Paragraph styling isn't recognised

    Describe the Bug

    Using TemplateProcessor, I'm unable to set paragraph styling (in other words, setting line-height). It doesn't seem to react to it whatsoever.

    However, FontStyle works just fine.

    This happens while using TextRun()->addText().

    Steps to Reproduce

    Please provide a code sample that reproduces the issue.

    <?php
    $template = new \PhpOffice\PhpWord\TemplateProcessor('mytemplate.docx');
    
    $txtContent = new \PhpOffice\PhpWord\Element\TextRun();
    $desc = "Hello, World!";
    $body_txt_style = array();
    $txtContent->addText($desc, $body_txt_style, $body_pg_style);
    
    $template->setComplexBlock("description_body", $txtContent);
    

    Expected Behavior

    A line-height of 1.5 should be visible on the text that has been outputted in the document.

    Current Behavior

    Line height remains at 1.0 and even ignores the line-height of the template variable (which is set to 1.5)

    Context

    Please fill in your environment information:

    • PHP Version: 7
    • PHPWord Version: 0.18.2
    Bug Report 
    opened by Aeka123 0
  • Sample 11 ReadWord2007 Fails formatting when converting to HTML and PDF

    Sample 11 ReadWord2007 Fails formatting when converting to HTML and PDF

    Describe the Bug

    I am looking at displaying Doc/Docx in a webpage. I am testing with the samples currently. Sample 11 ReadWord2007 Fails formatting when converting to HTML and PDF (The only modification was removing other formats from the $writers). All of the text shows up, but none of the major formatting is there. Specifically, the multicolumn paragraph is not in a column, but a paragraph like the rest. Also, none of the list formats show up, such as bullet points and numbering, it just shows as words on new lines. I also noticed when trying with different .docx, it appears images are just full size, and not sized at all.

    Something to note is that I have all passes on the checks done by /samples/index.php

    Steps to Reproduce

    I cloned the git repo, ran composer, and then php -S localhost:8000 in the /samples directory. Specifically, I am running samples 11 (A/B or doc/docx).

    Expected Behavior

    It seems based on the text that is in sample .docx that the format should be preserved.

    Current Behavior

    Just text is converted. Something to note: size and text formatting is saved (Italic, bold, ect.).

    Context

    Please fill in your environment information:

    • PHP Version: php -v --> PHP 8.0.7 (cli) (built: Jun 2 2021 04:04:16)
    • PHPWord Version: tried 18.2, master, and develop tags/braches
    Bug Report 
    opened by AlexOConnorHub 1
  • Add multiple tables to word template

    Add multiple tables to word template

    Describe the Bug

    I am going to add two tables called ${plottable_2a} and ${plottable_2b}. But when I insert the first table, it removes the other template code ${plottable_2b}. So I could insert only 1 table. https://www.screenpresso.com/=5Su4f

    Steps to Reproduce

    Please provide a code sample that reproduces the issue.

    <?php
    require __DIR__ . '/vendor/autoload.php';
    
    $labelKey = 0;
          $plotLabel='';
    			foreach ($get_plots_imgdata as $pimage){
            foreach($get_images as $images){
              if($plotLabel != $pimage['plotname']) {
                $labelKey = 0; 
              }
              $plotLabel= $pimage['plotname'];
    					if($pimage['pid'] == $images['plot_id']){
                // var_dump($pimage['plotname'].$pLabel[$labelKey]);
                $table = new Table(array('borderSize' => 1, 'borderColor' => 'black', 'width' => '100%', 'cellMargin'  => 80, 'unit' => TblWidth::PERCENT));
                $table->addRow();
                $table->addCell(10000, array('bgColor' => '424242', 'valign' => 'center', 'gridSpan' => 2))->addText('Plot '.$pimage['plotname'].$pLabel[$labelKey], array('size' => 12, 'bold' => true, 'color' => 'white', 'alignment' => Jc::CENTER));
                $table->addRow();
                $table->addCell(3500, array('valign' => 'center', 'bgColor' => 'f1f1f1'))->addText('Existing', array('bold' => true));
                $table->addCell(6500, array('valign' => 'center'))->addText($pimage['cat_name']);
                $table->addRow();
                $table->addCell(3500, array('valign' => 'center', 'bgColor' => 'f1f1f1'))->addText('Post Development', array('bold' => true));
                $table->addCell(6500, array('valign' => 'center'))->addText($pimage['cat_name']);
                $table->addRow();
                $table->addCell(3500, array('valign' => 'center', 'bgColor' => 'f1f1f1'))->addText('Effective Slope', array('bold' => true));
                
                $cname=$pimage['class_name'];
                if($cname=='ef' || $cname=='ee' || $cname=='eef' || $cname=='ea' || $cname=='eb' || $cname=='ec' || $cname=='ed' ){
                  $table->addCell(6500, array('valign' => 'center'))->addText('Null');
                }else{
                  if($pimage['direction']==0)     //if slope is 0 deg
                    $table->addCell(6500, array('valign' => 'center'))->addText('Upslope/0');
                  else                            
                    $table->addCell(6500, array('valign' => 'center'))->addText('Downslope/'.$pimage['direction']);
                }
                $table->addRow();
                $table->addCell(3500, array('valign' => 'center', 'bgColor' => 'f1f1f1'))->addText('Photo ID', array('bold' => true));
                $table->addCell(6500, array('valign' => 'center'))->addText($pimage['plotname'].$pLabel[$labelKey]);
                $table->addRow();
                // $table->addCell(10000, array('valign' => 'center', 'gridSpan' => 2))->addText("".$pimage['pdesc']."");
                $table->addCell(10000, array('valign' => 'center', 'gridSpan' => 2))->addText("sdf asdfasdfasdfas fasdfwefwf asdfa sdfasdfasd fasdfwefwadfa sdfasd asdf wefwewef asdfasdfa sdfertted yjtj rtyjutyj.");
                $table->addRow();
                $table->addCell(10000, array('valign' => 'center', 'gridSpan' => 2))->addText('${plotimage'.$pimage['plotname'].$pLabel[$labelKey].'}');
                // $templateProcessor->setImageValue('plotimage'.$pimage['plotname'].$pLabel[$labelKey], array('path' => imagekit_jobcomplete_bucket() . 'upload/plot_img/'.$images['plot_image'], 'width' => 650, 'height' => 500, 'ratio' => true));
                $templateProcessor->setComplexBlock('plottable_'.$pimage['plotname'].$pLabel[$labelKey], $table);
                $labelKey ++;
    					}
    				}
    			}
    
    ### Expected Behavior
    
    Add multiple tables. 1 table per template code
    
    ### Current Behavior
    
    Could insert only 1 table
    
    ### Context
    
    Please fill in your environment information:
    
    - PHP Version: 7.3
    - PHPWord Version: 0.18.2
    
    Bug Report 
    opened by traininggroupllc 0
  • Heading with border? How to add border to Heading? Plz

    Heading with border? How to add border to Heading? Plz

    Hi everyone,

    I am trying to add border into Heading for two case, inline and block, like this:

    image

    I am using HTML:

    <h1 style="border: 1px #000000 solid; background-color: yellow;">Heading 1</h1>

    But not working.

    How can I create a heading with border like above?

    Red dashed and black solid borders?

    Thanks so much!

    Bug Report 
    opened by khanhpkvn 0
  • BorderStyle

    BorderStyle

    Describe the Bug

    We got Border Class (PhpOffice\PhpWord\Style\Border) with Border(TLRB)Style props, but we can't use it anywhere - for Table, Cell styles. Current addTable, addCell even addTableStyle methods doesn't support BorderStyle props. Also we got PhpOffice\PhpWord\SimpleType\Border with border-style consts, but we can't use it. (@since 0.18.0)

    Steps to Reproduce

    Please provide a code sample that reproduces the issue. use PhpOffice\PhpWord\SimpleType\Border; use PhpOffice\PhpWord\Style;

    $tableStyle = ['borderColor' => '006699', 'borderSize' => 50, 'borderTopStyle' => Border::DOUBLE]; $phpWord->addTableStyle('myTable', $tableStyle); $table = $section->addTable('myTable');

    Expected Behavior

    Table and Cell Styles methods must support border style properties.

    Current Behavior

    Methods doesn't support BorderStyle props.

    Context

    Please fill in your environment information:

    • PHP Version: All
    • PHPWord Version: 0.18.1
    Bug Report 
    opened by DShkrabak 1
  • ampersand in content creating corrupt docx file

    ampersand in content creating corrupt docx file

    content has ampersand sign 'B&B', which is causing file corrupt. I have tried solutions given here on github but doesn't work in my case.anyone have any idea how to correct this issue?its really urgent I will be grateful for help

    Steps to Reproduce

    Please provide a code sample that reproduces the issue.

    <?php
      WordSettings::setOutputEscapingEnabled(false);
          $phpWord = new PhpWord('Word2007');
          $section = $phpWord->addSection();
         Html::addHtml($section, $content);
          $xmlWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY, './', WordSettings::hasCompatibility());
           $containerWriter = new Container($xmlWriter, $section);
         $containerWriter->write();
         $htmlAsXml = $xmlWriter->getData();
          $templateProcessor->setValue('session_content',$htmlAsXml);
            WordSettings::setOutputEscapingEnabled(true);
      $templateProcessor->saveAs(storage_path('app\training.docx'));
    

    Current Behavior

    creating corrupt file

    Bug Report 
    opened by kalibano 6
  • 🚨 Potential Deserialization of Untrusted Data

    🚨 Potential Deserialization of Untrusted Data

    👋 Hello, @troosan, @ivanlanin, @Progi1984 - a potential critical severity Deserialization of Untrusted Data vulnerability in your repository has been disclosed to us.

    Next Steps

    1️⃣ Visit https://huntr.dev/bounties/2-other-PHPOffice/PHPWord for more advisory information.

    2️⃣ Sign-up to validate or speak to the researcher for more assistance.

    3️⃣ Propose a patch or outsource it to our community - whoever fixes it gets paid.


    Confused or need more help?

    • Join us on our Discord and a member of our team will be happy to help! 🤗

    • Speak to a member of our team: @JamieSlome


    This issue was automatically generated by huntr.dev - a bug bounty board for securing open source code.

    opened by huntr-helper 0
  • 🚨 Potential Cross-site Scripting (XSS) - Generic

    🚨 Potential Cross-site Scripting (XSS) - Generic

    👋 Hello, @troosan, @ivanlanin, @Progi1984 - a potential high severity Cross-site Scripting (XSS) - Generic vulnerability in your repository has been disclosed to us.

    Next Steps

    1️⃣ Visit https://huntr.dev/bounties/1-other-PHPOffice/PHPWord for more advisory information.

    2️⃣ Sign-up to validate or speak to the researcher for more assistance.

    3️⃣ Propose a patch or outsource it to our community - whoever fixes it gets paid.


    Confused or need more help?

    • Join us on our Discord and a member of our team will be happy to help! 🤗

    • Speak to a member of our team: @JamieSlome


    This issue was automatically generated by huntr.dev - a bug bounty board for securing open source code.

    opened by huntr-helper 0
Releases(0.18.2)
  • 0.18.2(Jun 4, 2021)

    Bug fixes

    • when adding image to relationship first check that the generated RID is actually unique #2063 (tpv-ebben)
    • Update chart, don't write 'c:overlap' if grouping is 'clustered' #2052 (dfsd534)
    • Update Html parser to accept line-height:normal #2041 (joelgo)
    • Fix image border in Word2007 Writer for LibreOffice 7 #2021 (kamilmmach)

    Miscellaneous

    Source code(tar.gz)
    Source code(zip)
  • 0.18.1(Mar 7, 2021)

  • 0.18.0(Feb 12, 2021)

    Enhancements

    Bug fixes

    • Fix image stroke in libreoffice 7.x #1992 (Adizbek)
    • Fix deprecated warning for non-hexadecimal number #1988 (Ciki)
    • Fix limit not taken into account when adding image in template #1967 (jsochor)
    • Add null check when setComplexValue is not found #1936 (YannikFirre)
    • Some document have non-standard locale code #1824 (ErnestStaug)
    • Fixes PHPDoc @param and @return types for several Converter methods #1818 (caugner)
    • Update the regexp to avoid catastrophic backtracking #1809 (juzser)
    • Fix PHPUnit tests on develop branch #1771 (mdupont)
    • TemplateProcessor cloneBlock wrongly clones images #1763 (alarai)

    Miscellaneous

    Source code(tar.gz)
    Source code(zip)
  • 0.17.0(Oct 1, 2019)

    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

    • Use embedded http server to test loading of remote images @troosan #1544
    • Change private to protected to be able extending class Html @SpinyMan #1646
    • Fix apt-get crash in Travis CI for PHP 5.3 @mdupont #1707
    Source code(tar.gz)
    Source code(zip)
  • 0.16.0(Dec 29, 2018)

    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
    Source code(tar.gz)
    Source code(zip)
  • 0.15.0(Jul 14, 2018)

    Added

    • Parsing of align HTML attribute - @troosan #1231
    • Parse formatting inside HTML lists - @troosan @samimussbach #1239 #945 #1215 #508
    • Parsing of CSS direction instruction, HTML lang 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 from px to pt.

    Miscelaneous

    • Drop GitHub pages, switch to coveralls for code coverage analysis @czosel #1360
    Source code(tar.gz)
    Source code(zip)
  • 0.14.0(Dec 28, 2017)

    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();
    Source code(tar.gz)
    Source code(zip)
  • 0.13.0(Jul 31, 2016)

    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 of NumberingLevel, Frame, Table, and Paragraph styles into alignment. - @RomanSyroeshko
    • Improved performance of TemplateProcessor::setValue(). - @kazitanvirahsan #614, #617

    Deprecated

    • getAlign and setAlign methods of NumberingLevel, Frame, Table, and Paragraph styles. Use the correspondent getAlignment and setAlignment methods instead. - @RomanSyroeshko
    • left, right, and justify alignment options for paragraphs (now are mapped to Jc::START, Jc::END, and Jc::BOTH). - @RomanSyroeshko
    • left, right, and justify alignment options for tables (now are mapped to Jc::START, Jc::END, and Jc::CENTER). - @RomanSyroeshko
    • TCPDF due to its limited HTML support. Use DomPDF or MPDF 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 (see bootstrap.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 #658
    • AbstractContainer::addMemoryImage(). Use AbstractContainer::addImage() instead.

    Fixed

    • Undefined property error while reading MS-DOC documents. - @jaberu #610
    • Corrupted OOXML template issue in case when its names is broken immediately after $ sign. That case wasn't taken into account in implementation of TemplateProcessor::fixBrokenMacros(). - @RomanSyroeshko @d-damien #548
    Source code(tar.gz)
    Source code(zip)
  • 0.12.1(Aug 30, 2015)

    Maintenance release. This release is focused primarily on TemplateProcessor.

    Changes

    • Changed visibility of all private properties and methods of TemplateProcessor to protected. - @RomanSyroeshko #498
    • Improved performance of TemplateProcessor::setValue(). - @RomanSyroeshko @nicoSWD #513

    Bugfixes

    • Fixed issue with "Access denied" message while opening Sample_07_TemplateCloneRow.docx and Sample_23_TemplateBlock.docx result files on Windows platform. - @RomanSyroeshko @AshSat #532
    • Fixed PreserveText element alignment in footer (see Sample_12_HeaderFooter.php). - @RomanSyroeshko @SSchwaiger #495
    Source code(tar.gz)
    Source code(zip)
  • 0.12.0(Jan 3, 2015)

    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, and kerning 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 encapsulate IOFactory - @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 only addTOC - @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() and Element\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 by Element\Link::getSource()
    • Element\Section::getSettings() and Element\Section::setSettings() replaced by Element\Section::getStyle() and Element\Section::setStyle()
    • Shared\Drawing and Shared\Font merged into Shared\Converter
    • DocumentProperties replaced by Metadata\DocInfo
    • Template replaced by TemplateProcessor
    • PhpWord->loadTemplate($filename)

    Miscellaneous

    • Docs: Add known issue on README about requirement for temporary folder to be writable and update samples/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 into TemplateProcessor - @RomanSyroeshko #216
    • Reverted #51. All text escaping must be performed out of the library - @RomanSyroeshko #51
    Source code(tar.gz)
    Source code(zip)
  • 0.11.1(Jun 2, 2014)

  • 0.11.0(Jun 1, 2014)

    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 and marginTop cannot accept float value - @ivanlanin #248
    • Title: Orphan w:fldChar caused OpenOffice to crash when opening DOCX - @ivanlanin #236

    Deprecated

    • Static classes Footnotes, Endnotes, and TOC
    • Writer\Word2007\Part: Numbering::writeNumbering(), Settings::writeSettings(), WebSettings::writeWebSettings(), ContentTypes::writeContentTypes(), Styles::writeStyles(), Document::writeDocument() all changed into write()
    • Writer\Word2007\Part\DocProps: Split into Writer\Word2007\Part\DocPropsCore and Writer\Word2007\Part\DocPropsApp
    • Element\Title::getBookmarkId() replaced by Element\Title::getRelationId()
    • Writer\HTML::writeDocument: Replaced by Writer\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, and TOC with Collections - @ivanlanin #206
    • QA: Reactivate phpcpd and phpmd on Travis - @ivanlanin
    • Refactor: PHPMD recommendation: Change all get... method that returns boolean into is... or has... - @ivanlanin
    • Docs: Create gh-pages branch for API documentation - @Progi1984 #154
    • QA: Add .scrutinizer.yml and include composer.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
    Source code(tar.gz)
    Source code(zip)
  • 0.10.1(May 21, 2014)

    This is a bugfix release for php-zip requirement in Composer.

    • Change Composer requirements for php-zip from require to suggest - @bskrtich #246
    Source code(tar.gz)
    Source code(zip)
  • 0.10.0(May 4, 2014)

    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.

    Features

    • Image: Get image dimensions without EXIF extension - @andrew-kzoo #184
    • Table: Add tblGrid element for Libre/Open Office table sizing - @gianis6 #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 #168
    • Table: Add exactHeight to row style to define whether row height should be exact or atLeast - @jcarignan #168
    • Element: New CheckBox element for sections and table cells - @ozilion #156
    • Settings: Ability to use PCLZip as alternative to ZipArchive - @bskrtich @ivanlanin #106, #140, #185
    • Template: Ability to find & replace variables in headers & footers - @dgudgeon #190
    • Template: Ability to clone & delete block of text using cloneBlock and deleteBlock - @diego-vieira #191
    • TOC: Ability to have two or more TOC in one document and to set min and max depth for TOC - @Pyreweb #189
    • Table: Ability to add footnote in table cell - @ivanlanin #187
    • Footnote: Ability to add image in footnote - @ivanlanin #187
    • ListItem: Ability to add list item in header/footer - @ivanlanin #187
    • CheckBox: Ability to add checkbox in header/footer - @ivanlanin #187
    • Link: Ability to add link in header/footer - @ivanlanin #187
    • Object: Ability to add object in header, footer, textrun, and footnote - @ivanlanin #187
    • Media: Add Media::resetElements() to reset all media data - @juzi #19
    • General: Add Style::resetStyles() - @ivanlanin #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 #10, #198
    • ODT Writer: Basic table writing support - @ivanlanin
    • Image: Keep image aspect ratio if only 1 dimension styled - @japonicus #194
    • HTML Writer: Basic HTML writer: text, textrun, link, title, textbreak, table, image (as Base64), footnote, endnote - @ivanlanin #203, #67, #147
    • PDF Writer: Basic PDF writer using DomPDF: All HTML element except image - @ivanlanin #68
    • DOCX Writer: Change docProps/app.xml Application to PHPWord - @ivanlanin
    • DOCX Writer: Create word/settings.xml and word/webSettings.xml dynamically - @ivanlanin
    • ODT Writer: Basic image writing - @ivanlanin
    • ODT Writer: Link writing - @ivanlanin
    • ODT Reader: Basic ODText Reader - @ivanlanin #71
    • Section: Ability to define gutter and line numbering - @ivanlanin
    • Font: Small caps, all caps, and double strikethrough - @ivanlanin #151
    • Settings: Ability to use measurement unit other than twips with setMeasurementUnit - @ivanlanin #199
    • Style: Remove bgColor from Font, Table, and Cell and put it into the new Shading style - @ivanlanin
    • Style: New Indentation and Spacing style - @ivanlanin
    • Paragraph: Ability to define first line and right indentation - @ivanlanin

    Bugfixes

    • Footnote: Footnote content doesn't show footnote reference number - @ivanlanin #170
    • Documentation: Error in a function - @theBeerNut #195

    Deprecated

    • createTextRun replaced by addTextRun
    • createFootnote replaced by addFootnote
    • createHeader replaced by addHeader
    • createFooter replaced by addFooter
    • createSection replaced by addSection
    • Element\Footnote::getReferenceId replaced by Element\AbstractElement::getRelationId
    • Element\Footnote::setReferenceId replaced by Element\AbstractElement::setRelationId
    • Footnote::addFootnoteLinkElement replaced by Media::addElement
    • Footnote::getFootnoteLinkElements replaced by Media::getElements
    • All current methods on Media
    • Element\Link::getLinkSrc replaced by Element\Link::getTarget
    • Element\Link::getLinkName replaced by Element\Link::getText
    • Style\Cell::getDefaultBorderColor

    Miscellaneous

    • Documentation: Simplify page level docblock - @ivanlanin #179
    • Writer: Refactor writer classes and create a new Write\AbstractWriter abstract class - @ivanlanin #160
    • General: Refactor folders: Element and Exception - @ivanlanin #187
    • General: Remove legacy HashTable and Shared\ZipStreamWrapper and all related properties/methods - @ivanlanin #187
    • Element: New AbstractElement abstract class - @ivanlanin #187
    • Media: Refactor media class to use one method for all docPart (section, header, footer, footnote) - @ivanlanin #187
    • General: Remove underscore prefix from all private properties name - @ivanlanin #187
    • General: Move Section Settings to Style\Section - @ivanlanin #187
    • General: Give Abstract prefix and Interface suffix for all abstract classes and interfaces as per PHP-FIG recommendation - @ivanlanin #187
    • Style: New Style\AbstractStyle abstract class - @ivanlanin #187
    • Writer: New 'ODText\Base` class - @ivanlanin #187
    • General: Rename Footnote to Footnotes 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 #59
    • Refactor: Remove Style\Tabs - @ivanlanin
    • Refactor: Apply composite pattern for writers - @ivanlanin
    • Refactor: Split AbstractContainer from AbstractElement - @ivanlanin
    • Refactor: Apply composite pattern for Word2007 reader - @ivanlanin
    Source code(tar.gz)
    Source code(zip)
  • 0.9.1(Mar 27, 2014)

  • 0.9.0(Mar 26, 2014)

    This release marked the transformation to namespaces (PHP 5.3+).

    Features

    • 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

    Bugfixes

    • Preserve text doesn't render correctly when the text is not the first word, e.g. 'Page {PAGE}' - @ivanlanin

    Miscellaneous

    • Move documentation to Read The Docs - @Progi1984 @ivanlanin #82
    • Reorganize and redesign samples folder - @ivanlanin #137
    • Use PhpOffice\PhpWord namespace for PSR compliance - @RomanSyroeshko @gabrielbull #159, #58
    • Restructure folders and change folder name Classes to src and Tests to test for PSR compliance - @RomanSyroeshko @gabrielbull
    • Compliance to phpDocumentor - @ivanlanin
    • Merge Style\TableFull into Style\Table. Style\TableFull is deprecated - @ivanlanin #160
    • Merge Section\MemoryImage into Section\Image. Section\Image is deprecated - @ivanlanin #160
    Source code(tar.gz)
    Source code(zip)
  • 0.8.1(Mar 16, 2014)

    This is a bugfix release for image detection functionality.

    • Added fallback for computers that do not have exif_imagetype - @bskrtich, @gabrielbull
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Mar 15, 2014)

    This release merged a lot of improvements from the community. Unit tests introduced in this release and has reached 90% code coverage.

    Features

    • Template: Permit to save a template generated as a file (PHPWord_Template::saveAs()) - @RomanSyroeshko #56, #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 #5
    • General: Add ability to manage line breaks after image insertion - @bskrtich #6, #66, #84
    • Template: Ability to limit number of replacements performed by setValue() method of Template class - @RomanSyroeshko #52, #53, #85
    • Table row: Repeat as header row & allow row to break across pages - @ivanlanin #48, #86
    • Table: Table width in percentage - @ivanlanin #48, #86
    • Font: Superscript and subscript - @ivanlanin #48, #86
    • Paragraph: Hanging paragraph - @ivanlanin #48, #86
    • Section: Multicolumn and section break - @ivanlanin #48, #86
    • Template: Ability to apply XSL style sheet to Template - @RomanSyroeshko #46, #47, #83
    • General: PHPWord_Shared_Font::pointSizeToTwips() converter - @ivanlanin #87
    • Paragraph: Ability to define normal paragraph style with PHPWord::setNormalStyle() - @ivanlanin #87
    • Paragraph: Ability to define parent style (basedOn) and style for following paragraph (next) - @ivanlanin #87
    • Clone table rows on the fly when using a template document - @jeroenmoors #44, #88
    • Initial addition of basic footnote support - @deds #16
    • Paragraph: Ability to define paragraph pagination: widow control, keep next, keep lines, and page break before - @ivanlanin #92
    • General: PHPWord_Style_Font refactoring - @ivanlanin #93
    • Font: Use points instead of halfpoints internally. Conversion to halfpoints done during XML Writing. - @ivanlanin #93
    • Paragraph: setTabs() function - @ivanlanin #92
    • General: Basic support for TextRun on ODT and RTF - @ivanlanin #99
    • Reader: Basic Reader for Word2007 - @ivanlanin #104
    • TextRun: Allow Text Break in Text Run - @bskrtich #109
    • General: Support for East Asian fontstyle - @jhfangying #111, #118
    • Image: Use exif_imagetype to check image format instead of extension name - @gabrielbull #114
    • General: Setting for XMLWriter Compatibility option - @bskrtich #103
    • MemoryImage: Allow remote image when allow_url_open = on - @ivanlanin #122
    • TextBreak: Allow font and paragraph style for text break - @ivanlanin #18

    Bugfixes

    • 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 #51
    • Example in README.md is broken - @Progi1984 #89
    • General: PHPWord_Shared_Drawing::centimetersToPixels() conversion - @ivanlanin #94
    • Footnote: Corrupt DOCX reported by MS Word when sections > 1 and not every sections have footnote - @ivanlanin #125

    Miscellaneous

    • UnitTests - @Progi1984
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Feb 12, 2014)

    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.

    Features

    • Implement RTF Writer - @Progi1984 #1
    • Implement ODT Writer - @Progi1984 #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

    Bugfixes

    • "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found - @RomanSyroeshko #32
    • PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input - @RomanSyroeshko #34
    • Temporary files naming logic in PHPWord_Template can lead to a collision - @RomanSyroeshko #38

    Miscellaneous

    • Add superscript/subscript styling in Excel2007 Writer - @MarkBaker
    • add indentation support to paragraphs - @deds
    • Support for Composer - @Progi1984 #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 #49
    Source code(tar.gz)
    Source code(zip)
A pure PHP library for reading and writing presentations documents

Branch Master : Branch Develop : PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation fi

PHPOffice 1.1k Jun 15, 2021
A pure PHP library for reading and writing spreadsheet files

PhpSpreadsheet PhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file f

PHPOffice 10k Jun 15, 2021
Read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

Spout Spout is a PHP library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way. Contrary to other file readers or wr

Box 3.5k Jun 14, 2021
🚀 Supercharged Excel exports and imports in Laravel

Supercharged Excel exports and imports A simple, but elegant Laravel wrapper around PhpSpreadsheet exports and imports. Quickstart · Documentation · V

Maatwebsite 9.9k Jun 13, 2021
Simple yet powerful Excel manipulation library for PHP 5.4+

| | \ / \_/ __ /^\ __ ' `. \_/ ,' ` \/ \/ _,--./| |\.--._ _,' _.-\_/-._ `._ | / \ | |

Wisembly 66 Mar 25, 2021
🦉 Fast Excel import/export for Laravel

Fast Excel import/export for Laravel, thanks to Spout. See benchmarks below. Quick start Install via composer: composer require rap2hpoutre/fast-excel

Raphaël Huchet 1.2k Jun 11, 2021
an excel export/import tool for laravel based on php-xlswriter

Laravel-xlswriter 一款基于xlswriter的laravel扩展包 php-xlswriter是一款高性能的excel读写扩展,laravel-xlswriter基于该扩展做了封装,旨在提供一个便于使用的xlswriter的laravel工具包。 目前laravel-xlswrit

lysice 5 May 6, 2021
Merge Excel Files to single excel file per columns

Merge Excel Files to single excel file per columns

Max Base 3 Apr 26, 2021
ARCHIVED

PHPExcel - DEAD PHPExcel last version, 1.8.1, was released in 2015. The project was officially deprecated in 2017 and permanently archived in 2019. Th

PHPOffice 11.4k Jun 21, 2021