Configuring products
- 3 minutes to read
You can configure product properties in the config.product object.
How to define the product size
The Preflight Tool uses points as measurement units (1 point = 1/72 inch). To define a product of 10 x 8 inches, you need to set the width to 720 and height to 576. To define the resolution of the resulting print files, you can use the dpi property.
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"dpi": 300,
"size": {
"width": 720,
"height": 576
}
}
}
}
}]
}
How to set product pages
By default, the Preflight Tool opens a one-page product in the editor. For multipage products, you can specify the number of pages in the pages property. You can also allow your users to add and delete pages by using the allowAddPages
and allowDeletePages
properties, correspondingly.
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"pages": 1,
"allowAddPages": true,
"allowDeletePages": true
}
}
}
}]
}
To limit the number of pages that can appear in the editor, you can define the initial
, min
, and max
values as follows:
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"pages": {
"init": 2,
"min": 1,
"max": 4
},
"allowAddPages": true,
"allowDeletePages": true
}
}
}
}]
}
In this example, we open two pages in the editor and allow users to reduce the number of pages to one and increase their number to four. For multipage products, this configuration allows users to open only the first four pages in the editor.
You can also specify page titles when setting up product pages. For two-page products, you can specify the titles in an array as follows:
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"pages": [{ "title": "Front" }, { "title": "Back" }],
"allowAddPages": false,
"allowDeletePages": false
}
}
}
}]
}
How to configure the bleed zone
The Preflight Tool allows you to enable both safety lines and bleed margins. The safety lines only appear in the editor and do not affect print files, whereas the bleed margin is added into print files, thereby enlarging the product size. You can configure them as follows:
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"bleed": 8,
"bleedLineWidth": 1,
"bleedLineColor": "#880000",
"safetyLines": [{
"color": "#00ff00",
"margin": 20
}]
}
}
}
}]
}
How to configure safety lines
A safety line is described by an object that specifies the color, width, margins, and style. You can define one or more such objects in the product.safetyLines
array.
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"safetyLines": [{
"name": "Area 1",
"color": "#00ff00",
"stepPx": 5,
"margin": 40,
"borderRadius": 0,
"widthPx": 1
}]
}
}
}
}]
}
These safety lines will appear on every product page. However, you can define safety lines so that they only appear on certain pages. For example, to display them on even pages:
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"product": {
"safetyLines": [{
"color": "#000088",
"margin": 17,
"pages": ["/2"],
"legend": {
"title": "Even pages",
"description": "These safety lines appear on every second page."
}
}]
}
}
}
}]
}
Here, we have defined pages
as an array of strings with the element "/2"
, which enables the lines on every second page. To enable the lines on every third page, pass "/3"
, and so on.
You can also list page numbers in the pages
array to display safety lines on the corresponding pages. For example, to display them on the second and fourth pages:
...
"pages": [2, 4],
...