@@ -7,7 +7,8 @@ Basic example
77-------------
88
99The following is a basic example of the PHPWord library. More examples
10- are provided in the `samples folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/ >`__.
10+ are provided in the `samples
11+ folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/> `__.
1112
1213.. code-block :: php
1314
@@ -52,6 +53,42 @@ are provided in the `samples folder <https://github.com/PHPOffice/PHPWord/tree/m
5253 $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
5354 $objWriter->save('helloWorld.rtf');
5455
56+ Settings
57+ --------
58+
59+ The ``PhpOffice\PhpWord\Settings `` class provides some options that will
60+ affect the behavior of PHPWord. Below are the options.
61+
62+ XML Writer compatibility
63+ ~~~~~~~~~~~~~~~~~~~~~~~~
64+
65+ This option sets
66+ ```XMLWriter::setIndent `` <http://www.php.net/manual/en/function.xmlwriter-set-indent.php>`__
67+ and
68+ ```XMLWriter::setIndentString `` <http://www.php.net/manual/en/function.xmlwriter-set-indent-string.php>`__.
69+ The default value of this option is ``true `` (compatible), which is
70+ `required for OpenOffice <https://github.com/PHPOffice/PHPWord/issues/103 >`__ to
71+ render OOXML document correctly. You can set this option to ``false ``
72+ during development to make the resulting XML file easier to read.
73+
74+ .. code-block :: php
75+
76+ PhpOffice\PhpWord\Settings::setCompatibility(false);
77+
78+ Zip class
79+ ~~~~~~~~~
80+
81+ By default, PHPWord uses PHP
82+ `ZipArchive <http://php.net/manual/en/book.zip.php >`__ to read or write
83+ ZIP compressed archive and the files inside them. If you can't have
84+ ZipArchive installed on your server, you can use pure PHP library
85+ alternative, `PCLZip <http://www.phpconcept.net/pclzip/ >`__, which
86+ included with PHPWord.
87+
88+ .. code-block :: php
89+
90+ PhpOffice\PhpWord\Settings::setZipClass(PhpOffice\PhpWord\Settings::PCLZIP);
91+
5592 Default font
5693------------
5794
@@ -105,3 +142,4 @@ points to twips.
105142 $sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
106143 // 2 cm right margin
107144 $sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
145+
0 commit comments