Forum


Replies: 7   Views: 5474
3.7 => 4.0
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 admin  · 11-06-2014 - 13:50

Hello, phpdocx 4.0 includes a new WordFragment class, that is not a method but a class. This is a simple example included in the library: //path to the CreateDocx class within your PHPDocX installation require_once '../../../classes/CreateDocx.inc'; $docx = new CreateDocx(); //Create a Word fragment with an image to be inserted in the header of the document $imageOptions = array( 'src' => '../../img/image.png', 'dpi' => 300, ); $footerImage = new WordFragment($docx, 'defaultFooter'); $footerImage->addImage($imageOptions); $docx->addFooter(array('default' => $footerImage)); //add some text $docx->addText('This document has a footer with just one image.'); $docx->createDocx('example_addFooter_1'); You can get more info on: http://www.phpdocx.com/documentation/tutorial Regards.