Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Merge images into document #12

Open
Dexus opened this issue Jun 25, 2014 · 8 comments · May be fixed by #51
Open

Merge images into document #12

Dexus opened this issue Jun 25, 2014 · 8 comments · May be fixed by #51

Comments

@Dexus
Copy link

Dexus commented Jun 25, 2014

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.

@Bouke
Copy link
Owner

Bouke commented Jun 25, 2014

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?

@Dexus
Copy link
Author

Dexus commented Jun 25, 2014

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
Copy link
Author

Dexus commented Jun 27, 2014

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?

@Bouke
Copy link
Owner

Bouke commented Jun 27, 2014

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 Bouke changed the title Image Merge/Replacing example from nodejs/coffeescript MailMerge images into document Sep 20, 2014
@Bouke Bouke changed the title MailMerge images into document Merge images into document Sep 20, 2014
@ghost
Copy link

ghost commented Mar 6, 2017

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.

@testtesttest531
Copy link

@ghost

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

@TNGPS
Copy link

TNGPS commented May 17, 2018

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 TNGPS linked a pull request May 17, 2018 that will close this issue
8 tasks
@joaoe
Copy link

joaoe commented Jun 28, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants