Preference

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

Table of contents

First steps

Create a Preference object. Add the Preference to the Content object then:

<?php 

use IDML\Content\Preference;

$preference = new Preference();

$content->setPreference($preference);

Since IDML-Creator version 4.0, you can use the Factory to create and register the Preference:

$factory->createPreference();

Defining the bleed

The document bleed can be defined width setDocumentBleed. The second parameter is the unit and in Points per default.

<?php

use IDML\Content\Enum\Unit;

$preference->setDocumentBleed(3, Unit::MILLIMETERS);

The document format

The basic size of your document can be defined by calling setDocumentFormat. Regardless of that, every Page may have its own format.

<?php

use IDML\Content\Enum\Unit;

$preference->setDocumentFormat(210, 297, Unit::MILLIMETERS);

Single or facing pages

An InDesign document may contain single pages or facing pages. Facing pages will cause the document to have a binding in the middle of each Spread.

<?php

$preference->setSinglePage(true);