Skip to content

Adding images with TemplateProcessor #1365

@rkorebrits

Description

@rkorebrits

I've spent quite a bit of time using the TemplateProcessor now, but I'm stuck on the adding of images. Is there a consensus on how to do this? I see there are several PRs, but none of them seem to have been merged. What I've tried so far:

  1. I tested @FBnil 's suggestion in Insert image in TemplateProcessor #1079 to replace existing images, which works on itself, but I need more flexibility as it can only really work if you code against a particular document, whereas we will have loads of different templates with a variable number of images.

  2. @ejn 's solution in New function in TemplateProcessor to add images to documents #1084 looked very promising, however it doesn't work for me, I get the following message when opening the document:
    image
    After clicking "ok" here, I get the option to "recover the contents", which works, but it's not a viable solution as we can't provide "broken" documents to our users.
    The template: empty.docx
    The output: CV_680989964_Test_Name_20180507-114821.docx

  3. TemplateProcessor->setImageValue() #1170 by @SailorMax works fine, however it's not possible to set the size of the image in the template variable which is something we'd need to be able to manage inside the templates.

What is the recommended way to do this (if there is any).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions