Skip to content

loss word 2007 format/ style #753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
105 commits merged into from
Jul 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
2a5c667
#51 (updated tests, refactored a little).
Feb 6, 2015
8bb4573
#51 (updated tests, refactored a little).
Feb 6, 2015
cc305bc
Fixed broken paragraph alignment for OpenXml.
Feb 21, 2015
4eefb60
#51 (updated tests, refactored a little).
Feb 21, 2015
f902549
Minor refactoring.
Feb 21, 2015
2c040d2
Minor refactoring.
Feb 21, 2015
25a5ba2
Minor refactoring.
Feb 21, 2015
fbdd5f1
Minor refactoring.
Feb 21, 2015
e0dea8e
Fixed broken paragraph alignment for OpenXml.
Feb 21, 2015
cb6ad0e
Fixed broken paragraph alignment for OpenXml.
Feb 21, 2015
17ee9e1
Fixed broken paragraph alignment for OpenXml.
Mar 1, 2015
18c5462
Fixed broken paragraph alignment for OpenXml.
Mar 1, 2015
f2cd42f
#495.
Mar 22, 2015
0198aec
#495.
Mar 22, 2015
a38ec77
#495.
Mar 22, 2015
8e9f865
Removed typo.
Mar 22, 2015
75022c5
#495.
Mar 22, 2015
f33abcd
Performance improvement for #513.
Apr 11, 2015
520a7a8
Performance improvement for #513.
Apr 11, 2015
a5c3645
Performance improvement for #513.
Apr 11, 2015
b7387be
Reimplemented #498.
Apr 14, 2015
d5e276a
Reimplemented #498.
Apr 14, 2015
fef4a36
Implementation for #371.
Apr 14, 2015
6ef9ac2
Merge remote-tracking branch 'origin/develop' into develop
Apr 14, 2015
9770f44
Shortened names of ``TemplateProcessor`` properties.
Apr 14, 2015
4212c7e
Added Gitter badge.
May 26, 2015
7fdc50b
Changed Gitter badge to the Shields version.
May 26, 2015
1cd4fbf
Performance improvement for #513.
Jun 2, 2015
1383cef
Performance improvement for #513.
Jun 2, 2015
26b0eac
`.travis.yml` clanup.
Jun 23, 2015
858ab18
`.travis.yml` cleanup.
Jun 23, 2015
1b56db2
`.travis.yml` cleanup.
Jun 23, 2015
7a2125c
`.travis.yml` cleanup.
Jun 23, 2015
988eaca
Fix for #532.
Jul 2, 2015
db8221d
Fix for #532.
Jul 2, 2015
07e0d4c
Fix for #532.
Jul 2, 2015
637c2bc
Playing with Travis CI.
Jul 2, 2015
c1cfd50
Playing with Travis CI.
Jul 2, 2015
b0ff13c
Playing with Travis CI.
Jul 2, 2015
cd2e7f7
Playing with Travis CI.
Jul 4, 2015
75b479f
Removed redundant *.md documentation.
Aug 8, 2015
90295fe
#532.
Aug 16, 2015
adf20d3
#513.
Aug 30, 2015
3a58c81
Released v0.12.1.
Aug 30, 2015
a123ce4
Template processor setValue() improvements #614
kazitanvirahsan Sep 10, 2015
873d41a
Update Template processor setValue() improvements #614
kazitanvirahsan Sep 10, 2015
b446a23
Update 2 Template processor setValue() improvements #614
kazitanvirahsan Sep 10, 2015
94c0d02
Next round of refactoring of alignment-related functionality.
Oct 10, 2015
505cc76
Fixed build.
Oct 10, 2015
12823a5
Fixed build.
Oct 10, 2015
09e5e35
Changed init value of the NumberingLevel.alignment property.
Oct 21, 2015
d3908de
Updated change log due to the changes previously committed.
Oct 23, 2015
d74c0bd
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
3965f11
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
015a34f
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
f884527
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
e3c8852
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
4ebd668
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
e24fec7
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
e771b47
Added backward compatibility for deprecated alignment options.
Nov 14, 2015
c75bbf1
Merge branch 'master' into develop
Nov 14, 2015
ef3c3b8
Reorganized unit tests.
Nov 15, 2015
c75056f
Reorganized unit tests.
Nov 15, 2015
95c0971
Reorganized unit tests.
Nov 15, 2015
e6d73d8
Removed custom autoloader.
Nov 21, 2015
43fb23d
Copyright update.
Dec 5, 2015
7bd6cbd
Copyright update.
Dec 5, 2015
9f0b437
Copyright update.
Dec 5, 2015
529edcb
Merge pull request #617 from kazitanvirahsan/develop
Dec 12, 2015
5781f65
#617.
Dec 12, 2015
f359825
Reviewed and merged #658.
Jan 23, 2016
3981e01
Add PHP 7.0 into the build script.
Jan 23, 2016
ea4388d
Improved coverage for `\PhpOffice\PhpWord\Element\Section` (#665).
Jan 23, 2016
a621447
Improved coverage for `\PhpOffice\PhpWord\Element\Section` (#665).
Jan 23, 2016
8bc2364
Improved coverage for `\PhpOffice\PhpWord\Element\Section` (#665).
Jan 23, 2016
995dc68
Improved coverage for `\PhpOffice\PhpWord\Element\Section` (#665).
Jan 23, 2016
53a5369
Reviewed and merged #612.
Feb 6, 2016
16495a0
Reviewed and merged #612.
Feb 6, 2016
28f801b
#704.
Feb 23, 2016
1c5bb3a
#548.
Apr 9, 2016
d579736
#618.
Apr 23, 2016
40984dc
Update DOC: Add note about direction of text inside cell
githubjeka May 24, 2016
023977a
Merge pull request #803 from githubjeka/patch-1
Progi1984 May 24, 2016
d9627e1
Update Sample_09_Tables.php
githubjeka May 25, 2016
38ca52e
Merge pull request #804 from githubjeka/patch-1
Progi1984 May 26, 2016
d3f3a4a
Update Sample_09_Tables.php
githubjeka May 30, 2016
4954f28
Merge pull request #807 from githubjeka/patch-1
Progi1984 May 30, 2016
ec3c62b
#483. Output escaping for OOXML.
Jun 4, 2016
a07dc6c
#483. Output escaping for OOXML.
Jun 4, 2016
a2d3079
Fixed build.
Jun 4, 2016
ebbb3a5
#483. Output escaping for ODF.
Jun 13, 2016
508d619
Fixed build.
Jun 13, 2016
4c7e139
#483. Output escaping for HTML.
Jun 28, 2016
649da97
Fixed build.
Jun 28, 2016
3f1e0ac
#483. Output escaping for RTF.
Jul 8, 2016
e2ea1ee
Fixed tests.
Jul 8, 2016
7deb010
Fixed formatting.
Jul 8, 2016
fb863cd
https://github.com/PHPOffice/PHPWord/issues/335.
Jul 30, 2016
54013a6
https://github.com/PHPOffice/PHPWord/issues/399.
Jul 30, 2016
7817524
https://github.com/PHPOffice/PHPWord/issues/399.
Jul 30, 2016
1827eab
Removed deprecated code.
Jul 30, 2016
2bcfacf
Updated copyright.
Jul 31, 2016
4486e2b
Updated change log.
Jul 31, 2016
31cc01a
Updated change log.
Jul 31, 2016
0a3f873
Updated change log.
Jul 31, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

matrix:
allow_failures:
- php: 7.0
- php: hhvm

env:
Expand All @@ -31,8 +33,6 @@ before_script:
script:
## PHP_CodeSniffer
- ./vendor/bin/phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip
## PHP Copy/Paste Detector
- ./vendor/bin/phpcpd src/ tests/ --verbose
## PHP Mess Detector
- ./vendor/bin/phpmd src/,tests/ text ./phpmd.xml.dist --exclude pclzip.lib.php
## PHPUnit
Expand All @@ -47,4 +47,4 @@ after_script:
- bash .travis_shell_after_success.sh
## Scrutinizer
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
99 changes: 68 additions & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,72 @@
CHANGELOG
=========
Change Log
==========
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

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.

0.12.1 (30 August 2015)
v0.13.0 (31 July 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](https://getcomposer.org/) 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

Maintenance release. This release is focused primarily on ``TemplateProcessor``.
### 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](https://getcomposer.org/).
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



v0.12.1 (30 August 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
- 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
- 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



0.12.0 (3 January 2015)
v0.12.0 (3 January 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
Expand Down Expand Up @@ -78,18 +124,16 @@ This release added form fields (textinput, checkbox, and dropdown), drawing shap



0.11.1 (2 June 2014)
v0.11.1 (2 June 2014)
--------------------

This is an immediate bugfix release for HTML reader.

- HTML Reader: `<p>` and header tags puts no output - @canyildiz @ivanlanin #257



0.11.0 (1 June 2014)
v0.11.0 (1 June 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
Expand Down Expand Up @@ -152,18 +196,16 @@ This release marked the change of PHPWord license from LGPL 2.1 to LGPL 3. Four



0.10.1 (21 May 2014)
v0.10.1 (21 May 2014)
--------------------

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

- Change Composer requirements for php-zip from `require` to `suggest` - @bskrtich #246



0.10.0 (4 May 2014)
v0.10.0 (4 May 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
Expand Down Expand Up @@ -246,18 +288,16 @@ This release marked heavy refactorings on internal code structure with the creat



0.9.1 (27 Mar 2014)
v0.9.1 (27 Mar 2014)
-------------------

This is a bugfix release for PSR-4 compatibility.

- Fixed PSR-4 composer autoloader - @AntonTyutin



0.9.0 (26 Mar 2014)
v0.9.0 (26 Mar 2014)
-------------------

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

### Features
Expand All @@ -278,18 +318,16 @@ This release marked the transformation to namespaces (PHP 5.3+).



0.8.1 (17 Mar 2014)
v0.8.1 (17 Mar 2014)
-------------------

This is a bugfix release for image detection functionality.

- Added fallback for computers that do not have exif_imagetype - @bskrtich, @gabrielbull



0.8.0 (15 Mar 2014)
v0.8.0 (15 Mar 2014)
-------------------

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

### Features
Expand Down Expand Up @@ -336,9 +374,8 @@ This release merged a lot of improvements from the community. Unit tests introdu



0.7.0 (28 Jan 2014)
v0.7.0 (28 Jan 2014)
-------------------

This is the first release after a long development hiatus in [CodePlex](https://phpword.codeplex.com/). 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](https://packagist.org/packages/phpoffice/phpword) and [Travis](https://travis-ci.org/PHPOffice/PHPWord) were added.

### Features
Expand All @@ -362,4 +399,4 @@ This is the first release after a long development hiatus in [CodePlex](https://
- 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](http://phpword.codeplex.com/workitem/49)
- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo [#49](http://phpword.codeplex.com/workitem/49)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PHPWord, a pure PHP library for reading and writing word processing documents.

Copyright (c) 2010-2014 PHPWord.
Copyright (c) 2010-2016 PHPWord.

PHPWord is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 3 as published by
Expand Down
64 changes: 26 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Code Coverage](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/badges/coverage.png?s=742a98745725c562955440edc8d2c39d7ff5ae25)](https://scrutinizer-ci.com/g/PHPOffice/PHPWord/)
[![Total Downloads](https://poser.pugx.org/phpoffice/phpword/downloads.png)](https://packagist.org/packages/phpoffice/phpword)
[![License](https://poser.pugx.org/phpoffice/phpword/license.png)](https://packagist.org/packages/phpoffice/phpword)
[![Join the chat at https://gitter.im/PHPOffice/PHPWord](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPWord)

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](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF), HTML, and PDF.

Expand All @@ -23,7 +24,7 @@ Read more about PHPWord:

## Features

With PHPWord, you can create DOCX, ODT, or RTF documents dynamically using your PHP 5.3+ scripts. Below are some of the things that you can do with PHPWord library:
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
Expand All @@ -44,50 +45,46 @@ With PHPWord, you can create DOCX, ODT, or RTF documents dynamically using your
- 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 main document part of OOXML template
- 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:

- PHP 5.3+
- [Zip extension](http://php.net/manual/en/book.zip.php)
- PHP 5.3.3+
- [XML Parser extension](http://www.php.net/manual/en/xml.installation.php)
- [Zend\Escaper component](http://framework.zend.com/manual/current/en/modules/zend.escaper.introduction.html)
- Zend\Stdlib component
- [Zend\Validator component](http://framework.zend.com/manual/current/en/modules/zend.validator.html)
- [Zip extension](http://php.net/manual/en/book.zip.php) (optional, used to write OOXML and ODF)
- [GD extension](http://php.net/manual/en/book.image.php) (optional, used to add images)
- [XMLWriter extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write DOCX and ODT)
- [XMLWriter extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write OOXML and ODF)
- [XSL extension](http://php.net/manual/en/book.xsl.php) (optional, used to apply XSL style sheet to template )
- [dompdf](https://github.com/dompdf/dompdf) (optional, used to write PDF)
- [dompdf library](https://github.com/dompdf/dompdf) (optional, used to write PDF)

## Installation

It is recommended that you install the PHPWord library [through composer](http://getcomposer.org/). To do so, add
the following lines to your ``composer.json``.
PHPWord is installed via [Composer](https://getcomposer.org/).
You just need to [add dependency](https://getcomposer.org/doc/04-schema.md#package-links>) on PHPWord into your package.

Example:

```json
{
"require": {
"phpoffice/phpword": "dev-master"
"phpoffice/phpword": "v0.13.*"
}
}
```

Alternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPWord/releases).
In this case, you will have to register the autoloader.

```php
require_once 'path/to/PhpWord/src/PhpWord/Autoloader.php';
\PhpOffice\PhpWord\Autoloader::register();
```

## Getting started

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

```php
<?php
require_once 'src/PhpWord/Autoloader.php';
\PhpOffice\PhpWord\Autoloader::register();
require_once 'bootstrap.php';

// Creating the new document...
$phpWord = new \PhpOffice\PhpWord\PhpWord();
Expand All @@ -98,11 +95,9 @@ $phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
// Adding Text element to the Section having font styled by default...
$section->addText(
htmlspecialchars(
'"Learn from yesterday, live for today, hope for tomorrow. '
. 'The important thing is not to stop questioning." '
. '(Albert Einstein)'
)
'"Learn from yesterday, live for today, hope for tomorrow. '
. 'The important thing is not to stop questioning." '
. '(Albert Einstein)'
);

/*
Expand All @@ -114,11 +109,9 @@ $section->addText(

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

Expand All @@ -129,11 +122,9 @@ $phpWord->addFontStyle(
array('name' => 'Tahoma', 'size' => 10, 'color' => '1B2232', 'bold' => true)
);
$section->addText(
htmlspecialchars(
'"The greatest accomplishment is not in never falling, '
. 'but in rising again after you fall." '
. '(Vince Lombardi)'
),
'"The greatest accomplishment is not in never falling, '
. 'but in rising again after you fall." '
. '(Vince Lombardi)',
$fontStyleName
);

Expand All @@ -142,9 +133,7 @@ $fontStyle = new \PhpOffice\PhpWord\Style\Font();
$fontStyle->setBold(true);
$fontStyle->setName('Tahoma');
$fontStyle->setSize(13);
$myTextElement = $section->addText(
htmlspecialchars('"Believe you can and you\'re halfway there." (Theodor Roosevelt)')
);
$myTextElement = $section->addText('"Believe you can and you\'re halfway there." (Theodor Roosevelt)');
$myTextElement->setFontStyle($fontStyle);

// Saving the document as OOXML file...
Expand All @@ -162,7 +151,6 @@ $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. */
```
:warning: Escape any string you pass to OOXML/ODF/HTML document, otherwise it may get broken.

More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phpword.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/master/) for more detail.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.1
0.13.0
Loading