19 lines
569 B
PHP
19 lines
569 B
PHP
<?php
|
|
include_once 'Sample_Header.php';
|
|
|
|
// New Word Document
|
|
echo date('H:i:s') , ' Create new PhpWord object' , EOL;
|
|
$phpWord = new \PhpOffice\PhpWord\PhpWord();
|
|
|
|
$section = $phpWord->addSection();
|
|
$html='<h1>Adding element via HTML</h1>';
|
|
$html.='<p>Some well formed HTML snippet needs to be used</p>';
|
|
$html.='<p>With for example <strong>some <em>inline</em> formatting</strong>';
|
|
|
|
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
|
|
|
|
// Save file
|
|
echo write($phpWord, basename(__FILE__, '.php'), $writers);
|
|
if (!CLI) {
|
|
include_once 'Sample_Footer.php';
|
|
} |