$image provides a rich set of image manipulation methods that enable you to transform images during report generation. With $image, you can scale, rotate, split, and resize images, include external images, and export them for TXT and HTML templates.
Syntax
These manipulation methods can be broadly divided into seven categories:
- Scaling images
- Rotating images
- Splitting images
- Resizing fixed-pixel images
- Resizing fixed-measurement images
- Including external images
- Exporting images for TXT and HTML templates
- Limiting image size
Multiple image transformations will have cumulative effects. Desired sizes can be specified either as pixel counts or as measurements in inches, centimeters, or millimeters. While the parameters for resizing an image with a specific measurement (in, cm, mm, pt, or px) must be specified in a pair of quote marks, all other size parameters do not need to be specified in a pair of quote marks.
The keepRatio parameter takes either a true or false value; a true value will resize the image and keep the original image height/width ratio; a false value will only resize one axis, as set by the method name, resulting in a stretched image.