Skip to main content
Skip table of contents

The maketiles operator

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


array proc maketiles –

The maketiles operator allows explicitly calling the /Page tiling iterator, for contexts in which the RIP cannot automatically tile PDLs. This is used by the HqnImage procset to enable tiling of any of the supported image formats. Most of the time it will not be necessary to create additional code that calls the maketiles operator; the most likely case that would need it would be if you wish to add tiling for another file format.

The maketiles operator should be called after setting up a tiling configuration with settilingparams , and takes two objects on the stack:

  • An array, which is used to determine how many tiles will be requested at a time.
  • A procedure object, which is called for each set of tiles generated.

If the /Page tiling method is not configured, then the procedure object will be called just once, with null on the operand stack.

If the /Page tiling method is configured, then the tiling iterator will be called. Dictionaries containing details of each tile produced by the tiling method iterator are stored in the initial subarray of the array object, and then the initial subarray is passed to the procedure object. If there are more tiles than the size of the array object, the iterator will fill the array, pass that to the procedure object and then repeat as necessary until all the tiles have been processed.

The dictionary for each tile produced by the method iterator contains:

/BoundingBox – A four-element array of integers giving the device-space bounding box of the tile produced.

Note: A dictionary is used for each tile, even though only one key within that dictionary is defined for Harlequin v13, because it will allow for simple expansion if required in later versions.

The format of the tile array is suitable for use in the /Tiles parameter of the /Explicit tiling method (see the following Example), and for passing to the /Action procedure.

Examples:

no tiling configured

CODE
1 array { == } maketiles

Output

--null--


simple rectangular tiling defined

TEXT
<<
  /Page <<
    /Method /Rectangular
    /MaxWidth 10000
    /MaxHeight 10000
  >>
>> settilingparams
<<
  /HWResolution [600 600]
  /PageSize [3456 3456] % 4 feet each side
>> setpagedevice

% here /=== is defined to a recursive print procedure
20 array { === } maketiles

Output

[
  << /BoundingBox [0 0 9600 9600 ] >>
  << /BoundingBox [9600 0 19200 9600 ] >>
  << /BoundingBox [19200 0 28800 9600 ] >>
  << /BoundingBox [0 9600 9600 19200 ] >>
  << /BoundingBox [9600 9600 19200 19200 ] >>
  << /BoundingBox [19200 9600 28800 19200 ] >>
  << /BoundingBox [0 19200 9600 28800 ] >>
  << /BoundingBox [9600 19200 19200 28800 ] >>
  << /BoundingBox [19200 19200 28800 28800 ] >>
]


The maketiles operator does not execute the /Action procedure from currenttilingparams itself, but the code that calls maketiles from the HqnImage procset does call the Action procedure. If you wish to use maketiles to, for instance, add tiling support for an additional file format you may wish to ensure that any Action procedure is called, using something like the following example:


TEXT
        100 array { % tile array or null on stack
          dup null eq {
            pop
            % take whatever action is required for no tiling
          } { % tile array on stack
            currenttilingparams /Action 2 copy known {
              get % tile-array Action-proc on stack
              <<
                /Tiles 3 index
                /Page 1
              >> exch exec % execute Action-proc with properly formed args
            } { % no /Action, assume /Add
              pop pop /Add
            } ifelse
            /Add eq { % tile array on stack
              { % for each tile
                % setup tile and take whatever action is required
              } forall
            } {
              pop % discard tile array, don't take any action
            } ifelse
          } ifelse
        } maketiles


JavaScript errors detected

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

If this problem persists, please contact our support.