now i'm totaly lost, just have this code in my extension:
<?php
namespace UWKM\UwkmOffer\Controller;
class OfferController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
public function submitAction()
{
require_once(__DIR__ . '/../../Lib/Classes/Phpdocx/AutoLoader.inc');
\Phpdocx\AutoLoader::load();
$docx = new \Phpdocx\Create\CreateDocx();
$footerImageOptions = array(
'src' => __DIR__ . '/../../Resources/Public/Images/simco_footer.png',
'dpi'=>300,
);
$footerImage = new \Phpdocx\Elements\WordFragment($docx, 'defaultFooter');
$footerImage->addImage($footerImageOptions);
$headerElements = new \Phpdocx\Elements\WordFragment($docx, 'headers');
$headView = $this->offerRepository->getTemplateHtml('Offer', 'header');
$headView->assign('image', __DIR__ .'/../../Resources/Public/Images/simco_header2.png');
$headView->assign('addressInfo', 'Simco-ION
Aalsvoort 74
7241 MB Lochem
The Netherlands
+31 (0)753 288378
+31 (0)573 288390
cs@simco-ion.nl');
$headerElements->embedHTML($headView->render(), array('downloadImages'=>true));
$docx->addHeader(array('first'=>$headerElements, 'default' => $headerElements));
$docx->addFooter(array('first'=>$footerImage,'default' => $footerImage));
$docx->createDocxAndDownload(__DIR__.'/document.docx');
}
}
wel resulting docx is without images here. is it bugging due script using namespace too ?