The renderer module executed renderer commands in the censhare Web UI.

Renderer commands

This section describes some of the most important renderer commands. Besides a short description what each command does, the method name and all special parameters are given. Parameters are normally defined as attributes of the command node. All commands have the following two standard parameters.

Additionally, a short XML example is given of how to define each command.

Change Page Size Command

This command can be used to change the size of all pages of a document. Therefore, one page width and one page height can be specified.

Method Name
Parameters
Example
<command document_ref_id="1" method="change-page-size" page_width="300" page_height="500"/>

Check Missing Fonts Command

This command can be used to check if a document contains any missing fonts. If so, an exception is thrown.

Method Name
Parameters

No special parameters are needed.

Example
<command document_ref_id="1" method="check-missing-fonts"/>

Check Missing Links Command

This command can be used to check if a document contains any missing image links. It aborts the current command sequence in case that any image link in the document is marked as missing. This command is typically included when creating a PDF. Note, that the command ignores missing text links, since texts are embedded into the layout anyway and hence missing or modified links do not lead to low quality print results as is the case for images.

Method Name
Parameters

No special parameters are needed.

Example
<command document_ref_id="1" method="check-missing-links"/>

Check Modified Links Command

This command can be used to check if a document contains any modified image links. It aborts the current command sequence in case that any image link in the document is marked as modified, i.e. a content update is outstanding. This command is typically included when creating a PDF. Note, that the command ignores modified text links, since texts are embedded into the layout anyway and hence missing or modified links do not lead to low quality print results as is the case for images.

Method Name
Parameters

No special parameters are needed.

Example
<command document_ref_id="1" method="check-modified-links"/>

Check Placed Collections Command

This command can be used to check if all placements of a document, which are placed via a collection (layout group transformation), are still valid. If any significant attributes, e.g. the language, have changed, the collections are placed again. This is effectively the same as executing all layout group transformations again, but more efficient, since placements are only changed if necessary.

This command does not only check if the source asset of a placement has changed, but also if URL parameters of placements done via transformations are different (e.g. another target-asset-id or group-name). If so, the transformation must be re-executed. This command is typically used after the asset structure of a layout was duplicated.

Method Name
Parameters
Example
<command document_ref_id="1" method="check-placed-collections" picture_placement_rule="fit-proportional"/>

Close Command

This command can be used to close an previously opened document.

Method Name
Parameters

No special parameters are needed.

Example
<command document_ref_id="1" method="close"/>

Copy Pagearea Asset Command

This command can be used to copy the content of a pagearea asset on a page or into a target box (i.e. other pagearea) at given position in points (relative to parent component). Note: The pagearea asset is not actually placed (i.e. no relation is created), just it's content is copied.

Method Name
Parameters
Example
<command document_ref_id="1" method="copy-pagearea-asset" uid="#1002" parent_uid="p1" place_asset_element_id="1"
        place_asset_id="502770" xoffset="11.943127" yoffset="11.943127">
  <uid-mapping from="b282" to="#1005"/>
  <uid-mapping from="b281" to="#1004"/>
</command>

Copy Pagearea Command

This command can be used to copy the content of a pagearea box from one document to another.

Method Name
Parameters
Example
<command method="copy-pagearea" source_document_ref_id="1" source_uid="b100" document_ref_id="2" uid="#1002"
        parent_uid="p1" xoffset="12.6" yoffset="11.3">
  <uid-mapping from="b282" to="#1005"/>
  <uid-mapping from="b281" to="#1004"/>
</command>

Correct Document Command

This command can be used to validate a document and correct it's slugs and child element relations, if necessary. Typically it is used for documents that were created by duplication or when applying a copy template.

Method Name
Parameters
Example
<command document_ref_id="1" method="correct-document" force-correction="true", force-conversion="true"/>

Debug Command

This command can be used to to debug the current request of the renderer and the currently open documents. If such a command is contained in the command sequence the document will not be opened in hidden mode - it will be opened visible. When the debug step is reached a confirmation dialog is shown and the execution will stop until the user has pressed either "ok" or "cancel".

