docx-mailmerge icon indicating copy to clipboard operation
docx-mailmerge copied to clipboard

Merge images into document

Open Dexus opened this issue 11 years ago • 8 comments
trafficstars

I found a solution but its in nodejs/coffeescript.

https://github.com/edi9999/docxtemplater

https://github.com/edi9999/docxtemplater/blob/master/coffee/imgManager.coffee https://github.com/edi9999/docxtemplater/blob/master/coffee/imgReplacer.coffee

If I were not stupid in terms of Python, I would like to implement it.

Dexus avatar Jun 25 '14 13:06 Dexus

Being able to merge images would be a nice feature to have. I like it. However due to time constraints, I won't be able to provide the implementation of it. You wouldn't feel comfortable trying to work on a pull request?

Bouke avatar Jun 25 '14 18:06 Bouke

I'm new to python. I could try to simply replace the image only. Although would not the ultimate goal but a beginning. You would have to replace only the image in the Media folder.

Out the result would be of a Python novice.

Dexus avatar Jun 25 '14 18:06 Dexus

Hi @Bouke Based on the functions, that i need to use to remove images from the docx; the last version will be 3.4 for python. Or can you tell me how i will add this http://bugs.python.org/issue6818 so that we can support 2.7?

Dexus avatar Jun 27 '14 09:06 Dexus

Please note that this library's goal is to provide mail merge functionality. The functionality to merge an image in a mergefield is completely legit, and would be nice to have. However I don't quite see how replacing images fits into the concept of mail merge.

Bouke avatar Jun 27 '14 16:06 Bouke

Seems to MailMerge images into document have complete.

The following is the domain code: { INCLUDEPICTURE "{ MERGEFIELD 1.png * MERGEFORMAT }" * MERGEFORMAT }

Btw,in OS, INCLUDEPICTURE don't support relative path.

ghost avatar Mar 06 '17 17:03 ghost

@ghost

How do you mean? I don't see anything in the source code for this module that implements images into mailmerge()?

testtesttest531 avatar Feb 27 '18 04:02 testtesttest531

Please note that this library's goal is to provide mail merge functionality. The functionality to merge an image in a mergefield is completely legit, and would be nice to have. However I don't quite see how replacing images fits into the concept of mail merge.

I can think of some use cases, where you want to add a personal image in each merged page. Maybe you generate a product brochure from a database, or a report containing graphs etc.

I made a version of image merge work. If people are interested in this feature, I am happy to create a pull request.

TNGPS avatar May 17 '18 18:05 TNGPS

Howdy. I just came up with this problem. I'm trying to generate documents with names of people, in different scripts (latin, greek, slavic, etc). The font I use for the names is a fancy caligraphy like font, but there is no (free) font that supports all scripts, so what I came up with was to generate a svg/bitmap online with sample text. So, I'd have merge_template receiving plain text in some entries and images in others. :p

joaoe avatar Jun 28 '19 01:06 joaoe