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

Table of contents

First steps

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


use IDML\Content\Rectangle;

$rectangle = new Rectangle();


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

Size and Position

Add a size and a position like that:


    ->setSize(100, 200)
    ->setPosition(10, 10)

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

Adding an image

To add an image, you need to set up an Image object and add it then: