DesignMap
This document is about how to set up and use the DesignMap object.
Table of contents
First steps
Every IDML file needs a DesignMap. Create one and set it to the Content object:
<?php
use BitAndBlack\IdmlCreator\Content\DesignMap;
$designMap = new DesignMap();
$content
->setDesignMap($designMap)
;
Since IDML-Creator version 4.0
, you can use the Factory to create and register the DesignMap:
$factory->createDesignMap();
Languages
The document language can be set with the help of the Content Language Enum.
<?php
use BitAndBlack\IdmlCreator\Content\Language\Language;
use BitAndBlack\IdmlCreator\Content\Enum\Content\Language as LanguageEnum;
/**
* This will set the language to german and danish.
*/
$designMap
->addLanguage(
new Language(LanguageEnum::DE_DE_2006),
new Language(LanguageEnum::DANISH)
)
;
Color Profiles
The document's color profiles can be set like that:
<?php
use BitAndBlack\IccProfile\IccProfile;
$designMap
->addColorProfile(
new IccProfile('/path/to/your/custom.icc')
)
;
You can use the ICC profiles as a PHP dependency! IDML-Creator makes use of the bitandblack/iccprofile library, which comes with a huge folder of profiles. If you want to use them, you'll find them under /vendor/bitandblack/iccprofile/data
. All profiles can be used with the help of an Enum:
<?php
use BitAndBlack\IccProfile\File;
use BitAndBlack\IccProfile\FileEnum;
use BitAndBlack\IccProfile\IccProfile;
$iccFile = new File(FileEnum::PROFILE_PSOcoated_v3());
$designMap
->addColorProfile(
new IccProfile($iccFile)
)
;