r7_docx_image
Insert PNG, JPEG, or GIF images into a DOCX document, or list images already inside it. It creates media parts, relationships, and content types and preserves aspect ratio.
Instructions
Insert a PNG/JPEG/GIF into a DOCX document, or list the images already in it. Inserting creates the media part, its relationship and its content type, and keeps the picture's own aspect ratio when only one dimension is given. Existing images and relationships are never touched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Alternative text stored with the picture. | |
| data | No | Base64 image data (a data: URL also works) instead of imagePath. | |
| name | No | Picture name shown in the document's selection pane. | |
| action | No | insert (default) or list. | |
| widthCm | No | Display width in centimetres. The height is derived from the image's aspect ratio. | |
| widthPx | No | Display width in pixels at 96 dpi. | |
| filePath | Yes | Path to the DOCX file. | |
| heightCm | No | Display height in centimetres. | |
| heightPx | No | Display height in pixels at 96 dpi. | |
| imagePath | No | Path to the image file (PNG, JPEG or GIF). | |
| outputPath | No | Write to a copy instead of editing in place. | |
| paragraphIndex | No | Where the picture goes: "end" (default), "start", "new" for its own paragraph, or a 0-based paragraph index. |