QX.js API Reference

Layout

app. Layout

new Layout(projectID)

The Layout class represents the real QuarkXPress layout in java scripting world. You can interact with the real QuarkXPress layout using its properties and methods.
Example
let myLayout = new app.Layout(layoutID);
Parameters:
Name Type Description
projectID number The layoutID

Methods

(static) exportLayoutAsPDF(layoutID, path, supressUIFlagsopt, outputStyle) → {string|app.APIError}

It exports the layout as PDF using the given output style.
Parameters:
Name Type Attributes Default Description
layoutID number Id of layout which needs to be export.
path string Complete file path of PDF.
supressUIFlags app.constants.outputSuppressUIFlags <optional>
app.constants.layoutMediaTypes.kOutputUI_Default See outputSuppressUIFlags for all available output flags.
outputStyle string | number Name or ID of the PDF output style.
Returns:
Empty string on success else APIError.
Type
string | app.APIError

delete() → {app.APIError}

It removes the given layout from the project.
Returns:
Undefined on success else APIError.
Type
app.APIError

duplicate(layoutName, layoutMediaTypesopt, layoutOptionsopt) → {app.layout|app.APIError}

It duplicates the layout in the project.
Parameters:
Name Type Attributes Default Description
layoutName string Name of the new layout.
layoutMediaTypes app.constants.layoutMediaTypes <optional>
app.constants.layoutMediaTypes.PRINT_MEDIA_TYPE See layoutMediaTypes for all available layout types.
layoutOptions app.PrintLayoutOptions <optional>
this.getPrintLayoutOptions() See PrintLayoutOptions for all avaiable layout options.
Returns:
Layout object if success else APIError.
Type
app.layout | app.APIError

exportLayoutAsPDF(path, supressUIFlagsopt, outputStyle) → {string|app.APIError}

It exports the layout as PDF using the given output style.
Parameters:
Name Type Attributes Default Description
path string Complete file path of PDF.
supressUIFlags app.constants.outputSuppressUIFlags <optional>
app.constants.layoutMediaTypes.kOutputUI_Default See outputSuppressUIFlags for all available output flags.
outputStyle string | number Name or ID of the PDF output style.
Returns:
Empty string on success else APIError.
Type
string | app.APIError

getDocRef() → {number|app.APIError}

It gives internal document number of the layout.
Returns:
Document number on success else APIError.
Type
number | app.APIError

getPrintLayoutOptions() → {app.PrintLayoutOptions|app.APIError}

It gives the print layout properties of this object.
Returns:
Layout object if success else APIError.
Type
app.PrintLayoutOptions | app.APIError

getUID() → {number|app.APIError}

It gives a unique id of the layout.
Returns:
Unique id on success else APIError.
Type
number | app.APIError