line

Summary

Draws a line.

Usage

pdf( line, hash( x1,        x_start,
                 y1,        y_start,
                 x2,        x_stop,
                 y2,        y_stop,
               [ page,      occurence,     ]
               [ thickness, line_thickness ] ) )

Parameters

NameTypeDescriptionRequired
x1 float Start coordinate of the X-ax. Yes.
y1 float Start coordinate of the Y-ax. Yes.
x2 float Stop coordinate of the X-ax. Yes.
y2 float Stop coordinate of the Y-ax. Yes.
pages string The pages on which the line should appear. No.
thickness float The thickness of the line. No.

Description

This function draws a line. The line will be drawn from the (x1, y1) coordinate to the (x2, y2) coordinate. If the "pages" parameter is omitted or set to "current", the line will only be present on the current page. If "pages" is set to all, it will appear on all the pages. The thickness of the line can be set with the "thickness" parameter; the default thickness is 1.

When the line must be visible on all the pages, the line definition must be set after the content is written to the PDF-document (at the end of the template) and the line should be defined only once. A common technique is to use the "include" operator.

Examples

Example 1

{pdf( 'line', hash( 'x1', 100, 'y1', 100, 'x2', 100, 'y2', 300 ) )}

This example draws a vertical line, from (100, 100) to (100, 300) on the current page.

Example 2

{pdf( 'line', hash( 'x1', 20, 'y1', 30, 'x2', 20, 'y2', 40, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 20, 'y1', 40, 'x2', 30, 'y2', 40, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 30, 'y1', 40, 'x2', 30, 'y2', 35, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 25, 'y1', 35, 'x2', 33, 'y2', 35, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 33, 'y1', 35, 'x2', 33, 'y2', 27, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 25, 'y1', 35, 'x2', 25, 'y2', 27, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 25, 'y1', 27, 'x2', 33, 'y2', 27, pages, 'all' ) )}
{pdf( 'line', hash( 'x1', 20, 'y1', 30, 'x2', 25, 'y2', 30, pages, 'all' ) )}

This example draws the eZ logo in the lower left corner of every page.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.