image
Summary
Inserts an image to the PDF document.Usage
pdf( image, hash( src, image_path, [ width, image_width, ] [ height, image_height, ] [ align, justification, ] [ x, x_position, ] [ y, y_position, ] [ dpi, resolution, ] [ static, flow_properties ] ) )
Parameters
Name | Type | Description | Required |
---|---|---|---|
src | string | The path to the image. | Yes. |
width | integer | The width of the image. | No. |
height | integer | The height of the image. | No. |
align | string | The alignment of the image. | No. |
x | integer | The absolute horizontal offset. | No. |
y | integer | The absolute y offset. | No. |
dpi | integer | The image resolution. | No. |
static | boolean | Float properties of the image. | No. |
Description
This function makes it possible to insert an image. The image location or image source points to the root directory of the eZ publish installation. The image location is relative to this directory. Currently, the supported image types are "jpg" and "png" without alpha channel.
The width and height of the image can be specified using the "width" and "height" parameters. If these parameters are omitted, the image will be scaled to 100 by 100 dots. The "align" parameter can be used to specify the horizontal position of the image. Possible alignments are "left", "right", and "center" - the default is "left". The "x" and "y" parameter makes it possible to place the image at an exact location. These parameters will override the settings from the image alignment ("align") and float properties ("static").
If the image is too sharp, the dots-per-inch can be decreased using the "dpi" parameter. (It is not possible to make the image sharper than the original.)
The "static" parameter can be used to specify whether the content around the image will float around the image or not. When the "static" parameter is set to TRUE, additional content will not float around and may actually overlap the image.
Examples
Example 1
{pdf( 'text', 'The logo is on the right hand side of this text.'|wash( 'pdf' ) )} {pdf( 'image', hash( 'src', 'design/mysite/images/company_logo.png', 'width', 200, 'height', 200, 'align', 'right' ) )}
This example displays an image with some text on the left hand side.
Example 2
{pdf( 'image', hash( 'src', $image.full_path, 'width', $image.width, 'height', $image.height ) )}
This example adds the image assigned to the $image variable.
Balazs Halasy (13/05/2004 2:50 pm)
Balazs Halasy (06/06/2005 11:50 am)
Comments
There are no comments.