These functions is used for limiting image size, they are for scaling an image when its size is overlap paper margin.
$image.limitImageSize(image)
Return image that is scaled to fit paper page (like "Fit image to paper" option)
Name | Type | Description | |
---|---|---|---|
Parameter(s) | image | com.nomagic.magicreport.Image | An image object for the element. |
Return | - | com.nomagic.magicreport.Image | A resized image. |
For example:
#foreach($d in $Diagram) $image.limitImageSize($d.image) #end
$image.limitImageSize(image, maximumWidth, maximumHeight)
Return image that is scaled to fit paper page but not bigger than specific maximumWidth and maximumHeight in a term of measurement (px, in, cm, mm, pt)
Name | Type | Description | |
---|---|---|---|
Parameter(s) | image | com.nomagic.magicreport.Image | An image object for the element. |
maximumWidth | java.lang.String | Maximum width of resized image in a term of measurement. | |
maximumHeight | java.lang.String | Maximum height of resized image in a term of measurement. | |
Return | - | com.nomagic.magicreport.Image | A resized image. |
For example:
#foreach($d in $Diagram) $image.limitImageSize($d.image, "5in", "8in") #end _Note: Using "-1" when you do not want to specific value._ #foreach($d in $Diagram) $image.limitImageSize($d.image, "-1", "8in") #end #foreach($d in $Diagram) $image.limitImageSize($d.image, "5in", "-1") #end
$image.limitImageSize(image, maximumWidthPixel, maximumHeightPixel)
Return image that is scaled to fit paper page but not bigger than specific maximumWidth and maximumHeight in a term of pixel
Name | Type | Description | |
---|---|---|---|
Parameter(s) | image | com.nomagic.magicreport.Image | An image object for the element. |
maximumWidthPixel | int | Maximum width of resized image in a term of measurement. | |
maximumHeightPixel | int | Maximum height of resized image in a term of measurement. | |
Return | - | com.nomagic.magicreport.Image | A resized image. |
For example:
#foreach($d in $Diagram) $image.limitImageSize($d.image, 480, 680) #end #foreach($d in $Diagram) $image.limitImageSize($d.image, -1, 680) #end #foreach($d in $Diagram) $image.limitImageSize($d.image, 480, -1) #end
Note: Using -1 when you do not want to specific value.