Forum


Replies: 4   Views: 3681
Using template in constructor - ignores page margins
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 garethellis36  · 19-02-2014 - 17:16

Hello



I have created a template with a header & footer and with custom page layout including margins. When I insert content into the document and createDocx, the header does not look the same as the template. In addition, the page layout is changed - the margins revert to something that looks more like A4. Here is the code:



        require_once(ROOT . '\\vendors\\phpdocx\\classes\\CreateDocx.inc');



        $docx = new CreateDocx(ROOT . '\\vendors\\phpdocx\\templates\\certificate_tr.docx');    



        //add main body to document

        $docx->addHTML(array('html' => $html));



        $docx->createDocx($filepath . $filename);



Am I doing something wrong?