This section describes an obsolete packaging solution. We recommend using 3D mockups for packaging, which are integrated into the Customer's Canvas cloud.
CreateDieCutTemplate
- 1 minute to read
The ~/api/Origami/CreateDieCutTemplate endpoint generates die-cut templates based on a model ID and parameters. As a result, you get a mockup in the SVG format, a model in the COLLADA format, and a die-cut template in PDF.
Request type
[POST]
URL
~/api/Origami/CreateDieCutTemplate
Request Payload
You can pass data in the following format in this POST request.
{
ModelId:"ECMA A20.21.03.01",
Params:{
L:50,
W:30,
H:60
}
}
Example call
var dieCutModelParams = {
L:50,
W:30,
H:60
};
$.ajax({
type: "POST",
url: appUrl + "api/Origami/CreateDieCutTemplate",
dataType: 'json',
data: JSON.stringify({
ModelId: "ECMA A20.21.03.01",
Params: dieCutModelParams
}),
contentType: "application/json; charset=utf-8",
success: function (data, textStatus, jqXHR) {
console.log("dieCutTemplate: " + JSON.stringify(dieCutTemplate));
},
error: function (jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
}
});
Success response
Status Code: 200 OK
Content:
[
{
"Mockup":"origami/bxr2gajj.fo4",
"Template":"h5mkuxbl.r0u",
"Model3D":"xthxzotk.rkh",
"Width":2155,
"Height":2309,
"Dpi":300.0,
"Name":"",
"Animation":null,
"Position":null
}
]
The success response contains the following properties:
Mockupis used by Customer's Canvas to display a die-cut template. A mockup is a graphics overlay we load to the Design Editor to show a die-cut template. The value is the name of a mockup file (without an extension) placed to the location defined by the Origami.CustomersCanvasMockupPath key.Templateis an ID of the die-cut template in the PDF format. This file is placed to the location defined by the Origami.DieCutTemplatePath key.Model3Dis an ID of a 3D model file. This file is placed to the location defined by the Origami.Model3DPath key.Widthand Height define the size of the mockup in pixels.Dpiis used to translate the size to absolute units (inches, cm).- If a model has several elements (for example, if a box consists of a container and a lid), then the following parameters are used:
Nameof the element.Positionof the element (to align items to each other).Animationof the element position (opening and closing the box).