Forum


Replies: 1   Views: 3075
Possibility header and footer with 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 kokoncz  · 02-01-2017 - 10:14

Hello,

We currently have a service that will create docx files from HTML files.
We now do it by using 

$docx->embedHTML($html, array('isFile' => false, 'downloadImages' => true));

Is it possible to have a certain tag in the HTML to have header and footer in there? Or do we need to have a seperate piece in PHP to add header and footer (and leave the regular document in the embedHTML)?

An alternative I was thinking about was to create for the header and footer a WordFragment, and embed HTML in each (since the whole source is coming from HTML, but we could split the HTML files into header, content, footer).

Any suggestions? (We have the Premium license)

Friendly regards,

Novak

Posted by admin  · 02-01-2017 - 12:41

Hello,

HTML Extended, available in Premium licenses since the release of phpdocx 9, supports adding headers and footers from HTML.

If your code has header and footer tags that you want to add in Word headers and footers you need to split the HTML and then add them as WordFragments (or separate the HTML source). There's no tag to add HTML to a header (or a footer) without creating a WordFragment and setting the right target.

If your template methods to add HTML or other content, please remember to set the right target (document, header, footer...).

HTML Extended, available in Premium licenses since the release of phpdocx 9, supports adding headers and footers from HTML.

Regards.