2014-04-29 01:18:01 +07:00
|
|
|
<?php
|
2022-09-16 11:45:45 +02:00
|
|
|
|
2014-04-29 01:18:01 +07:00
|
|
|
include_once 'Sample_Header.php';
|
|
|
|
|
|
|
|
|
|
// Read contents
|
|
|
|
|
$name = basename(__FILE__, '.php');
|
2014-05-29 15:09:02 +07:00
|
|
|
$source = __DIR__ . "/resources/{$name}.odt";
|
|
|
|
|
|
2014-04-29 01:18:01 +07:00
|
|
|
echo date('H:i:s'), " Reading contents from `{$source}`", EOL;
|
|
|
|
|
$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'ODText');
|
|
|
|
|
|
|
|
|
|
// Save file
|
|
|
|
|
echo write($phpWord, basename(__FILE__, '.php'), $writers);
|
|
|
|
|
if (!CLI) {
|
|
|
|
|
include_once 'Sample_Footer.php';
|
|
|
|
|
}
|