(v13) Example: Adding collation and page reversal keys
This page applies to Harlequin v13.1r0 and later; and to Harlequin MultiRIP but not Harlequin Core.
The Output Controller supports collation of multiple copies and reverse page order delivery. This example shows how to link the related keys in the %pagebuffer%
device to the pagedevice.
Use of the Output Controller implies that the Harlequin RIP must be operating in Multiple or Multiple (Parallel) mode.
These features are controlled from PostScript code using two device parameters on the %pagebuffer%
device. These parameters control where page buffers are inserted in the Active Queue when they are first introduced after being created by the RIP and when subsequently re-inserted after each copy has been delivered to the plugin. The insertion points determine the order in which each copy of each page within a job reaches the top of the Active Queue and consequently the order of delivery to the output device.
Collate copies by setting the boolean %pagebuffer%
device parameter /CollateCopies
to true
. The value of CollateCopies
is preserved in the page buffer header because it determines where pages are re-inserted into the Active Queue after successful imaging.
Output page order can be reversed by setting the boolean %pagebuffer%
device parameter /ReversePageOrder
to true
. The value of ReversePageOrder
is not stored in the page buffer header because it only affects the initial position in which pages are inserted into the Active Queue as the RIP generates them.
The value of these parameters is implicitly reset to the default value false
every time the RIP prepares to output a page, so they must be set explicitly for every page from an appropriate place (such as a /StartRender
procedure).
The following code shows how to connect the standard PostScript page device keys /Collate
and /OutputFaceUp
to the /CollateCopies
and /ReversePageOrder %pagebuffer%
device parameters, respectively. You could implement code like this as part of a plugin’s setup PostScript code or as a page feature.
The PostScript language definition of /OutputFaceUp
is how pages are ordered in the stack of output produced rather than whether the sheets are actually delivered face up or not in the output tray. For example, it is appropriate when a device physically outputs sheets face down on top of each other onto an output tray for /OutputFaceUp
to map directly on to /ReversePageOrder
. When a device delivers sheets face up on top of each other, /OutputFaceUp
can be negated before mapping on to /ReversePageOrder
.
%!PS-Adobe
%%Title: "Collate"
%%Creator: Harlequin Limited.
% Copyright (c) 1998-2000 Harlequin Limited. All Rights Reserved.
% This example code shows how it is possible to control copy
% collation and reverse page ordering
2 dict begin
% Define how the output device physically outputs pages
/DeviceOutputsFaceUp true def
% Re-usable dictionary workspace for setdevparams
/PageBufferParameters 2 dict def
<<
% Ensure the keys are available to the pagedevice
/ExtraPageDeviceKeys <<
/Collate true % enable copy collation by default
/OutputFaceUp false % assume source has pages in
% normal order by default
>>
% Ensure they are initialized with these values
% even if already present dup { } forall
% Map pagedevice keys onto the %pagebuffer% device parameters
/StartRender <<
/PageSequencing {
(%pagebuffer%) //PageBufferParameters dup /CollateCopies
currentpagedevice /Collate get put dup /ReversePageOrder
currentpagedevice /OutputFaceUp get
//DeviceOutputsFaceUp { not } if put setdevparams
} bind
>>
>> setpagedevice end
%%EOF