docx-templates
docx-templates copied to clipboard
Image caption
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.
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.
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
Hi @jjhbw, have we had this feature in the latest version of docx-template?
@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 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.
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.
I also needed this functionality so I've created a PR for this: #286
Thanks @jwasnoggin ! Looks like a sensible solution to me.
Hi @jjhbw When are you planing to release this feature ?
@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