The individual Pack user data elements on the Side instances are the building blocks of the actual customer content. They link up with a Template content definition in order to render. Note that you can have user data elements with linkId's that don't exist in the current template. For example you may have extra text lines on a business card that are not present now that the customer has requested a different template. If the customer switched back to the original template, the lines would still be valid.
All data items MUST have the following properties set:
The TextData object provides override information for an individual single line Template content element. Most templates will allow various items to be overridden, but some will enforce certain constraints in order to provide more certainty that the printed product will be as good as the customer expects it to be.
Parameters
"data":[
{
"type":"textData",
"linkId":"back_line_1",
"text":"API test: Name",
"font":{
"fontFamily":"helvetica",
"bold":true,
"italic":false
},
"colour":{
"type":"RGB",
"r": 255,
"g": 0,
"b": 0
},
"pointSize":2.82222222222,
"alignment":"left"
}
]
The MultiLineTextData object provides override information for an individual multi-line text area Template content element. Most templates will allow various items to be overridden, but some will enforce certain constraints in order to provide more certainty that the printed product will be as good as the customer expects it to be. Note that we do NOT support embedded styling within a text blocks.
Parameters
"data":[
{
"type":"multiLineTextData",
"linkId":"back_line_1",
"text":"API test: Name",
"font":{
"fontFamily":"helvetica",
"bold":true,
"italic":false
},
"colour":{
"type":"RGB",
"r": 255,
"g": 0,
"b": 0
},
"pointSize":2.82222222222,
"alignment":"left"
}
]
The ImageData object provides information about an image to be used for rendering into an image Template content element. NOTE - If you want transparent images, please use images embedded into PDFs but NOT PNG's (and especially not those with a 24-bit alpha channel), as the results of rendering these types of images are currently sub-optimal. We are working on this ... please bear with us.
Parameters
"data":[
{
"type":"imageData",
"linkId":"variable_image_front",
"imageBox":{
"center":{
"x":16,
"y":37
},
"width":55.4893617021,
"height":74,
"angle":0
},
"resourceUri":"filestore://image_original/7b83fe35-75ba-c0a802e8-4c754942-4de8.png",
"imageStoreFileId":null,
"enhance":false
}, ...
]
The FixedImageData object allows for the template to specify the size and position of an image to be printed on a Side, possibly allowing for the customer to choose which image is used.
Parameters
"data":[
{
"type":"fixedImageData",
"linkId":"background_box",
"resourceUri":"filestore://image_original/77d14003-1894-558545ee-48e0f943-3b8a.pdf"
}
]
The BoxData object allows for customers to change the background colour of a Side of the printed product. NOTE that you should NOT attempt to colour match backgrounds of images with background colours of image elements in the user data, as I'm afraid the logic to work out the mapping from RGB -> CMYK will almost certainly produce a different colour for the background and image (even more so where it's a JPEG). Colour clashes will be much more evident on the printed product than they are on screen.
Parameters
"data":[
{
"type":"boxData",
"linkId":"background_box",
"colour":{
"type":"RGB",
"r": 0,
"g": 0,
"b": 0
}
}, ...
]
"textData" => array(
"type" => "string",
"linkId" => "string",
"text" => "string",
"font" => array(
"fontFamily" => "string",
"bold" => "boolean",
"italic" => "boolean"
),
"colour" => array(
"type" => "string", /* RGB or CMYK */
/* type == "RGB" */
"r" => "integer", /* 0-255 */
"g" => "integer", /* 0-255 */
"b" => "integer", /* 0-255 */
/* type == "CMYK" */
"c" => "float", /* 0.0-100.0 */
"m" => "float", /* 0.0-100.0 */
"y" => "float", /* 0.0-100.0 */
"k" => "float", /* 0.0-100.0 */
),
"pointSize" => "float",
"alignment" => "float"
),
"multiLineTextData" => array(
"type" => "string",
"linkId" => "string",
"text" => "string",
"font" => array(
"fontFamily" => "string",
"bold" => "boolean",
"italic" => "boolean"
),
"colour" => array(
"type" => "string", /* RGB or CMYK */
/* type == "RGB" */
"r" => "integer", /* 0-255 */
"g" => "integer", /* 0-255 */
"b" => "integer", /* 0-255 */
/* type == "CMYK" */
"c" => "float", /* 0.0-100.0 */
"m" => "float", /* 0.0-100.0 */
"y" => "float", /* 0.0-100.0 */
"k" => "float", /* 0.0-100.0 */
),
"pointSize" => "float",
"alignment" => "float"
),
"imageData" => array(
"type" => "string",
"linkId" => "string",
"imageBox" => array(
"center" => array(
"x" => "float",
"y" => "float"
),
"width" => "float",
"height" => "float",
"angle" => "float"
),
"resourceUri" => "string",
"enhance" => "boolean"
),
"fixedImageData" => array(
"type" => "string",
"linkId" => "string",
"resourceUri" => "string",
"enhance" => "boolean"
),
"boxData" => array(
"type" => "string",
"linkId" => "string",
"colour" => array(
"type" => "string", /* RGB or CMYK */
/* type == "RGB" */
"r" => "integer", /* 0-255 */
"g" => "integer", /* 0-255 */
"b" => "integer", /* 0-255 */
/* type == "CMYK" */
"c" => "float", /* 0.0-100.0 */
"m" => "float", /* 0.0-100.0 */
"y" => "float", /* 0.0-100.0 */
"k" => "float", /* 0.0-100.0 */
)
)