Token and Variables for dynamic imposition

To make imposition more dynamic, a number of Token about page sizes and Runlist Variables have been made available. They can be used to create new or modify existing SheetSizes as well as slots.
Also the number of Sheets, the current Sheet and the  current Slot can be determined.

Samples how to use them are available in this manual as well.

Token for page sizes

All page geometry boxes of each page can be derived using the following Token.

The resulting values will be given in pt.
<PAGE> must be replaced by the requested page number of the PDF.

MEDIABOXLEFT( <PAGE> )
MEDIABOXRIGHT( <PAGE> )
MEDIABOXTOP( <PAGE> )
MEDIABOXBOTTOM( <PAGE> )
MEDIABOXWIDTH( <PAGE> )
MEDIABOXHEIGHT( <PAGE> )
Left edge on x axis
Right edge on xaxis
Top edge on y axis
Bottom edge on y axis
Width
Height
CROPBOXLEFT( <PAGE> )
CROPBOXRIGHT( <PAGE> )
CROPBOXTOP( <PAGE> )
CROPBOXBOTTOM( <PAGE> )
CROPBOXWIDTH( <PAGE> )
CROPBOXHEIGHT( <PAGE> )
Left edge on x axis
Right edge on xaxis
Top edge on y axis
Bottom edge on y axis
Width
Height
BLEEDBOXLEFT( <PAGE> )
BLEEDBOXRIGHT( <PAGE> )
BLEEDBOXTOP( <PAGE> )
BLEEDBOXBOTTOM( <PAGE> )
BLEEDBOXWIDTH( <PAGE> )
BLEEDBOXHEIGHT( <PAGE> )
Left edge on x axis
Right edge on x axis
Top edge on y axis
Bottom edge on y axis
Width
Height
TRIMBOXLEFT( <PAGE> )
TRIMBOXRIGHT( <PAGE> )
TRIMBOXTOP( <PAGE> )
TRIMBOXBOTTOM( <PAGE> )
TRIMBOXWIDTH( <PAGE> )
TRIMBOXHEIGHT( <PAGE> )
Left edge on x axis
Right edge on x axis
Top edge on y axis
Bottom edge on y axis
Width
Height
ARTBOXLEFT( <PAGE> )
ARTBOXRIGHT( <PAGE> )
ARTBOXTOP( <PAGE> )
ARTBOXBOTTOM( <PAGE> )
ARTBOXWIDTH( <PAGE> )
ARTBOXHEIGHT( <PAGE> )
Left edge on x axis
Right edge on x axis
Top edge on y axis
Bottom edge on y axis
Width
Height

Create new or modify existing Sheets

SetSheet	<Sheet number>

The command SetSheet changes or adds a Sheet definition.
If a Sheet definition for <Sheet number> already exists the command overrides the current definition. Otherwise it adds a new Sheet definition.

Added Sheet definitions will not be part of the Sheet sequence evaluation if NewSheet is used without <Sheet number> parameter. Sheets are actually inserted into the imposed document only after the complete runlist has executed. Therefore it is not recommended to set Sheet sizes to different values for the same <Sheet number>, the values from the last call to NewSheet will always be used for all Sheets created with NewSheet regardless of the Sheet definition that was in place at the time where NewSheet was called!

The MediaBox and optional TrimBox values for the new or modified Sheet definition are taken from the following variables, which must be set before calling SetSheet.

SHEET_DEF_MEDIABOX_L
SHEET_DEF_MEDIABOX_B
SHEET_DEF_MEDIABOX_W
SHEET_DEF_MEDIABOX_H
Lower left starting point on y-axis
Lower left starting point on x-axis
Width
Height
SHEET_DEF_TRIMBOX
SHEET_DEF_TRIMBOX_L
SHEET_DEF_TRIMBOX_B
SHEET_DEF_TRIMBOX_W
SHEET_DEF_TRIMBOX_H
Activate TrimBox for a Sheet, value must be "1"
Lower left starting point on y-axis
Lower left starting point on x-axis
Width
Height

Create new or modify existing Slots

MakeSlot	<Sheet number>	<Slot number>

Creates a dynamic Slot with id <Slot number> for Sheet <Sheet number>.
If a Slot with the same Id already exists in the Sheet config the old Slot is shadowed by the dynamic Slot.
The Slot parameters for the dynamic Slot are taken from the following variables (see also the documentation for the Slot parameters in the documentation of the sheet config file format).

SLOT_DEF_TRIMBOX_L
SLOT_DEF_TRIMBOX_B
SLOT_DEF_TRIMBOX_W
SLOT_DEF_TRIMBOX_H
SLOT_DEF_BLEED_L
SLOT_DEF_BLEED_B
SLOT_DEF_BLEED_R
SLOT_DEF_BLEED_T
SLOT_DEF_SCALE_X
SLOT_DEF_SCALE_Y
SLOT_DEF_ROTATION
SLOT_DEF_PLACEMENT
SLOT_DEF_BindingMargin
SLOT_DEF_CropMarkStyleLB
SLOT_DEF_CropMarkStyleLT
SLOT_DEF_CropMarkStyleRT
SLOT_DEF_CropMarkStyleRB
SLOT_DEF_ClipMode
SLOT_DEF_TGSetting
Lower left starting point on y-axis (Default: 0)
Lower left starting point on x-axis (0)
Width (100)
Height (100)
Bleed offset left (0)
Bleed offset bottom (0)
Bleed offset right (0)
Bleed offset top (0)
Scaling x-axis (100 percent)
Scaling y-axis (100 percent)
Rotation (0)
Placement in slot (LB)
Binding margin (N)
Crop mark style left bottom (N)
Crop mark style left top (N)
Crop mark style right top (N)
Crop mark style right bottom (N)
Crop to page box (P) or to slot (S) (default: page box)
Position as isolated (I) or non-isolated transpancy group (N) (default: isolated)

Delete Slot

DeleteSlot	<Sheet number>	<Slot number>

Deletes a dynamic Slot with id <Slot number> for sheet <Sheet number>.
If a Slot with the same Id exists in the sheet config the old Slot is reactivated.

Capture Slot

CaptureSlot	<Sheet number>	<Slot number>

Captures the values from a Slot from the sheet config.
Populates all Variables used by MakeSlot with the values defined in the sheet config.

Create and use a Function definition

Function	<TAB>	<FUNC_NAME>

Start the definition of a Function with name <FUNC_NAME> (literal)

EndFunc

Terminates a Function definition

Return

Terminates the execution of a Function before its completion

Call	<CALL_FUNC_NAME>

Calls the Funtion with the name <CALL_FUNC_NAME> (Token expression)

Retrieving information about Sheets and Slots

NUMSHEETS()

gives us the number of available/defined sheets.

NUMSLOTS(<SHEET_INDEX>)

gives us the number of the Slots on the Sheet with the defined index.

GETSLOTID(<SHEET>,<SLOT_INDEX>) 

gives us the Slot ID (needed for defining the Slot during imposition) of the specified Sheet and the specified Slot index.