Forum


Replies: 4   Views: 2668
Document header is missing after docx is converted to pdf
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 ascendware  · 07-11-2019 - 14:47

Hi,

I have generated a document (docx) purely from HTML. One of the requirements is to convert this docx file to PDF. Everything is working as expected, however, the document header is missing after it was converted to PDF, while the docx file that was initially generated, the header is present.

Here is the script I used to create the document:

$phpdocx = new CreateDocx();
$headerText = new WordFragment($phpdocx, 'defaultHeader');
$headerText->embedHTML($header);
$phpdocx->addHeader(array('default' => $headerText));
$phpdocx->embedHTML($body);
$phpdocx->createDocx('/output/' . $filename);

How can I make the header appear in the converted file? Ay suggestion?

Thank you.