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.outputSuppressUIFlags.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

getCurrentPage() → {Number|app.APIError}

It gives the first visible page in the layout.
Returns:
Returns dispalyed page number on success else APIError
Type
Number | 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

getPageCount() → {Number|app.APIError}

It gives the number of pages in the layout.
Returns:
Returns number of pages 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

gotoPage(pageNumber) → {undefined|app.APIError}

Displays the indicated page if there is one. Allows you to require that displayed page number be accurate.
Parameters:
Name Type Description
pageNumber Number page number to be displayed
Returns:
Returns undefined on success else APIError
Type
undefined | app.APIError

isCZLayout() → {boolean|app.APIError}

Checks if the given layout is compozition layout or not.
Returns:
Returns true or false for compozition layout on success else APIError
Type
boolean | app.APIError