Forum


Replies: 3   Views: 3456
Each time i add word ml to a header or footer, it adds a new line too
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 seb  · 26-01-2015 - 12:36

Hiya, In phpdocx 4.5, each time I call the addWordML() function to add something to a header or footer, it also adds a new line (carriage return) to the header or footer. For example in the following code, it adds the WordML objects to the footer, but also adds 6 new lines which messes everything up: $footer = new \Phpdocx\Elements\WordFragment($this->_docx,'defaultFooter'); $footer->addWordML($fgmt_bg_image); $footer->addWordML($fgmt_by_client_logo); $footer->addWordML($fgmt_for_client_logo); $footer->addWordML($fgmt_row_1); $footer->addWordML($fgmt_row_2); $footer->addWordML($fgmt_row_3); $docx->addFooter(array('default'=>$footer)); Is there a patch I can add to your classes to stop it from adding new lines each time? Here is a download of the docx which has all these new lines (carriage returns) in the footer: http://oyster.proptest.co.uk/header_footer_example_seb.docx Thank you! Seb