Note that this command will be ignored if the renderer runs in headless mode.

Method Name
Parameters
Example
<command document_ref_id="1" method="debug"/>

Delete Boxes Command

This command can be used to to delete boxes from the document. Boxes can be specified either directly via a box element with a box uid or indirectly via a group element and a group id. All corresponding boxes (together with potentially child boxes) will then be deleted.



This command already takes care of updating the asset element structure (and synchronizing (element) relations with placements) after deleting boxes with placements.



Method Name

Parameters

Example

<command method="delete-boxes" document_ref_id="1">
  <box uid="b220"/>
  <group id="1"/>
  <box uid="b221"/>
  <group id="2"/>
</command>

Detach Command

This command can be used to detach a placement from a specific box. The box itself will not be deleted.

Method Name

Parameters

Example

<command document_ref_id="1" method="detach" uid="b220"/>

Detach Pagearea Command

This command can be used to detach a pagearea box and all of it's subcomponents from a document.

Method Name

Parameters

Example

<command document_ref_id="1" method="detach-pagearea" uid="b220"/>

Dissolve Command

This command can be used to dissolve the file link of a placed text (with or without a transformation). That text is than embedded into the document and the corresponding box is unlocked and can be freely modified regarding content and style.

Note that the embedded text looses its relation to the corresponding censhare text asset. So it's no longer possible to run a content update on the affected text box.

Method Name

Parameters

Example

<command document_ref_id="1" method="dissolve" uid="b220"/>

Edit Placement Command

This command can be used to change the scale, offset and rotation of a placement in a picture box.

Method Name

Parameters

Example

<command method="edit-placement" document_ref_id="1" asset_element_id="24"
      rotation="90" xscale="0.2" yscale="0.2" xoffsetmm="50" yoffsetmm="20"/>

Exchange Opi Command

This command can be used to replace all high resolution picture against OPI pictures or vice versa. That is all picture placements corresponding to a master storage of an asset are re-linked to the corresponding opi storage item (or vice versa).

Method Name

Parameters

Example

<command method="exchange-opi" document_ref_id="1" place_storage_key="opi"/>

Export Command

This command can be used to create a PDF, EPS, IDML or a preview file from a document. This file is then copied to the server and the corresponding file system and file path are returned.

Method Name

Parameters

Example

Input:

<command method="preview" format="JPEG" scale="0.5" document_ref_id="1"/>

Output:

<command method="preview" format="JPEG" scale="0.5" document_ref_id="1">
  <file element_idx="1" corpus:asset-temp-filepath="file:335008.jpg" corpus:asset-temp-filesystem="assets-temp"/>
  <file element_idx="2" corpus:asset-temp-filepath="file:335009.jpg" corpus:asset-temp-filesystem="assets-temp"/>
</command>

Export Document Command

This command can be used to export a given document. The placed pictures/texts of the document are exported and the placements are exchanged (asset file paths are replaced by local paths), all slugs are removed from the document and the document file is exported itself. The whole export folder is then zipped and the ZIP file is copied to the server (file references are reported).

Method Name

Parameters

Example

Input:

<command document_ref_id="1" method="export-document" export-placed-media="true" export-placed-texts="true" create-links-folder="true"/>

Result:

<command document_ref_id="1" method="export-document" export-placed-media="true" export-placed-texts="true" create-links-folder="true">
  <file corpus:asset-temp-filepath="file:275483.zip" corpus:asset-temp-filesystem="temp"/>
</command>

Mark Not Printable Boxes Command

This command can be used to find boses that will be marked as "not printable". This command is typically executed before an output format (PDF, EPS) of the document is created. The target boxes, which must be marked, are identified by XPath filters, which filter either placed assets or boxes.

Method Name

Parameters

Example

<command document_ref_id="1" method="mark-not-printable-boxes">
  <box-filter condition=":element/@content='text' and element/@page='p3'"/>
</command>

