Replies: 6   Views: 3622
Importheadersandfooters() getting error
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 sreekumar  · 15-03-2013 - 11:09

hi all

i started working in phpdocx.

but now when i am trying to add footer, it shows an error message.

"Fatal error: Call to undefined method CreateDocx::importHeadersAndFooters() in C:\xampp\htdocs\phpdocx_demo\p1.php on line 5"

this is my code

$docx = new CreateDocx();
$docx ->importHeadersAndFooters('C:/xampp/htdocs/phpdocx_demo/templateHeaderAndFooter.docx', 'footer');

// templateHeaderAndFooter.docx file contains one line, which should come as footer

$text ="welcome home";


what to do

Posted by admin  · 11-04-2013 - 12:13


importHeadersAndFooters is only supported in PHPDOCX PRO, PRO+ and CORPORATE. You have all features here:


Posted by sreekumar  · 11-04-2013 - 12:13

is there any other way to add header and footer to my docx file.

Posted by admin  · 11-04-2013 - 12:13


You can use addHeader and addFooter methods. Please read phpdoc included in PHPDocX Free and included examples.


Posted by garethellis36  · 23-01-2014 - 15:42

addHeader and addFooter are not included in community version either, correct?

Posted by jorgelj  · 24-01-2014 - 07:55


The current version of PHPDocX Community doesn't include these methods. You can add texts, lists, tables, charts and images.