A pure PHP library for reading and writing word processing documents
A pure PHP library for reading and writing word processing documents
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 Document Format for Office Applications (OpenDocument or ODF), Rich Text Format (RTF), HTML, and PDF.
PHPWord is an open source project licensed under the terms of LGPL version 3. PHPWord is aimed to be a high quality software product by incorporating continuous integration and unit testing. You can learn more about PHPWord by reading the Developers' Documentation.
If you have any questions, please ask on StackOverFlow
Read more about PHPWord:
With PHPWord, you can create OOXML, ODF, or RTF documents dynamically using your PHP scripts. Below are some of the things that you can do with PHPWord library:
PHPWord requires the following:
PHPWord is installed via Composer. To add a dependency to PHPWord in your project, either
Run the following to use the latest stable version
composer require phpoffice/phpwordor if you want the latest unreleased version
composer require phpoffice/phpword:dev-masterThe following is a basic usage example of the PHPWord library.
…More examples are provided in the samples folder. For an easy access to those samples launch php -S localhost:8000 in the samples directory then browse to http://localhost:8000 to view the samples.
You can also read the Developers' Documentation for more detail.
We welcome everyone to contribute to PHPWord. Below are some of the things that you can do to contribute.
TOC error after upgrading OpenOffice from 7.2.7.2 to higher
Insert an existing DOCX document into a section (w:altChunk)
Implement WPS Writer
Invalid image: zip:///tmp/......../iamge4.png
TemplateProcessor::setImageValue() inserts images as legacy VML — not editable in Word Mobile / Word Online
Writer ODText: support PreserveText fields
Table/cell styles applied to odt file
Add MacroExists public method to TemplateProcessor.php
Does PHPWord support content control checkboxes
Race condition in ZipArchive::$tempDir