Add Image
Adds an image to the Word document with specified dimensions. The image is inserted at the end of the document as an inline shape.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing the node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
-
File Descriptor - File descriptor ID from the Open Word node. Default variable is
word_fd. -
Image Path - Full path to the image file to insert (e.g.,
C:\Images\logo.png). Supported formats include:- PNG (.png)
- JPEG (.jpg, .jpeg)
- BMP (.bmp)
- GIF (.gif)
- TIFF (.tif, .tiff)
-
Height - Height of the image in points. Must be greater than zero. Common values:
72points = 1 inch144points = 2 inches216points = 3 inches
-
Width - Width of the image in points. Must be greater than zero. Common values:
72points = 1 inch144points = 2 inches216points = 3 inches288points = 4 inches
Use Cases
- Adding company logos to reports and documents
- Inserting charts and graphs from files
- Including product images in documents
- Adding signatures or stamps to documents
- Building image galleries or catalogs
- Inserting screenshots or diagrams
Example
Adding a company logo to a report:
- Use Open Word to open the document
- Add the Add Image node
- Configure the inputs:
- File Descriptor:
word_fd - Image Path:
C:\Company\Logo.png - Height:
72(1 inch) - Width:
144(2 inches)
- File Descriptor:
Size Calculation Examples
// Standard business card logo
// Width: 144 points (2 inches)
// Height: 72 points (1 inch)
// Full-width image (6.5 inches on letter size)
// Width: 468 points
// Height: 351 points (for 4:3 aspect ratio)
// Thumbnail
// Width: 72 points (1 inch)
// Height: 72 points (1 inch)
// A4 portrait page width (approx)
// Width: 595 points (8.27 inches)
Converting Units to Points
- 1 inch = 72 points
- 1 cm = 28.35 points
- 1 mm = 2.835 points
Example conversions:
// 5 cm = 5 * 28.35 = 141.75 points
// 100 mm = 100 * 2.835 = 283.5 points
// 3.5 inches = 3.5 * 72 = 252 points
To maintain aspect ratio, calculate one dimension based on the other. For example, if your original image is 800x600 pixels (4:3 ratio) and you want width of 288 points, set height to 216 points.
Maintaining Aspect Ratio
// Original image: 1920x1080 (16:9 ratio)
// Desired width: 432 points (6 inches)
// Calculate height: 432 * (1080/1920) = 243 points
// Original image: 800x600 (4:3 ratio)
// Desired height: 144 points (2 inches)
// Calculate width: 144 * (800/600) = 192 points
Common Errors
- "Invalid File Descriptor" - Ensure the Open Word node was executed first.
- "Image Path cannot be empty" - Provide a valid path to an image file.
- "Height must be greater than zero" - Specify a positive height value.
- "Width must be greater than zero" - Specify a positive width value.
- File not found - Verify the image file exists at the specified path.
- Unsupported format - Ensure the image is in a supported format (PNG, JPG, BMP, GIF, TIFF).
Notes
- Images are inserted at the end of the document, in line with text.
- The image is embedded in the document (not linked).
- Images are inserted as inline shapes, which flow with surrounding text.
- Very large images may increase document file size significantly.
- The node does not automatically maintain aspect ratio - you must calculate appropriate dimensions.
Best Practices
- Use PNG format for logos and graphics with transparency.
- Use JPEG format for photographs and complex images.
- Compress images before insertion to reduce document size.
- Keep image dimensions reasonable for the document page size.
- Store images in a consistent location for easier path management.
See Also
- Add Text - Add text content
- Add Table - Add tables
- Add Heading - Add headings