Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

image

Summary

Inserts an image to the PDF document (DEPRECATED).

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

NameTypeDescriptionRequired
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)

Julia Shymova (11/01/2008 1:05 pm)

Balazs Halasy, Julia Shymova


Comments

  • Problem with image PDF

    Hello,
    I have a problem with this function, I have used it like the documentation but the image don't be display... I have test these 3 solutions but not one work... So if you have any idea. I would thanks a lot.

    {pdf( 'image', hash( 'src', 'design/mysite/images/img/logo.jpg',
    'width', 200,
    'height', 200,
    'align', 'right' ) )}

    {pdf(image, hash( 'src', '/extension/mysite/design/mysite/img/logo.jpg') )}

    {pdf(image, hash( 'src', 'http://domaine.fr/extension/mysite/design/mysite/img/logo.jpg') )}



    • Re: Problem with image PDF

      The solution is :

      {pdf(image, hash( 'src', 'extension/mysite/design/mysite/img/logo.jpg') )}

      ^^