https://github.com/vijaycs85/phpword
https://github.com/vijaycs85/phpword
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vijaycs85/phpword
- Owner: vijaycs85
- Created: 2019-10-18T16:47:53.000Z (over 5 years ago)
- Default Branch: 8.x-2.x
- Last Pushed: 2019-10-18T17:16:44.000Z (over 5 years ago)
- Last Synced: 2025-01-18T02:43:58.955Z (3 months ago)
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHPWord module integrates the [PHPWord](https://github.com/PHPOffice/PHPWord) library with Drupal.
> 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](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF), HTML, and PDF.
### Library features
Check PHPWord [document](https://github.com/PHPOffice/PHPWord#features).### Examples
#### Writer
```php
/** PhpOffice\PhpWord\PhpWord **/
$writer = \Drupal::service('phpword.writer');// New portrait section
$section = $writer->addSection();// Simple text
$section->addTitle('Welcome to PhpWord', 1);
$section->addText('Hello World!');$writer->save('welcome.docx', 'Word2007');
```Check [samples folder](https://github.com/PHPOffice/PHPWord/blob/develop/samples). You can also read the [Developers' Documentation](http://phpword.readthedocs.io/en/latest/) and the [API Documentation](http://phpoffice.github.io/PHPWord/docs/master/) for more detail. If you find some bugs (or futures) - please tell me about in [issue](https://www.drupal.org/node/add/project-issue/phpword) for examples.