Rendering
Controller for rendering templates.
Preview
Renders a PSD template and returns a URL to display the preview in a browser.
Request Example:
var data = {
template: "games.psd",
format: "png"
};
$.ajax({
url: "http://localhost:84/api/rendering/preview",
type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(data),
success: function(d) {
console.log(d);
},
error: function(d) {
console.error(d.responseText);
}
});
Response Example:
"http://localhost:84/api/results/download/1f78f1d8-cf23-45a0-ac47-ef57774cd435.png/"
Request
POST /api/rendering/preview[?disableCache]
Parameters
Name | In | Type | Default | Notes |
---|---|---|---|---|
*model | body |
|
Rendering parameters |
|
disableCache | query | False | Enables rendering and loading assets every time you make requests. By default, this is |
Responses
Status Code | Type | Description | Samples |
---|---|---|---|
200 | string | Returns a link to the rendered preview |
|
500 | Server Error |
Hires
Renders a PSD template and returns a URL that links to the print-ready PDF file.
Request Example:
var payload = {
template: "games.psd",
data: {
Team: {
type: "text",
text: "Washington Capitals"
}
}
};
$.ajax({
url: "http://localhost:84/api/rendering/hires",
type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(payload),
success: function(d) {
console.log(d);
},
error: function(d) {
console.error(d.responseText);
}
});
Response Example:
"http://localhost:84/api/results/download/d8040e7e-53ed-406e-aef6-15e41b39a5c2.pdf/"
Request
POST /api/rendering/hires[?disableCache]
Parameters
Name | In | Type | Default | Notes |
---|---|---|---|---|
*model | body |
|
Rendering parameters |
|
disableCache | query | False | Enables rendering and loading assets every time you make requests. By default, this is |
Responses
Status Code | Type | Description | Samples |
---|---|---|---|
200 | string | Returns a link to the print file |
|
500 | Server Error |
MultipagePreview
Generates preview images for several PSD files to display them in a browser.
In the request payload, this request accepts the pages
array defining parameters to render several PSD file.
Request Example:
var model = {
"pages": [
{
"template": "calendar-sample"
},
{
"template": "games.psd",
"format": "png"
}
]
};
$.ajax({
url: "http://localhost:84/api/rendering/multipage/preview",
type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(model),
success: function(d) {
console.log(d);
},
error: function(d) {
console.error(d.responseText);
}
});
In the request response, you will get a JSON with an array of links to the rendered previews. For example:
{
"results": [
{
"url": "http://localhost:17395/api/results/download/?file=AA4A29399EC558951129149939092EE0.jpeg"
},
{
"url": "http://localhost:17395/api/results/download/?file=C71143396DE51525457F1020170EB29D.png"
}
]
}
Request
POST /api/rendering/multipage/preview[?disableCache]
Parameters
Name | In | Type | Default | Notes |
---|---|---|---|---|
*model | body |
|
A JSON object that contains a |
|
disableCache | query | False | Enables rendering and loading assets every time you make requests. By default, this is |
Responses
Status Code | Type | Description | Samples |
---|---|---|---|
200 |
|
Returns links to rendered images |
|
500 | Server Error |
MultipageHires
Renders several PSD files and generates a multi-page PDF file of print-ready images.
In the request payload, this request accepts the pages
array defining parameters to render several PSD file.
Request Example:
var model = {
"pages": [
{
"template": "calendar-sample"
},
{
"template": "games"
}
]
};
$.ajax({
url: "http://localhost:84/api/rendering/multipage/hires",
type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(model),
success: function(d) {
console.log(d);
},
error: function(d) {
console.error(d.responseText);
}
});
In the request response, you will get a JSON with an array of one or more links to print files. For example:
{
"results": [
{
"url": "http://localhost:17395/api/results/download/?file=16D258EB44FBD814100DBCFCA90BD64B.pdf"
}
]
}
Request
POST /api/rendering/multipage/hires[?disableCache]
Parameters
Name | In | Type | Default | Notes |
---|---|---|---|---|
*model | body |
|
A JSON object that contains a |
|
disableCache | query | False | Enables rendering and loading assets every time you make requests. By default, this is |
Responses
Status Code | Type | Description | Samples |
---|---|---|---|
200 |
|
Returns links to rendered images |
|
500 | Server Error |
Definitions
PreviewModel
Controller for rendering templates.
Name | Type | Notes |
---|---|---|
format | string | |
size | object | |
jpegQuality | integer (int32) | |
optimizePreview | boolean | |
unsharpMask | object | |
template | string | |
data | object | |
preloadImages | boolean |
HiresModel
Controller for rendering templates.
Name | Type | Notes |
---|---|---|
template | string | |
data | object | |
preloadImages | boolean |
MultipagePreviewModel
Controller for rendering templates.
Name | Type | Notes |
---|---|---|
pages |
|
MultipageRenderingResponseModel
Links to rendering results.
Name | Type | Notes |
---|---|---|
results |
|
RenderingResponseModel
Name | Type | Notes |
---|---|---|
url | string |
MultipageHiresModel
Controller for rendering templates.
Name | Type | Notes |
---|---|---|
combine | boolean | |
pages |
|