An open API service indexing awesome lists of open source software.

https://github.com/vijaycs85/phpword


https://github.com/vijaycs85/phpword

Last synced: about 2 months ago
JSON representation

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.