Update changelog and documentation for PCLZip
This commit is contained in:
parent
71b60e9bd5
commit
9d3c2e8ae7
|
|
@ -13,6 +13,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
|
||||||
- Font: Add `bgColor` to font style to define background using HEX color - @jcarignan GH-168
|
- Font: Add `bgColor` to font style to define background using HEX color - @jcarignan GH-168
|
||||||
- Table: Add `exactHeight` to row style to define whether row height should be exact or atLeast - @jcarignan GH-168
|
- Table: Add `exactHeight` to row style to define whether row height should be exact or atLeast - @jcarignan GH-168
|
||||||
- Element: New `CheckBox` element for sections and table cells - @ozilion GH-156
|
- Element: New `CheckBox` element for sections and table cells - @ozilion GH-156
|
||||||
|
- Settings: Ability to use PCLZip as alternative to ZipArchive - @bskrtich @ivanlanin GH-106 GH-140 GH-185
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ 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 <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
|
are provided in the `samples
|
||||||
|
folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
|
||||||
|
|
||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
|
|
@ -52,6 +53,42 @@ are provided in the `samples folder <https://github.com/PHPOffice/PHPWord/tree/m
|
||||||
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
|
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF');
|
||||||
$objWriter->save('helloWorld.rtf');
|
$objWriter->save('helloWorld.rtf');
|
||||||
|
|
||||||
|
Settings
|
||||||
|
--------
|
||||||
|
|
||||||
|
The ``PhpOffice\PhpWord\Settings`` class provides some options that will
|
||||||
|
affect the behavior of PHPWord. Below are the options.
|
||||||
|
|
||||||
|
XML Writer compatibility
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
This option sets
|
||||||
|
```XMLWriter::setIndent`` <http://www.php.net/manual/en/function.xmlwriter-set-indent.php>`__
|
||||||
|
and
|
||||||
|
```XMLWriter::setIndentString`` <http://www.php.net/manual/en/function.xmlwriter-set-indent-string.php>`__.
|
||||||
|
The default value of this option is ``true`` (compatible), which is
|
||||||
|
`required for OpenOffice <https://github.com/PHPOffice/PHPWord/issues/103>`__ to
|
||||||
|
render OOXML document correctly. You can set this option to ``false``
|
||||||
|
during development to make the resulting XML file easier to read.
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
|
||||||
|
PhpOffice\PhpWord\Settings::setCompatibility(false);
|
||||||
|
|
||||||
|
Zip class
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
|
By default, PHPWord uses PHP
|
||||||
|
`ZipArchive <http://php.net/manual/en/book.zip.php>`__ to read or write
|
||||||
|
ZIP compressed archive and the files inside them. If you can't have
|
||||||
|
ZipArchive installed on your server, you can use pure PHP library
|
||||||
|
alternative, `PCLZip <http://www.phpconcept.net/pclzip/>`__, which
|
||||||
|
included with PHPWord.
|
||||||
|
|
||||||
|
.. code-block:: php
|
||||||
|
|
||||||
|
PhpOffice\PhpWord\Settings::setZipClass(PhpOffice\PhpWord\Settings::PCLZIP);
|
||||||
|
|
||||||
Default font
|
Default font
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|
@ -105,3 +142,4 @@ points to twips.
|
||||||
$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
|
$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5));
|
||||||
// 2 cm right margin
|
// 2 cm right margin
|
||||||
$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
|
$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class Template
|
||||||
/**
|
/**
|
||||||
* ZipArchive object
|
* ZipArchive object
|
||||||
*
|
*
|
||||||
* @var \ZipArchive
|
* @var mixed
|
||||||
*/
|
*/
|
||||||
private $_objZip;
|
private $_objZip;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue