@@ -7,7 +7,8 @@ Basic example
7
7
-------------
8
8
9
9
The 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/> `__.
11
12
12
13
.. code-block :: php
13
14
@@ -52,6 +53,42 @@ are provided in the `samples folder <https://github.com/PHPOffice/PHPWord/tree/m
52
53
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
53
54
$objWriter->save('helloWorld.rtf');
54
55
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
+
55
92
Default font
56
93
------------
57
94
@@ -105,3 +142,4 @@ points to twips.
105
142
$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
106
143
// 2 cm right margin
107
144
$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
145
+
0 commit comments