Harlequin RIP SDK

GenerateFormat function. More...

#include "skinras.h"
#include "std.h"

Functions

HqBool GenerateFormat (const char **formatp, const RasterDescription *pRD, HqBool overrideDirectory, uint8 **filenamep, int32 *lengthp)
 Helper function for filename generation. Interprets a character from a format string; may be called recursively. Returns TRUE for success, and updates the format and filename pointers and remaining length. More...
 

Detailed Description

GenerateFormat function.

Copyright (C) 2022 Global Graphics Software Ltd. All rights reserved. This source code contains the confidential and trade secret information of Global Graphics Software Ltd. It may not be used, copied or distributed for any reason except as set forth in the applicable Global Graphics license agreement.

Function Documentation

◆ GenerateFormat()

HqBool GenerateFormat ( const char **  formatp,
const RasterDescription pRD,
HqBool  overrideDirectory,
uint8 **  filenamep,
int32 lengthp 
)

Helper function for filename generation. Interprets a character from a format string; may be called recursively. Returns TRUE for success, and updates the format and filename pointers and remaining length.

Formats are:

%?-...
Add an optional prefix. This is a right associative format; if the following format is not empty, then the character after %? ('-' in the example here) will be put in front of the remainder. So, %?-N will add a hyphen and then the separation number, for multi-separation pages.
%!-...
Add an optional suffix. This is a right associative format; if the following format is not empty, then the character after %! ('-' in the example here) will be put after the remainder. So, %!-N will add the separation number for multi-separation pages, followed by a hyphen.
%</...
Selects everything to the left of the first separator character following %< in the following format. The separator may not be '<', it is '/' in the example. This, and the similar formats, are right associative modifiers that can be used as a platform-neutral way to select parts of filenames. This modifier returns an empty string if the separator does not appear in the format.
%<</..
Similar to %< above, except this format selects everything to the left of the last separator specified, rather than the first separator. Thus, %<</f returns the directory name of the input file.
%>/...
Selects everything to the right of the first separator character following %> in the following format. The separator may not be '>', it is '/' in the example. This modifier returns the whole string if the separator does not appear in the format.
%>>/..
Similar to %> above, except this format selects everything to the right of the last separator specified, rather than the first separator. Thus, %>>/f returns the base name of the input file.
%%
The character '%'.
%b
The basename part of the input filename (excludes any folder and extension).
%d
The directory part of the input filename, including any terminating directory separator.
%f
The full input filename as entered on the command line.
%i
The optimized PDF ID.
%J
The job name, or the input filename if the jobname is empty.
%j
The job name.
%k
The job number (from setpagedevice).
%K
The skin job number (from the SWTLT_SKIN_JOB timeline).
%N
The separation number, if there is more than one separation for a page.
%n
The separation number.
%o
The output type (page buffer name).
%p
Page number, combined with the (normally zero) page offset.
%r
The ID of the current scalable Rip instance (zero if not scalable Rip).
%S
The separation name, unless it can safely be omitted (if there is only one channel and the name is "Gray" or "Composite", it will be omitted).
%s
The separation name. If there is only one channel, the separation name is always omitted.
%T
The tile bounding box, unless it is empty.
%t
The tile bounding box, as a series of four numbers, separated by commas. The four numbers are padded according to the numeric format specification.
%0[1-9]...
Zero-pad the following numeric format to the minimum width specified. The zero digit must be followed by a positive number, then one of the format characters N, n, d, k, K, p, r.

The default format varies by raster output selected, but will fall back to "%f-%p%?-N%?-S%?-T.%o", which concatenates the full input filename, the pagenumber (with page offset), the separation number (if necessary), the separation name (if necessary), the tile bounding box (if necessary), and the output type extension, all but the last separated by hyphens.

Return values
TRUEfor success
FALSEotherwise