Skip to main content
Skip table of contents

(v13) Which attribute was selected?

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

 From the PostScript language, sometimes it's useful to find out which paper tray or cassette the media-matching algorithm selected.

The relevant dictionary contains two entries, InputAttributes and OutputAttributes, each of which keys a number. These numbers are themselves keys in the InputAttributes and OutputAttributes dictionaries in the current page device. Incidentally, it is these numbers that are passed as the InputAttributes and OutputAttributes parameters of the %pagebuffer% device (core-RIP implementations), or as mediaSelect and outputAttributes to plugins in the pageHeader C data structure (GUI implementations).

You can construct a PostScript-language fragment that works for either version. The following example leaves the number of the selected output attribute on the operand stack:

            currentpagedevice /Private dup known {get }{pop //$printerdict } ifelse
            /InputAttributes get

You can also consult Private to find out the size of the raster. This is keyed by the names Width and Height, two numbers giving the dimensions in user-space units. This is after all operations such as scaling are applied to the page size determined by the methods described above.

For example:

  currentpagedevice /Private get begin (raster size [) print
  Width 10 string cvs print Height 10 string cvs print (]) print

Contents of Private may change without notice; do not disturb the contents of Private, assume anything about, or rely upon any other contents of the dictionary. 

JavaScript errors detected

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

If this problem persists, please contact our support.