This document is about how to set up and use a GraphicLine object.

Table of contents

First steps

Set up a GraphicLine object and add it to a page object like that:


use IDML\Content\GraphicLine;

$graphicLine = new GraphicLine();


If you want to set your own unique identifier, set up the GraphicLine like that: new GraphicLine('UniqueName');

Size and Position, Startpoint and Endpoint

Unlike the Rectangle or similar objects, a GraphicLine has no position and no size. Instead, a start point and an end point need to be set:


    ->setStartPoint(50, 50)
    ->setEndPoint(50, 100)

The example will result in a 50-point long GraphicLine.

Add Unit::MILLIMETERS as third parameter of each method if you prefer numbers in millimeters.