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

Image caption

Open pawepaw opened this issue 3 years ago • 6 comments

Hi,

Is it possible to add image caption? couldn't see any information about it in docs. If not could you point me where +/- it should be added I can try to add pull request.

pawepaw avatar Mar 25 '21 15:03 pawepaw

Hi!

No its not possible at this time i'm afraid. I don't know the docx spec well enough to judge whether this would be difficult to add...

This is the function that is concerned with injecting image-related nodes into the document XML. https://github.com/guigrpa/docx-templates/blob/f3e33ffdeb657e31f79b9e70f926be53ae59fb88/src/processTemplate.ts#L759-L854

Happy to take a look at a PR.

jjhbw avatar Mar 25 '21 16:03 jjhbw

Should be possible to add this feature in a way similar to how image rotation was added in #221 . See http://officeopenxml.com/drwPic-nvPicPr.php

jjhbw avatar Jul 11 '21 09:07 jjhbw

Hi @jjhbw, have we had this feature in the latest version of docx-template?

PhuocHoangMinhNguyen avatar May 27 '22 02:05 PhuocHoangMinhNguyen

@PhuocHoangMinhNguyen i'm afraid not. I didn't get around to it yet. Rotation can be handled from JS though, outside of docx-templates.

jjhbw avatar May 27 '22 07:05 jjhbw

@jjhbw It's okay man. Just wondering what do you mean by "didn't get around to it yet"? Is it hard or you haven't had time to look into it? If it is the latter, I will try to look in the code then, we are in dire need of this feature.

PhuocHoangMinhNguyen avatar May 27 '22 07:05 PhuocHoangMinhNguyen

Would be great if you could take a look. I'm swamped with other work at the moment, but happy to look at your PR.

jjhbw avatar May 27 '22 09:05 jjhbw

I also needed this functionality so I've created a PR for this: #286

jwasnoggin avatar Nov 10 '22 01:11 jwasnoggin

Thanks @jwasnoggin ! Looks like a sensible solution to me.

jjhbw avatar Nov 10 '22 11:11 jjhbw

Hi @jjhbw When are you planing to release this feature ?

as19ish avatar Jan 20 '23 12:01 as19ish

@as19ish The release is lined up, see https://github.com/guigrpa/docx-templates/releases/tag/v4.10.0

The GH Action that we use to publish on NPM broke due to a new 2FA requirement. I'm working with @guigrpa to get that resolved. If you'd rather not wait you can install the commit directly from github in the meantime, see https://stackoverflow.com/a/18049685

jjhbw avatar Feb 03 '23 09:02 jjhbw