docx-mailmerge
docx-mailmerge copied to clipboard
Merge images into document
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.
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?
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.
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?
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.
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
How do you mean? I don't see anything in the source code for this module that implements images into mailmerge()?
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.
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