Skip to main content
Skip table of contents

HqnImpose2 page size control

This page applies to Harlequin v13.1r0 and later; both Harlequin Core and Harlequin MultiRIP.

It would normally be expected that any call to setpagedevice within the PostScript language of a job would trigger the flat created so far to be either discarded or rendered. In order to prevent this probably undesirable behavior, calls to setpagedevice are intercepted. Any such calls when no page has yet been completed on the current film are passed through in the normal manner, unless they contain definitions which would disturb the imposition procset (/Imposition, /BeginPage, /EndPage, or /SensePageDevice). If pages have already been completed on the flat, the dictionary passed to setpagedevice is examined to see if it contains a definition of /PageSize. If it does contain such a definition, the value is compared with PageWidth and PageHeight. If the two sizes are the same, the dictionary is discarded. How close two dimensions must be to be regarded as "the same" page size is set by defining PageSizeMatch, which defaults to five points. This is the setpagedevice value defined in RB2 to determine whether a requested PageSize matches an available size. Any new page size where both the width and height of the new page match the current page (within this margin) is regarded as the same page size and the call to setpagedevice is ignored.

Some other keys are passed into the page device whether the dictionary contains PageSize or not. These include: 


If a new page size has been requested, a response procedure is called, in much the same way as tactics and objectives. The following responses are included as standard, but new ones may be added:


The current film is rendered and a new page layout is calculated to start a new film. It is assumed that nothing was drawn on the current page, although any PageUnderlay was executed.


Any new page size is ignored; if the job sets a larger page size than has already been set, new pages are clipped.


The job is stopped. This is the default response when using the PassThrough objective, because a changed page size probably means that the wrong layout was selected.


This is the default response. If the new page size is larger than the current panel size in use, it is equivalent to /RespondFlush. If it is smaller, the existing panel size is used until the end of the current film and a new layout is calculated for the next film. The new, smaller, page is drawn inside the panel area (see HqnImpose2 paneling).


This is the default response when using the Paneled objective. If the new page size fits within the existing panel, the job  continues as before; otherwise, the film is flushed and a new page layout is calculated to start a new film.


For use only with the /Halved objective and /FromList tactic. The page layout is dynamically restructured to produce the most efficient use of the output layout. This may include reducing or enlarging the panel size.

You can force the current response to be called even if the call to setpagedevice occurs when no pages have yet been imaged on the current film, by defining /AlwaysRespond to be true in the call to HqnInitImpose.

If you want all page sizes requested by the job itself to be ignored,you can set a variable called /IgnoreJobPageSize to true (the default is false). The page size defined in the Page Setup dialog of the Harlequin RIP is used for all pages, unless the call to HqnInitImpose includes definitions of /PageWidth and /PageHeight, which overrides those from the dialog.

By default, it is assumed that each page has its origin at the lower left of the rectangle defined by its height and width. There may be occasions when this is not the case. The offset from the origin to the bottom left of the page area is defined by /OffsetX and /OffsetY. A negative x value means that the origin of the objects on the page is to the right of the bottom left corner of the page area; a positive x value that the page origin is to the left of that point. Similarly a negative y value means that the page origin is above the bottom of the page area, and a positive value that it is below the bottom of the page area.

There may also be circumstances where you want to read the page size (and page offsets) from a %%BoundingBox, %%HiresBoundingBox, %%PageBoundingBox, or a %%CropBox comment. In order to turn on this option you should define /ParseBoundingBox to true in the dictionary passed to HqnInitImpose. The default value is false.

Manual clipping paths may be applied to pages. A rectangular clipping path may be used by setting the ClipPath variable. The value is either null (no clipping), or an array of two coordinate pairs (llx,lly, urx, ury ), in the coordinate system of the page itself. If using the PassThrough Objective, the same data may be provided using the ListClip variable in each page dictionary.

If a non-rectangular clipping path is required (for example, for nesting imposed pages), the SrcClipPath variable may be set. The default value of null means no clipping. If clipping is desired, the value should be a non-executable array of numbers and PDF operators. Operators are limited to those described in Section 8.6.1 “Path Construction Operators” in the PDF 1.3 and 1.4 reference manuals. If using the PassThrough objective, the same data may be provided by using the ListSrcClipPath variable in each page dictionary.

Both ClipPath and SrcClipPath may be used together.

Pages placed using any of the standard grid Tactics  with a negative gutter (and therefore overlapping), are automatically cropped at the center of the gutter.

By default, the last flat of every job is “trimmed” by setting negative margins if there is unused space. For more details see HqnImpose2 page trimming and Trailer.

If a page is both rotated and scaled at the page level (as opposed to scaling or rotation of the sheet), the scaling is applied first by default, which means that the page may not be rectangular after both have been done. If ScaleAfterRotate is set to true, the rotation is done first, and then the scaling, which leads to rectangular pages. Default is false.

Page, film, margin, and other dimensions are usually snapped to a whole number of device pixels to maximize consistency. To avoid such snapping, set the SnapToDevice variable to false in the call to HqnInitImpose.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.