Move Box Command

This command can be used to move a pagearea or box and all of it's subcomponents within a document, optionally resizing the component.

Method Name

Parameters

Example

<command document_ref_id="1" method="move-box" uid="b100" parent_uid="p1" xoffset="11.943127"
        yoffset="11.943127" width="90" height="100"/>

Open Command

This command can be used to open a document and is the beginning of every render command sequence.

Method Name

Parameters

Example

<command method="open" asset_id="241110" document_ref_id="1"/>

Place Collection Command

This command can be used to place a collection asset onto a document. Either into a dedicated target group or into any group.

Method Name

Parameters

Example

<command document_ref_id="1" method="place-collection" group_id="3" place_asset_id="241110"
        transformation_key="censhare:product-transformation" picture_placement_rule="fit-proportional"/>

Place Command

This command can be used to place an asset into a specific box.

Method Name

Parameters

Example

<command method="place" document_ref_id="1" uid="b220" asset_element_id="13" place_asset_id="452370"
        place_asset_element_id="0" place_storage_key="master"/>

Place Snippet Command

This command can be used to place an InDesign snippet asset onto a page. Optionally, a content asset (e.g. a product) is additionally placed into every group of the placed snippet.

Method Name

Parameters

Example

<command document_ref_id="1" method="place-snippet" parent_uid="p1" snippet_asset_element_id="0" snippet_asset_id="502770"
        xoffset="11.943127" yoffset="11.943127" place_asset_id="502771"/>

Rename Group Command

This command can be used to change the name of a layout group.

Method Name

Parameters

Example

<command document_ref_id="1" method="rename-group" group_id="3" group_name="Group C"/>

Report Command

This command can be used to request a document report.

Method Name

Parameters

Example

<command document_ref_id="1" method="report" expand="minimal" structure="content"/>

Save Command

This command can be used to save a document into a file. This file is then copied to the server and the corresponding file system and file path are returned. Additionally, the application version of the document is written into the XML.

Method Name

Parameters

No special parameters are needed.

Example

Input:

<command method="save" document_ref_id="1"/>

Output:

<command method="save" document_ref_id="1" corpus:asset-temp-filepath="file:335010.indd"
        corpus:asset-temp-filesystem="assets-temp" corpus:app_version="8.1"/>

Script Command

This command can be used to execute an InDesign script (JavaScript, AppleScript or VBScript). It is possible to define two different script output results (using function app.scriptArgs.setValue). With name "censhareResult" a general script output value can be defined which is then written into the result attribute of the script child node. With name "censhareResultFiles" an escaped XML string can be defined which is used to reference files and folders created during the script. The syntax of this files XML is like this:

<files>
  <file key="key1" path="/Users/xx/Desktop/fileFromScript.txt"/>
  <file key="key2" path="/Users/xx/Desktop/folderFromScript"/>
</files>

These files are then copied to the server and the corresponding file system and file path are returned in a files child nodes of the script node (see examples for details).

Method Name

Parameters

Examples

Input:

<command document_ref_id="1" method="script" script_asset_id="35673">
  <param name="input1" value="1"/>
  <param name="input2" value="2"/>
  <boxes>
    <box uid="b220"/>
  </boxes>
</command>

<command method="script" document_ref_id="1">
  <script language="javascript">
    app.scriptArgs.setValue("censhareResult", "This is the script result");
  </script>
</command>

<command method="script" document_ref_id="1">
  <script language="javascript">
    /* use script to create a file /Users/xx/Desktop/file1FromScript.txt and a folder /Users/xx/Desktop/folderFromScript */
    var resultFilesString = "&lt;files&gt;&lt;file key=\"key1\" path=\"/Users/xx/Desktop/fileFromScript.txt\"/&gt;&lt;file key=\"key2\" path=\"/Users/xx/Desktop/folderFromScript\"/&gt;&lt;/files&gt;";
    app.scriptArgs.setValue("censhareResultFiles", resultFilesString);
  </script>
</command>

Output:

