Guides
How to supply files
In this documentation we will highlight how you should supply your files during the order request.
Files
You can supply the following file types:
- PDF (supports multipage)
- JPG
- PNG
There are 2 types of files you can send to us to be printed on the product you are ordering:
- File which exists of "1 page". This is a PDF with 1 page, JPG or PNG.
- File which exists of 1 or more pages. This is a PDF with 1 or more pages.
As per documentation you send 1 or more file objects in a "files" array which is attached to the product you are ordering. The examples below will show a simplified version of the product and the file array. The objects within the files array will be called `file object` from here on.
Upload a single (page) file
If you want to upload one file, the files array contains a single file object. In this case you have a single-sided product with quantity 1. The selected file will be printed on the item. For example:
Upload a single (page) file example
{
"files": [
{
"uri": "http://link.to/yourfile.jpg"
}
]
}
Default properties of a file object
The reason why the previous example only contains the uri, is because there are some defaults in place. The following example contains all defaults written out to clarify which properties you can set on a file object
:
Default properties of a _file object_
{
"files": [
{
"uri": "http://link.to/yourfile.jpg",
"page": 1,
"side": "front",
"amount": 1,
"rotation": 0,
"fill": true,
"tiling": "none",
"mirror": false
}
]
}
File properties
Usage for shipping_method_preset
Status | Type | Explanation |
---|---|---|
uri |
string | The full URL to the file, must have public access. |
page |
integer | Select a page from a multipage PDF to be printed. See Upload a multi-page file. The default is 1. For a JPG or PNG, you don't have to set this property or just set 1. |
side |
string | For single-sided products this is always "front". For double-sided products, you can add a "back" side to be printed. See _ Upload files for a double-sided product_. The default is "front". |
amount |
integer | If you want to print the file multiple times, you can set the amount. The total amount should not exceed the quantity you chose for the product. The default is 1. |
rotation |
integer | If you want to print the file rotated, you can select degrees, choosing between 0, 90, 180 (upside down), and 270. The default is 0. |
fill |
boolean | If your image is smaller or bigger than the selected dimensions of the product, you can choose to fill the image up or down to the dimensions of the product. The default is false, so the file will not be scaled to fit the product dimensions. Choose false to disable auto-scaling. |
tiling |
boolean | If your selected dimensions of the product exceed the maximum dimensions of a material, the print must be printed on multiple "tiles" which will result in equally sized parts. You can choose to tile it vertically or horizontally. The default is "none", which means it will not be tiled and may result in a not accepted order. |
mirror |
boolean | If you want to print the file mirrored. The default is false. |
Upload a multi-page file
The minimal example to upload a multi-page file is the same as the example in Upload a single file. But this just means, print page 1 of this file and that is probably not of much use. Probably what you want to print is all pages or a set of pages. The following example will result in 2 files, so in this case you need to have a product amount of 2. Which will print an item with page 2 and an item with page 4 of the single-sided product. The following example shows how to print page 2 and 4 of a multi-page file:
Multipage PDF
{
"files": [
{
"uri": "http://link.to/your-multi-page-file.pdf",
"pages": [
{
"page": 2
},
{
"page": 4
}
]
}
]
}
Default properties of a page object
As noted in Default properties of a file object, a page object
also has defaults in place, they are actually the same properties, except for the uri, which is already defined on the same level of the pages array.
The following example contains all defaults written out to clarify which properties you can set on a page object
, the descriptions can be found in File properties
. As you can see you can set all the properties on multi-page pages that can also be set on a single page file. See File properties
for the property descriptions.
Default properties of a _page object_
{
"files": [
{
"uri": "http://link.to/your-multi-page-file.pdf",
"pages": [
{
"page": 2,
"side": "front",
"amount": 1,
"rotation": 0,
"fill": true,
"tiling": "none",
"mirror": false
},
{
"page": 4,
"side": "front",
"amount": 1,
"rotation": 0,
"fill": true,
"tiling": "none",
"mirror": false
}
]
}
]
Upload files for a double-sided product.
If you have single paged files (pdf with 1 page, jpg, png) and you want to print a double-sided product, a minimal example with two different files would be:
Double sided product.
{
"files": [
{
"uri": "http://link.to/front.jpg",
"side": "front"
},
{
"uri": "http://link.to/back.jpg",
"side": "back"
}
]
}
In this case you have a product with quantity 1, with a "front" and a "back" side with 2 different files. The front.jpg which will be printed on 1 side and the back.jpg will be printed on the other side. It is also possible to print the same file on both sides, just define the uri twice. The example looks like this:
Double sided one file
{
"files": [
{
"uri": "http://link.to/both-sides.jpg",
"side": "front"
},
{
"uri": "http://link.to/both-sides.jpg",
"side": "back"
}
]
This will print the same file on both sides. It is not necessary to add side: front in the first object, as it is the default value, but for readability it is documented in the example. We advise that you always add the side property for readability.
Print double-sided files multiple times
In case you want to print 1 double sided product 10 times. A restaurant menu for example. Then you can structure the files array like this:
Print double-sided files multiple times
{
"files": [
{
"uri": "http://link.to/menu.jpg",
"side": "front",
"amount": 10
},
{
"uri": "http://link.to/logo.jpg",
"side": "back",
"amount": 10
}
]
}
If your product has quantity 10, this example will print the menu.jpg on one side and logo.jpg on the other side 10 times.
The amount of the "front" and "back" side need to correspond with each other. In this case both are 10. Also the total amount needs to equal the product quantity you have selected, in this case 10.
Note: because you supply amount 10 for both "front" and "back", this will not result in 20, because "front" and "back" are part of the same single final product, a restaurant menu.
Upload a multi-page PDF to print double-sided
There are useful use cases to use a multi-page for a double-sided print. For example, if you need to print the odd pages as front, and even pages as back, a example would be:
Upload a multi-page PDF to print double-sided
{
"files": [
{
"uri": "http://link.to/multi-page.pdf",
"pages": [
{
"page": 1,
"side": "front"
},
{
"page": 2,
"side": "back"
},
{
"page": 3,
"side": "front"
},
{
"page": 4,
"side": "back"
}
]
}
]
}
This will print 2 items. 1 item with page 1 and page 2 as sides, the other item with page 3 and 4 as sides.
Note: again the "front" and "back" sides should correspond in amount