lapinator / ods-php-generator
Open Document Spreadsheet (.ods) generator
Installs: 3 159
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 2
Open Issues: 5
Requires
- php: >=5.3
This package is not auto-updated.
Last update: 2024-11-21 01:19:03 UTC
README
odsPhpGenerator is a library written in PHP to generate Open Document Spreadsheet (.ods)
Features
- UTF-8 Encoding
- Multi tables
- Merge Cells
- Formula
- Images
- And more
Install
By composer :
$ composer require lapinator/ods-php-generator
Example
use odsPhpGenerator\ods; use odsPhpGenerator\odsTable; use odsPhpGenerator\odsTableRow; use odsPhpGenerator\odsTableCellString; // Load library require_once '../vendor/autoload.php'; // Create Ods object $ods = new ods(); // Create table named 'table 1' $table = new odsTable('table 1'); // Create the first row $row = new odsTableRow(); // Create and add 2 cell 'Hello' and 'World' $row->addCell( new odsTableCellString("Hello") ); $row->addCell( new odsTableCellString("World") ); // Attach row to table $table->addRow($row); // Attach talble to ods $ods->addTable($table); // Download the file $ods->downloadOdsFile("HelloWorld.ods");
More examples in directory examles