diff --git a/README.md b/README.md
index d46ee8d1..5e319d33 100755
--- a/README.md
+++ b/README.md
@@ -57,11 +57,14 @@ the following lines to your ``composer.json``.
The following is a basic example of the PHPWord library. More examples are provided in the [samples folder](samples/).
```php
-$PHPWord = new PHPWord();
+require_once 'src/PhpWord/Autoloader.php';
+PhpOffice\PhpWord\Autoloader::register();
+
+$phpWord = new \PhpOffice\PhpWord\PhpWord();
// Every element you want to append to the word document is placed in a section.
// To create a basic section:
-$section = $PHPWord->createSection();
+$section = $phpWord->createSection();
// After creating a section, you can append elements:
$section->addText('Hello world!');
@@ -72,13 +75,13 @@ $section->addText('Hello world! I am formatted.',
// If you often need the same style again you can create a user defined style
// to the word document and give the addText function the name of the style:
-$PHPWord->addFontStyle('myOwnStyle',
+$phpWord->addFontStyle('myOwnStyle',
array('name'=>'Verdana', 'size'=>14, 'color'=>'1B2232'));
$section->addText('Hello world! I am formatted by a user defined style',
'myOwnStyle');
// You can also put the appended element to local object like this:
-$fontStyle = new PHPWord_Style_Font();
+$fontStyle = new \PhpOffice\PhpWord\Style\Font();
$fontStyle->setBold(true);
$fontStyle->setName('Verdana');
$fontStyle->setSize(22);
@@ -86,13 +89,13 @@ $myTextElement = $section->addText('Hello World!');
$myTextElement->setFontStyle($fontStyle);
// Finally, write the document:
-$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
+$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('helloWorld.docx');
-$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'ODText');
+$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText');
$objWriter->save('helloWorld.odt');
-$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'RTF');
+$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
$objWriter->save('helloWorld.rtf');
```
diff --git a/docs/general.rst b/docs/general.rst
index 7cbfd4b4..3774abcf 100644
--- a/docs/general.rst
+++ b/docs/general.rst
@@ -6,12 +6,13 @@ General usage
Basic example
-------------
-The following is a basic example of the PHPWord library. More examples
+The following is a basic example of the PhpWord library. More examples
are provided in the `samples folder `__.
.. code-block:: php
- require_once '../src/PhpWord/PhpWord.php';
+ require_once 'src/PhpWord/Autoloader.php';
+ PhpOffice\PhpWord\Autoloader::register();
$phpWord = new \PhpOffice\PhpWord\PhpWord();
@@ -34,7 +35,7 @@ are provided in the `samples folder setBold(true);
$fontStyle->setName('Verdana');
$fontStyle->setSize(22);
@@ -42,9 +43,15 @@ are provided in the `samples folder setFontStyle($fontStyle);
// Finally, write the document:
- $objWriter = PHPWord_IOFactory::createWriter($phpWord, 'Word2007');
+ $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('helloWorld.docx');
+ $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText');
+ $objWriter->save('helloWorld.odt');
+
+ $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
+ $objWriter->save('helloWorld.rtf');
+
Default font
------------
@@ -82,19 +89,19 @@ Measurement units
The base length unit in Open Office XML is twip. Twip means "TWentieth
of an Inch Point", i.e. 1 twip = 1/1440 inch.
-You can use PHPWord helper functions to convert inches, centimeters, or
+You can use PhpWord helper functions to convert inches, centimeters, or
points to twips.
.. code-block:: php
// Paragraph with 6 points space after
$phpWord->addParagraphStyle('My Style', array(
- 'spaceAfter' => PHPWord_Shared_Font::pointSizeToTwips(6))
+ 'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(6))
);
$section = $phpWord->createSection();
$sectionStyle = $section->getSettings();
// half inch left margin
- $sectionStyle->setMarginLeft(PHPWord_Shared_Font::inchSizeToTwips(.5));
+ $sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
// 2 cm right margin
- $sectionStyle->setMarginRight(PHPWord_Shared_Font::centimeterSizeToTwips(2));
+ $sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
diff --git a/docs/index.rst b/docs/index.rst
index 700694a5..4f899fb9 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -3,14 +3,14 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-Welcome to PHPWord's documentation
+Welcome to PhpWord's documentation
==================================
-|PHPWord|
+|PhpWord|
-PHPWord is a library written in pure PHP that provides a set of classes to
+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
+PhpWord supports Microsoft Office Open XML (OOXML or OpenXML), OASIS Open
Document Format for Office Applications (OpenDocument or ODF), and Rich Text
Format (RTF).
@@ -35,4 +35,4 @@ Indices and tables
* :ref:`modindex`
* :ref:`search`
-.. |PHPWord| image:: images/phpword.png
+.. |PhpWord| image:: images/phpword.png
diff --git a/docs/intro.rst b/docs/intro.rst
index a30dc553..7ca37313 100644
--- a/docs/intro.rst
+++ b/docs/intro.rst
@@ -3,9 +3,9 @@
Introduction
============
-PHPWord is a library written in pure PHP that provides a set of classes
+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
+version of PhpWord supports Microsoft `Office Open
XML `__ (OOXML or
OpenXML), OASIS `Open Document Format for Office
Applications `__
@@ -16,8 +16,8 @@ No Windows operating system is needed for usage because the resulting
DOCX, ODT, or RTF files can be opened by all major `word processing
softwares `__.
-PHPWord is an open source project licensed under LGPL.
-PHPWord is `unit tested `__ to
+PhpWord is an open source project licensed under LGPL.
+PhpWord is `unit tested `__ to
make sure that the released versions are stable.
**Want to contribute?** `Fork
diff --git a/docs/setup.rst b/docs/setup.rst
index c773756f..d148a99d 100644
--- a/docs/setup.rst
+++ b/docs/setup.rst
@@ -23,7 +23,7 @@ Optional PHP extensions:
Installation
------------
-There are two ways to install PHPWord, i.e. via
+There are two ways to install PhpWord, i.e. via
`Composer `__ or manually by downloading the
library.
@@ -44,7 +44,7 @@ To install via Composer, add the following lines to your
Manual install
~~~~~~~~~~~~~~
-To install manually, `download PHPWord package from
+To install manually, `download PhpWord package from
github `__.
Extract the package and put the contents to your machine. To use the
library, include ``src/PhpWord/Autoloader.php`` in your script and
@@ -60,5 +60,5 @@ Using samples
After installation, you can browse and use the samples that we've
provided, either by command line or using browser. If you can access
-your PHPWord library folder using browser, point your browser to the
+your PhpWord library folder using browser, point your browser to the
``samples`` folder, e.g. ``http://localhost/PhpWord/samples/``.
diff --git a/docs/templates.rst b/docs/templates.rst
index 6b627b06..5d06cef6 100644
--- a/docs/templates.rst
+++ b/docs/templates.rst
@@ -8,7 +8,7 @@ replaced by any value you wish. Only single-line values can be replaced.
To load a template file, use the ``loadTemplate`` method. After loading
the docx template, you can use the ``setValue`` method to change the
value of a search pattern. The search-pattern model is:
-``${search-pattern}``. It is not possible to add new PHPWord elements to
+``${search-pattern}``. It is not possible to add new PhpWord elements to
a loaded template file.
Example:
diff --git a/src/PhpWord/Autoloader.php b/src/PhpWord/Autoloader.php
index 7b34eb75..3186ca97 100644
--- a/src/PhpWord/Autoloader.php
+++ b/src/PhpWord/Autoloader.php
@@ -20,7 +20,7 @@
*
* @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.8.0
+ * @version 0.9.0
*/
namespace PhpOffice\PhpWord;
diff --git a/src/PhpWord/DocumentProperties.php b/src/PhpWord/DocumentProperties.php
index 2d8a6cb0..d77fcfd8 100644
--- a/src/PhpWord/DocumentProperties.php
+++ b/src/PhpWord/DocumentProperties.php
@@ -20,7 +20,7 @@
*
* @copyright Copyright (c) 2014 PhpWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version 0.8.0
+ * @version 0.9.0
*/
namespace PhpOffice\PhpWord;
diff --git a/src/PhpWord/Exceptions/Exception.php b/src/PhpWord/Exceptions/Exception.php
index b2b2fcf1..266e1863 100755
--- a/src/PhpWord/Exceptions/Exception.php
+++ b/src/PhpWord/Exceptions/Exception.php
@@ -1,8 +1,8 @@