There are three methods to use the Harlequin RIP in your application. The more complex integration methods give you more control over the operation of the RIP, and tend to give better overall performance, but require more programming.
In all of these integration methods, if you need data in a format not supported by the Harlequin RIP SDK by default, you may need to develop and add your own raster backend. You may also need to develop and add your own color management modules, halftone modules, configuration device or other devices (see DEVICE interface) to pass data to and from the RIP.
The simplest method of integrating the Harlequin RIP into your application is to simply call the "clrip" application as a sub-process. The Harlequin RIP SDK provides no specific support for this integration method. This method would typically be performed by constructing a command line for "clrip" and calling CreateProcess() on Windows, or fork() and one of the exec() family of calls on Linux or MacOS.
When constructing a command line to call "clrip", your application should be careful about quoting arguments, and about handling file name encodings correctly. The Windows version of "clrip" is built as a Unicode console application, and so can be started with CreateProcessW() if non-ASCII characters are required. On Linux and MacOS, "clrip" uses UTF-8 encoding for the command-line parameters.
This documentation does not explain how to use all of the "clrip" command line arguments. Run clrip -h
to see the built-in documentation on command-line arguments, or clrip -l
to list the built-in raster backends, output targets, and configurations installed.
If your application calls "clrip" as a sub-process, there are two built-in methods to pass jobs to it. Jobs can be passed on the command line, or through hot folders. Both methods can be combined: the RIP puts all jobs identified on the command line onto its input queue first, and then will process jobs from any hot folders until told to quit (see Inputting data).
Jobs may be passed to the "clrip" application in one of three forms:
/
on Unix or MacOS, C:\
or another drive letter on Windows, or \\host\share\
for a UNC path on Windows). UNC paths will be mounted as needed by the RIP. On Windows, a trailing wild-card pattern is also supported, allowing multiple files in a directory to be submitted at once.%
). Relative filenames are resolved in relation to the working directory. This will normally be the directory in which the "clrip" process was started, but it can be changed using the -S
command-line option.%
characters, followed by the path to the file, using forward slash /
as a separator. Unqualified PostScript filenames without the device name may be used internally by the RIP, but only fully-qualified names are recognized on the command line.Similar rules apply to RIP configurations applied via the command line. Configurations for the Harlequin RIP historically used PostScript as a scripting language, with operators extending the language to manage the page, color, and output configurations. The Harlequin RIP also contains a JSON configuration device that converts declarative JSON configurations to PostScript configurations automatically. JSON configurations are recommended for customers not familiar with PostScript programming.
RIP configurations may be supplied on the command line as:
%psconfig%
device (see PS configuration). This is normally a file system device referring to the SW/TestConfig
sub-directory of the RIP's data directory, but may be overridden or remounted on a different device (see Configuring the Harlequin RIP for more information).In all of these cases, if the configuration name ends with .json
or .JSON
, it will be treated as a declarative JSON configuration, and the JSON configuration device will automatically be used to translate it to PostScript (see JSON configuration).
Finally, configuration overrides called Page Features may also be supplied on the command line. These are small sections of PostScript configuration code that may be used to modify the RIP configuration. Multiple page features may be used at once to modify different aspects of the RIP's configuration.
Page Features may be supplied on the command line as:
SW/Page Features
sub-directory of the RIP's data directory.The behavior determining how to handle absolute filenames, relative filenames, or device-relative names for jobs, configurations, and page features are implemented in the source code supplied by Global Graphics, either in the Harlequin RIP SDK library or the application layer.
The "clrip" application supports hot folders for input. Hot folders will be monitored for job files copied into them, and will submit the job files to the RIP for processing. When the RIP has completed the job, the files will be deleted from the hot folder.
Multiple hot folders may be started. Each hot folder is associated with a configuration and one or more page features. The configuration and/or page features may differ for each hot folder, providing an easy way to submit jobs if there are a limited number of configurations used by the application.
If one or more hot folders are started, the clrip process will continue to run until it is explicitly stopped. This may be done either by interrupting it, or submitting a special stop job. See Stopping the Harlequin RIP and SDK for more information.
The "clrip" hot folder support is implemented in the SDK Library, and so is available for other RIP integration methods to use. The hot folder support uses the inputs API (see Input queue and source API) to submit jobs. This API can be used to construct other persistent input sources for jobs, as your application requires.
If Scalable RIP support is required for high-volume PDF output, the preferred method to integrate the RIP is to use the Scalable RIP API to manage the RIP processes, and link your application with the "libripfarm" library. This API and library provide support for running a farm of multiple RIPs, on multiple host machines, and managing input to and output from the farm. The API supports starting and stopping the RIP farm (including spawning and terminating the Scalable RIP processes), submitting and managing jobs, managing raster output, and requesting and monitoring farm, job, and raster output status.
The RIP Farm API is normally configured through the ripfarm_global.json
JSON configuration file, found in the SW/RIPFarmConfig
sub-directory of the RIP's data directory. An alternate JSON configuration may be supplied as a file, a JSON string, or a JSON object when the interface is initialized, or from a central blade controller if running multiple machines.
When using the RIP Farm API, the Scalable RIP sub-processes may either be explicitly started by your application, or automatically spawned by the rf_send_farm_start() call to the RIP Farm API. Global Graphics recommends automatically spawning the processes using the API. This is achieved by changing the JSON configuration SpawnBeforeFarmStart
object. This object contains a path to an executable, a working directory name, and an array of command-line arguments to pass to the executable. These key-value pairs may be configured as suggested in the distributed ripfarm_global.json
file to point at the "clrip" application, or they may be configured to point at an intermediate script or process of your own that starts "clrip".
If you need to replace "clrip" as the RIP process spawned by the Scalable RIP API, then the replacement RIP application must support certain arguments and capabilities. See Integrating for use as a Scalable RIP for more information.
You may submit jobs to the Scalable RIP using the RIP Farm API's rf_send_job_start() call, or by using hot folders or any other persistent input source built into "clrip" or its replacement RIP application.
The RIP Farm API is relatively small, and operates at quite a high level, but is capable of managing most application integration functions. See RIP Farm: API and Library to split jobs across multiple RIPs for more information about using this interface.
If a data output format is required that is not supported by the RIP, then you may need to develop and add your own raster backend to "clrip". If you use the Scalable RIP raster output management, your raster backend is required to implement the functionality described in Enabling the Scalable RIP raster manager.
Linking the Harlequin RIP into your own application will give you the greatest control over operation of the RIP. There are many reasons that this may be your preferred integration method, including:
There should only be one instance of the Harlequin RIP running in your process at a time. Global Graphics does not support support running more than one instance of the Harlequin RIP in multiple threads of the same process. If you need to run multiple RIPs to perform different tasks simultaneously (for example, thumbnailing or preflighting whilst also rendering jobs), and your license covers this case, you may use multiple RIPs hosted in different processes. If you wish to use multiple RIPs to speed up rendering of a single job at a time, please talk to Global Graphics about using the Scalable RIP.
The recommended method of integrating the Harlequin RIP into your application is to add the RIP's include directories to your application's include paths (see Header files), and link to the SDK static library (see Linking the SDK library). The simplest way to do this is to add the include directories, the pre-built static SDK library, and the other required libraries to your source control system, and add them into your build system. If you wish to include the Harlequin RIP SDK source code as part of your application's build process, it may be simplest to call the Makefiles in the distribution as sub-processes in your build system, or add the Harlequin RIP SDK library project files to your solution if using Visual Studio on Windows. This method of integrating the Harlequin RIP into your application does not use the application layer, so the skintest/
and skinmin/
directories in the distribution do not need to be added to your build system (however, they may still provide useful examples of how to integrate your own application code with the Harlequin RIP SDK).
You may wish to create a proxy interface or class, so that you do not need to expose the RIP's include files in all of your application code. The include files and library may be used with either C or C++ code.
The Harlequin RIP is designed so it can run as a persistent service within its host process. On start, the Harlequin SDK will reserve a memory allowance for its sub-allocation arena, and the core RIP will start a number of threads to use when running the RIP. The RIP will run until shut down. Your application may either submit jobs to the RIP, and then continue to perform other useful work while these jobs are processed, or it may submit jobs and synchronously wait for those jobs to be completed.
The Harlequin RIP SDK and core may be started and shut down multiple times within the lifetime of your application. Some critical parameters, such as the size of the memory arena, may only be changed when starting the SDK. If your application has periods of time when it does not require the RIP running, but requires a lot of memory to perform a task, you may wish to shut down the RIP while the task is running.
The Harlequin RIP can be started, stopped, and jobs processed in your application by calling the SwLeDo() function.
Details of which libraries to link and what functions should be called to integrate the RIP into your application are explained in Linking the Harlequin RIP SDK components.
In rare cases, you may want to run the Scalable RIP for performance, but can not use the "clrip" application, and can not extend the "clrip" application layer to contain functionality you need. In these cases, you may need to integrate the Harlequin RIP into your own application, but have it able to perform as a Scalable RIP.
Integrating the Harlequin RIP SDK for use as a Scalable RIP is similar to integrating it for use as a single RIP (see Integrating as a single RIP), with the addition that:
The Scalable RIP is implemented as single executable which can perform several different roles. These different roles are selected using command-line options. The Scalable RIP starts with a single process, which will spawn multiple processes from the same executable as necessary to perform the different roles, modifying the command line used to spawn the executable to indicate the roles and options required. This self-spawning method means that certain command-line options must be supported by the application hosting a Scalable RIP, and these command-line options must have the expected behavior in the application.
There are three main roles that the Scalable RIP application is expected to perform:
-nrip
command-line option to indicate the number of RIPs to run, but without the -cbc
command-line option. See Scalable RIP controller API.-frid
command-line option. See Farm RIP API.-nrip
command-line option to indicate the number of RIPs to run, and also the -cbc
command-line option to indicate the address of the central blade controller. See Scalable RIP controller API.The command-line options that a Scalable RIP application is required to implement are:
FALSE
, then you need not implement this command-line option.This option is passed to Farm RIPs to indicate how much memory they may use. The memory parameter is an integer, indicating the size to use in MB. This parameter should be used by the application to initialize the memory size when starting the SDK. See SW_SR_PARAMS::mem_working_size, SwLeDoParams::RIP_workingSizeInBytes and SW_FR_PARAMS::arena.
You must implement this command-line option.
NULL
, then you need not implement this command-line option.This option is passed to Farm RIPs to indicate the address and base port of the central blade controller. The address is either a machine name or an IP address, port is an integer port number. The "clrip" application also uses this option to configure satellite blade controllers to communicate with the central blade controller.
The parameter passed to the Farm RIP should be used to set the SW_FR_PARAMS::central_bc_tcpip field before calling sw_fr_server_loop(). See SW_SR_PARAMS::central_bc_tcpip and SW_FR_PARAMS::central_bc_tcpip.
You must implement this command-line option.
This option is passed to Farm RIPs to indicate the Farm RIP's identity. The id parameter is an integer, it should be used to set the SW_FR_PARAMS::rip_id field before calling sw_fr_server_loop(). See SW_FR_PARAMS::rip_id.
You must implement this command-line option.
This option is passed to Farm RIPs to set the writable SW data directory. Farm RIPs use the Union device (device type 40) to direct any temporary files or log files they may write to a unique location for each RIP. The directory parameter is a directory name which the Farm RIP should pass to PKSetSWWriteDir() before calling sw_fr_server_loop().
You must implement this command-line option.
When acting as a Scalable RIP, the Harlequin RIP needs to be linked with some additional libraries. Details of the additional libraries to link to are explained in Linking libraries for Scalable RIP.