Forum


Replies: 5   Views: 3456
Using templates
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 smaubian  · 27-10-2011 - 17:12

Hello,

I'm starting using phpdocx today and was not able to have it working using a template.
What i did is creating a very simple template.docx file (few words) and then try to load it to a phpdocx element :

[code]
require_once(LIBPATH."/phpdoc/classes/CreateDocx.inc"); // where LIBPATH can be "../folder/"

$template="./template.docx";
if(!file_exists($template)) {
$this->setError("class createDOC render : unable to load DOC template : $template. exiting",true);
}

$t=new CreateDocx();
$t->addTemplate($template);
$t->createDocxAndDownload('bouh.docx');
[/code]


And each time the result is an "empty" docx file. I do not understand what happen. Version 2.4 (pro), i have added my key to the 'code' file and am on the correct domain www/myphpdocxdomain.com/mypath/myFile.php



any help / suggestion ?.