<command document_ref_id="1" method="script" script_asset_id="35673">
  <param name="input1" value="1"/>
  <param name="input2" value="2"/>
  <boxes>
    <box uid="b220"/>
  </boxes>
</command>

<command method="script" document_ref_id="1">
  <script language="javascript" result="This is the script result">
    app.scriptArgs.setValue("censhareResult", "This is the script result");
  </script>
</command>

<command method="script" document_ref_id="1">
  <script language="javascript">
    /* use script to create a file /Users/xx/Desktop/file1FromScript.txt and a folder /Users/xx/Desktop/folderFromScript */
    var resultFilesString = "&lt;files&gt;&lt;file key=\"key1\" path=\"/Users/xx/Desktop/fileFromScript.txt\"/&gt;&lt;file key=\"key2\" path=\"/Users/xx/Desktop/folderFromScript\"/&gt;&lt;/files&gt;";
    app.scriptArgs.setValue("censhareResultFiles", resultFilesString);
    <files>
      <file key="key1" path="/Users/xx/Desktop/fileFromScript.txt" corpus:asset-temp-filepath="file:335024.txt" corpus:asset-temp-filesystem="assets-temp"/>
      <file key="key2" path="/Users/xx/Desktop/folderFromScript" corpus:asset-temp-filesystem="assets-temp" folder="true" corpus:asset-temp-filepath="file:335025.zip"/>
    </files>
  </script>
</command>

Text Content Command

This command can be used to export the text content of a document into into different files for one or every page. These files are then copied to the server and the corresponding file systems and file paths are returned.

Method Name

Parameters

Example

Input:

<command document_ref_id="1" method="text-content" mimetype="application/vnd.adobe.indesign-idms"/>

Output:

<command document_ref_id="1" method="text-content" mimetype="application/vnd.adobe.indesign-idms">
  <file element_idx="1" corpus:asset-temp-filesystem="assets-temp" corpus:asset-temp-filepath="file:335024.idms" mimetype="application/vnd.adobe.indesign-idms"/>
  <file element_idx="2" corpus:asset-temp-filesystem="assets-temp" corpus:asset-temp-filepath="file:335025.idms" mimetype="application/vnd.adobe.indesign-idms"/>
</command>

Update Asset Element Structure Command

This command can be used to update the asset elements (actual and optionally target) of the document asset to be in sync with the document structure.

Method Name

Parameters

Example

<command document_ref_id="1" method="update-asset-element-structure" force="true" sync-target-elements="true"/>

Update Auto Client Variant Command

This command can be used to update all layout geometry variants of the document asset. Therefore, the current document is closed, the original document is copied from server and opened. All elements (actual and target) from document are replaced with elements from the original document. All placed texts of current document, where any version of the text is placed on the master document too, are imported again with the current version of the text in the variant.

Method Name

Parameters

No special parameters are needed.

Example

<command document_ref_id="1" method="update-auto-client-variant"/>

Update Content Command

This command can be used to update the content of all placements of either one or all placed assets.

Method Name

Parameters

Example

<command method="update-content" document_ref_id="1" asset_id="241120"/>

Update Geometry Command

This command can be used to execute a geometry of a document layout asset.

Method Name

Parameters

Example

<command method="update-geometry" document_ref_id="1"/>

Update Meta Data Command

This command can be used to update the meta data (layout box tags) of a given tagged text box. Therefore, it is searched for elements of the form.

<censhare:content configurationAssetKey="id">

in the XML structure of the box's content.

Method Name

Parameters

Example

<command method="update-meta-data" document_ref_id="1" uid="b220">
  <meta-data>
    <item id="censhare:layout-box-tag.name>Product A</item>
    <item id="censhare:layout-box-tag.price>12.99</item>
  </meta-data>
</command>

Update Placeholder Command

This command can be used to update XML tags of a given document from the attributes of the corresponding asset.

Method Name

Parameters

No special parameters are needed.

Example

<command method="update-placeholder" document_ref_id="1"/>
related-topics