When sizing a figure for presentation, there are two different areas involved:
The image size is the size of the image itself.
The viewport is the area in which the figure is supposed to be presented.
If one dimension of the image is smaller than that dimension of the viewport, the result will be empty space around the figure. But what if the viewport is smaller than the image? In print presentation, the image will be cropped; but in Web presentation the image will not be cropped.
In general there are six different attributes of
imagedata that affect scaling:
These attributes set the desired image size.
The attribute value must be a number, optionally
followed by one of the dimension codes
px (pixels, the default),
em (ems), or
% (percent, relative to the
page width for horizontal dimensions).
For example, if you want the image to be 125mm×75mm, use:
<imagedata contentwidth='125mm' contentdepth='75mm' .../>
You need only specify one of these two attributes; if only one dimension is specified, the other dimension will be scaled to preserve the aspect ratio (ratio of height to width).
These attributes size the viewport. If you
specify the width as a percentage
%), it will be treated as a
percentage of the available page width.
Resizes the graphic as a percentage of the
original; omit the
% symbol from the
attribute value. For example, to render a graphic
If you specify
graphic will be scaled to fit the available
area—either the graphic size or the viewport
size, whichever is filled first. If you specified
no other sizing attributes, the graphic will be
scaled to fit the page width.