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

Table of contents

First steps

Set up a Layer object like that:


use IDML\Content\Layer;

$layer = new Layer(); 

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

Every layer needs to be added into the Designmap:


use IDML\Content\DesignMap;

$designMap = new DesignMap();


Layers may have different colors when working in InDesign. Add a color from the Color Enum like that:


use IDML\Content\Enum\Layer\Color;


Placing objects into layers

When working with layers in InDesign, the logic is to place an object into a layer. Our logic is different here: you need to tell an object to which layer it belongs.


$myRectangle = new Rectangle();