Class AuWidgetPreflight
A widget that is used to verify that pre-designed user files are compatible with your printing equipment. For details, you can refer to the Preflight widget topic.
{
"widgets": [{
"name": "preflight",
"type": "preflight",
"params": {
"config": {
"backendUrl": "http://preflight.example.com",
"product": {
"dpi": 300,
"size": {
"width": 595,
"height": 842
},
"bleed": 20,
"safetyLines": [{
"color": "#00ff00",
"altColor": "#00ff00",
"margin": 40
}]
},
"rules": [
{
"type": "colorspace",
"severity": "error",
"enableFix": true,
"params": {
"allowedColorSpaces": [ "cmyk" ]
}
}
],
...
}
}]
}
You can find the detailed description of the preflight configuration in the config
reference.
Package: ui-framework
Properties
failedChecks
An object containing two arrays, errors and warnings, with failed validation rules.
Declaration
failedChecks: FailedChecksModel = new FailedChecksModel([], [])
Property Value
Type | Description |
---|---|
FailedChecksModel | An object containing two arrays, errors and warnings, with failed validation rules. |
hasEmptyPages
If true
, user upload file for every page.
Declaration
hasEmptyPages: boolean = false
Property Value
Type | Description |
---|---|
boolean | If |
hasFiles
If true
, user upload at least one file.
Declaration
hasFiles: boolean = false
Property Value
Type | Description |
---|---|
boolean | If |
hires
A string array of URLs that link to the print-ready file in PDF format.
Declaration
hires: string[] = []
Property Value
Type | Description |
---|---|
string[] | A string array of URLs that link to the print-ready file in PDF format. |
origins
An array of links to origin images of product pages.
Declaration
origins: OriginModel[] = []
Property Value
Type | Description |
---|---|
OriginModel[] | An array of links to origin images of product pages. |
page
The current preflight page - either uploader or editor.
Declaration
page: PreflightToolStep = "" as PreflightToolStep
Property Value
Type | Description |
---|---|
PreflightToolStep | The current preflight page - either uploader or editor. |
pages
Gets the number of pages.
Declaration
number pages
Property Value
Type | Description |
---|---|
number | Gets the number of pages. |
params
Compiled widget configuration.
Declaration
params: any
Property Value
Type | Description |
---|---|
any | Compiled widget configuration. |
preview
A string array of URLs that link to proof images.
Declaration
preview: string[] = []
Property Value
Type | Description |
---|---|
string[] | A string array of URLs that link to proof images. |
previews
Declaration
previews: PreviewModel[] = []
Property Value
Type | Description |
---|---|
PreviewModel[] |
stateId
The identifier of the last saved state file.
Declaration
stateId: string = ""
Property Value
Type | Description |
---|---|
string | The identifier of the last saved state file. |
Methods
checkInitDependenciesWidgets()
Returns an array of widget names, due to which the current widget cannot receive parameters.
Declaration
function checkInitDependenciesWidgets()
Returns
Type | Description |
---|---|
string[] |
exportWidgetData(boolean)
Declaration
function exportWidgetData(force: boolean)
Parameters
Type | Name | Description |
---|---|---|
boolean | force |
Returns
Type | Description |
---|---|
Promise<PreflightExportData> |
getResults()
Gets links to print-ready and preview images and origin files.
Declaration
function getResults()
Returns
Type | Description |
---|---|
Promise<FinishModel> |
languageObserver(string)
Declaration
function languageObserver(lang: string)
Parameters
Type | Name | Description |
---|---|---|
string | lang |
resetPreloaderState()
Declaration
function resetPreloaderState()
restoreWidgetFromData(PreflightExportData, boolean)
Declaration
function restoreWidgetFromData(data: PreflightExportData, force: boolean)
Parameters
Type | Name | Description |
---|---|---|
PreflightExportData | data | |
boolean | force |
Returns
Type | Description |
---|---|
Promise<void> |
setFiles(string[])
Inserts files into the current product starting from the first page.
Declaration
function setFiles(fileUrls: string[])
Parameters
Type | Name | Description |
---|---|---|
string[] | fileUrls |
An array of links to the files. |
Returns
Type | Description |
---|---|
Promise<void> |
setStep(PreflightToolStep)
Sets the current preflight page.
Declaration
function setStep(step: PreflightToolStep)
Parameters
Type | Name | Description |
---|---|---|
PreflightToolStep | step |
You can enable either |
Returns
Type | Description |
---|---|
Promise<void> |
showPreloader(boolean, string | string[], number)
Shows a preloader.
"onClick": [
"{{#function main.showPreloader(true, 'Creating print files...')}}",
"{{#function $['editor'].getHiResImages(800,800)}}",
"{{#function main.showPreloader(false)}}"
]
Declaration
function showPreloader(isPreload: boolean, message: string | string[], timeout: number)
Parameters
Type | Name | Description |
---|---|---|
boolean | isPreload |
If |
string | string[] | message |
A text message that appears next to the preloader. |
number | timeout |
showToast(string, number)
Shows a toast.
return editor.loadUserInfo(data)
.catch(err => {
this.widget.showToast("Error: Invalid data");
console.log(err);
});
Declaration
function showToast(data?: string, duration?: number)
Parameters
Type | Name | Description |
---|---|---|
string | data |
A string message to display in the toast. |
number | duration |
Defines how long to show the toast for. |