4 Sizing - Reference Documentation
Authors: Grails Plugin Collective
Version: 1.0.0
4 Sizing
Documents
When rendering PDF documents, you can specify the page size via CSS…<style type="text/css">
@page {
size: 210mm 297mm;
}
</style>
Images
The image rendering methods take extra arguments to control the size of the rendered image. The extra arguments are maps containingwidth
or height
keys, or both.render
Therender
argument is the size of the view port that the document is rendered into. This is equivalent to the dimensions of the browser window for html rendering.The default value for render
is width: 10, height: 10000
(i.e. 10 pixels wide by 10000 pixels high).autosize
Theautosize
argument specifies whether to adjust the size of the image to exactly be the rendered content.The default value for autosize
is width: true, height: true
.scale
Thescale
argument specifies the factor to scale the image by after initial rendering. For example, the value width: 0.5, height: 0.5
produces an image half the size of the original render.The default value for autosize
is null.resize
Theresize
argument specifies the adjusted mage after initial rendering. For example, the value width: 200, height: 400
will resize the image to 200 pixels X 400 pixels regardless of the original render size.(note that resize
& scale
are mutually exclusive with scale
taking precedence).The default value for resize
is null.