Forum


Replies: 2   Views: 3315
Extra spaces in header/footer generated documents
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 medikin  · 31-03-2016 - 20:25

Hello,

We are an existing client and potentially an upgrade client, but
before we shell out $199 for the upgrade we need to know if a
particular problem / bug was resolved.

...

The problem is that when saving documents that have a header, extra
carriage returns are added. This makes the software unusable and we
want to know if it is fixed. In that case we will gladly upgrade. If
you need more details on exactly how the problem occurs we would be
glad to provide that info.

Posted by admin  · 01-04-2016 - 06:45

Hello,

Please send to contact[at]phpdocx.com the most simple script that illustrates the issue (this is without doing external connections such as databases or webservices) and we'll check it. Also, please attach the DOCX output after you run this same script.

Regards.

Posted by admin  · 05-04-2016 - 08:00

Hello,
Thanks for your DOCX samples. We have checked it and the problem is that the headers in your base document has external styles, so you just need to import them using the importStyles method:
 
if(file_exists($file_path.'/BaseHeaderTemplate.docx')){
    try{
        $docx->importHeadersAndFooters($file_path."/BaseHeaderTemplate.docx");
        $docx->importStyles($file_path."/BaseHeaderTemplate.docx", 'replace');
    }
    catch(Exception $e){
        print_r($e->getMessage());
    }
}

 

The importHeadersAndFooters method doesn't import external styles. 
Regards.