Forum


Replies: 9   Views: 3368
Images and array of text are display simultaneously
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 kim  · 22-11-2012 - 06:52

hello.

i have tried to show text dynamically and image also dynamically in same doc but when i use TemplateTableImage template so only images are show whether i have included variable and i also make my template its show varible values but not images whether i copy all text of TemplateTableImage template. plz solve my problem its very urgent

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

Hello,

Please paste your code.

Regards.

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

require_once '../../classes/CreateDocx.inc';

$docx = new CreateDocx();

$docx->addTemplate('../files/TemplateTableImage.docx');

//$docx->addTemplateVariable('NAME', $_POST['Txtname']);
$docx->addTemplateVariable('EMAIL', 'sonal');
$docx->addTemplateVariable('HELLO', 'Hellooooooooooo');

//$docx->addTemplateImage('IMAGE1', '../files/img/image_2.jpg');
$docx->addTemplateImage('IMAGE2', '../files/img/image_2.jpg');
$docx->addTemplateImage('IMAGE3', '../files/img/image_2.jpg');


$docx->createDocx('../docx/test13');

but whether i paste $EMAIL$, $HELLO$ in template images are not generate.

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

Hello,

Please upload your DOCX template too.

Regards.

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


i used default template of examples of phpdocx.
please follow below path -
phpdocx_pro/examples/files/TemplateTableImage.docx

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

hi,
i just want to ask you - can i generate doc of text and images simultaneously.i used example templateImage.php but its not works.
please help me asap

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

Hello,

All examples are working fine, pleaase check your code and phpdocx/server log . About these lines:

$docx->addTemplateVariable(’EMAIL’, ’sonal’);
$docx->addTemplateVariable(’HELLO’, ‘Hellooooooooooo’);

You can't replace a variable if the placeholder doesn't exist in template. And the included example doesn't have EMAIL, HELLO placeholders; you must add them to template before replacing them.

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

i have add EMAIL AND HELLO variable in my template, but after adding these variable my images are not seen, why ?.
and 1 more question -
i used replaceTemplateVariableByHTML for solve same problem but in where i include image path in coding.plz help me.

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

Hello,

Please share your document to test it.

Regards.