Hi,
I’m trying to set the width and/or height of images which are beeing inserted as a mailmerge field. In the Word Template if I insert a merge field with the name “Image:MyImageField”, it’s working fine as expected. When I set it like “Image(100;100):MyImageField” or “Image(20pt;50pt):MyImageField” I get exactly the same result.
So I’m not sure what is wrong?
My other option was to try it with an IFieldMergingCallback, but it is not working as expected for PHP JavaBridge:
If I use the following code PHP is throwing me an error that IFieldMergingCallback is not an interface (because of “implements”):
$this->doc->getMailMerge()->setFieldMergingCallback(new HandleMergeField());
class HandleMergeField implements IFieldMergingCallback {
public function fieldMerging(FieldMergingArgs $args)
{
}
public function imageFieldMerging(ImageFieldMergingArgs $args)
{
echo java_values($args->ImageWidth->Value);
}
}
And if I use the following, nothing at all happens (with “extends”):
$this->doc->getMailMerge()->setFieldMergingCallback(new HandleMergeField());
class HandleMergeField extends IFieldMergingCallback {
function __construct()
{
echo "Hello World"; //this is happening
}
public function fieldMerging(FieldMergingArgs $args)
{
}
public function imageFieldMerging(ImageFieldMergingArgs $args)
{
echo java_values($args->ImageWidth->Value);
}
}
Thanks for any suggestions!