There are no forum posts on this topic! Why don't you write one?
Good morning,
I need to insert a dynamically loaded image. I tried to include an image in the header template using {img}.
Through PHP, I insert the img variable using $options->AddTemplateParameter("img",$url_image);
The image URL is correct, but the image is not visible in the DOCX; there is only an empty image object. How can I resolve this?
Thank you.
Hi,
We don't recommend loading images dynamically in the template, we usually automatically convert them to data Uris. But I would check the loading time of the image it will need to be fast.
Perhaps try specifying a delay?
Also does it work for PDF?
Kind regards
what do you mean with "Perhaps try specifying a delay?" ?
thank you
I mean set the delay parameter: https://grabz.it/api/php/technical-documentation/#filetodocx
i add $options->setDelay(30000); but the image still not working
i try with pdf but i have same problem
That seemed to work for me. Did you also specify the other image parameters you put in the image object such as imw and imh? I set these to 100, otherwise it would be a invalid image.
i try with
$options->AddTemplateParameter("img",$image_data[0]);
$options->AddTemplateParameter("imw",100);
$options->AddTemplateParameter("imh",100);
but still not working
can you send me your code?
thank you
It was only working locally for us, we have identified and fixed the problem. Please can you try again?