Replies: 8   Views: 3767
Header styles in wordstyles in embedhtml
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by HalloWelt  · 11-04-2013 - 12:13


thanks for your advice! But it seems I found another suitable solution. I used PackageExplorer ([url][/url]) to analyse my template. And I found that I have to use the IDs of a styling. And I had to set 'strictWordStyles' => true.

$oPHPDocX = new CreateDocx();
$oPHPDocX->addTemplate( $sUploadPath.'/template/Template.docx' );
$oPHPDocX->importStyles( $sUploadPath.'/template/Template.docx' );
foreach( $aPlaceholders as $sPlaceholder => $sHTMLContent ) {
'isFile' => false,
'parseDivsAsPs' => true,
'downloadImages' => true,
'wordStyles' =>array(
'<p>' => 'Standard',
'<h1>' => 'berschrift1',
'<h2>' => 'berschrift2',
'<h3>' => 'berschrift3',
'<h4>' => 'berschrift4',
.mytable' => 'Tabellenraster',
'strictWordStyles' => true
I'v still got some trouble to get the mappings for table cells/headings and listentries working...
'<th>' => 'Tabellenberschrift',
'<td>' => 'TabellentextArial',
'<li>' => 'Listenabsatz'