CAPS Universe documentation  1.0.4
All you need to know to be successful
Functions

Query some information about the print job. More...

Functions

const char * caps_rstr_job_mime_get (const struct caps_rasterizer *rstr)
 
bool caps_rstr_job_is_duplex (struct caps_rasterizer *rstr)
 
bool caps_rstr_job_is_collating (struct caps_rasterizer *rstr)
 
enum caps_ppd_color_formats caps_rstr_job_color_mode_get (struct caps_rasterizer *rstr)
 
const char * caps_rstr_job_medium_format_name_get (struct caps_rasterizer *rstr)
 
const struct caps_ppd_resolutioncaps_rstr_job_resolution_get (struct caps_rasterizer *rstr)
 
enum caps_ppd_paper_leading_edges caps_rstr_job_medium_orientation_get (struct caps_rasterizer *rstr)
 
struct caps_rect caps_rstr_job_medium_size_get (struct caps_rasterizer *rstr)
 
struct caps_area caps_rstr_job_medium_imageable_get (struct caps_rasterizer *rstr)
 
struct caps_area caps_rstr_job_medium_margins_get (struct caps_rasterizer *rstr)
 
unsigned caps_rstr_job_copies_get (struct caps_rasterizer *rstr)
 
const char * caps_rstr_job_value_get (struct caps_rasterizer *rstr, const char *keyword, const char *name)
 
const char * caps_rstr_job_choice_get (struct caps_rasterizer *rstr, const char *keyword)
 
const struct caps_job_progressioncaps_rstr_job_progression_get (struct caps_rasterizer *rstr)
 

Detailed Description

Function Documentation

◆ caps_rstr_job_mime_get()

const char * caps_rstr_job_mime_get ( const struct caps_rasterizer rstr)

Retrieve the MIME type of the attached job

Parameters
[in]rstrThe rasterizer engine
Return values
PointerThe MIME type as a string (like 'application/pdf')
NULLIf the MIME type isn't known
Attention
If NULL is returned, the print job cannot be processed, because there is no rasterizer for it.
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_is_duplex()

bool caps_rstr_job_is_duplex ( struct caps_rasterizer rstr)

Query if the attached job is to be printed in duplex

Parameters
[in]rstrThe rasterizer engine the job is attached to
Return values
trueYes, its a duplex job
falseNo, its a simplex job
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_is_collating()

bool caps_rstr_job_is_collating ( struct caps_rasterizer rstr)

Query if the attached job should be collated

Parameters
[in]rstrThe rasterizer engine the job is attached to
Return values
trueYes, collate
falseNo, non-collate
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_color_mode_get()

enum caps_ppd_color_formats caps_rstr_job_color_mode_get ( struct caps_rasterizer rstr)

Get the attached job's user selected printing colour mode

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
A colour value (enum)

This call is PPD related, but the details should be hidden inside the library.

Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_medium_format_name_get()

const char * caps_rstr_job_medium_format_name_get ( struct caps_rasterizer rstr)

Get the attached job's print medium format name setting

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The medium format name to print this job to as a string (like 'A4' or 'Letter')
Note
The medium format meant here is the real pysical print medium format. E.g. the medium format name the printer will print this job to. It is not the medium format name the job's document is intended to print to.
This function does not return in the case of a failure
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_resolution_get()

const struct caps_ppd_resolution * caps_rstr_job_resolution_get ( struct caps_rasterizer rstr)

Get the attached job's print resolution setting

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The print resolution information
Note
This function does not return in the case of a failure
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().
Since
1.1.0 without the base printer description parameter

◆ caps_rstr_job_medium_orientation_get()

enum caps_ppd_paper_leading_edges caps_rstr_job_medium_orientation_get ( struct caps_rasterizer rstr)

Get the attached job's print medium orientation setting

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The orientation information

Only one of the values:

is valid. It is to be used in conjunction with the caps_rstr_job_medium_size_get() returned size of the print medium.

Note
This function does not return in the case of a failure
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().
Since
1.1.0

◆ caps_rstr_job_medium_size_get()

struct caps_rect caps_rstr_job_medium_size_get ( struct caps_rasterizer rstr)

Get the attached job's print medium size setting

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The size information in [pts]

This size information is provided by the printer driver. Thus, it covers special sizes (aka 'custom') as well.

Note
Due to various sources of format sizes (like libpaper or the printer driver itself), the orientation isn't fixed. You always need to call caps_rstr_job_medium_orientation_get() as well, to tip over the size information on demand.
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().
Since
1.1.0

◆ caps_rstr_job_medium_imageable_get()

struct caps_area caps_rstr_job_medium_imageable_get ( struct caps_rasterizer rstr)

Get the attached job's print medium's imageable area setting

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The imageable area information in [pts]
Note
The returned imageable area reflects the printer's limits regarding the returned medium size from caps_rstr_job_medium_size_get(). It is not intended to rotate if caps_rstr_job_medium_orientation_get() returns a different orientation as the returned size information has. This means the top margin is always the required margin at the leading edge of the medium.
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().
Since
1.1.0

◆ caps_rstr_job_medium_margins_get()

struct caps_area caps_rstr_job_medium_margins_get ( struct caps_rasterizer rstr)

Get the attached job's print medium's margins setting

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The margins information in [pts]
Note
This is a misuse of caps_area, since the information herein are four values, not two coordinates!
The returned margins reflect the printer's limits regarding the returned medium size from caps_rstr_job_medium_size_get(). It is not intended to rotate if caps_rstr_job_medium_orientation_get() returns a different orientation as the returned size information has. This means the top margin is always the required margin at the leading edge of the medium.
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().
Since
1.1.0

◆ caps_rstr_job_copies_get()

unsigned caps_rstr_job_copies_get ( struct caps_rasterizer rstr)

Get the attached job's printing copies count

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
The job's copy count (at least '1')
Note
This function does not return in the case of a failure
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_value_get()

const char * caps_rstr_job_value_get ( struct caps_rasterizer rstr,
const char *  keyword,
const char *  name 
)

Get the attached job specific PPD value with a special keyword out of the run-time information

Parameters
[in]rstrThe rasterizer engine the job is attached to
[in]keywordKeyword to query for
[in]nameName of the parameter (can be NULL)
Return values
Pointerto the parameter's value
NULLif the keyword does not exist

It returns the "some code" part of a PPD entry from keyword if name is valid:

*<keyword> <name>/SomeDescription: "some code"

It returns the <some value> part of a PPD entry from keyword if name is NULL:

*<keyword>: <some value>
Note
Does not return in case of failure (non existing key isn't a failure)
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_choice_get()

const char * caps_rstr_job_choice_get ( struct caps_rasterizer rstr,
const char *  keyword 
)

Get the attached job specific PPD choice value with a special keyword out of the run-time information

Parameters
[in]rstrThe rasterizer engine the job is attached to
[in]keywordKeyword to query for
Return values
Pointerto the parameter's value (but can be NULL as well!)
NULLif the keyword does not exist

Returns the <some code> of the selected PPD choice entry <keyword>:

*OpenUI *<keyword>/Paper Type: PickOne
*OrderDependency: 10 AnySetup *MediaType
*Default<keyword>: <some value>
*<keyword> <some value>/Use Printer Default: "<some code>"
*[...]
*CloseUI: *<keyword>
Note
If you're interested in the <some value> in the example above, use caps_rstr_job_value_get() instead with the string "Default<keyword>" as its keyword and NULL as its name.
Does not return in case of failure (non existing key isn't a failure)
Precondition
A job must already be attached to the engine via caps_rstr_job_attach().

◆ caps_rstr_job_progression_get()

const struct caps_job_progression * caps_rstr_job_progression_get ( struct caps_rasterizer rstr)

Get the printing progression information

Parameters
[in]rstrThe rasterizer engine the job is attached to
Returns
Pointer to progression info (read only)

This information is intended to be used to report some printing progression to the Printing Coordinator.

Expect this structure has its first valid info after the first page was printed.

Precondition
A job must already be attached to the engine via caps_rstr_job_attach().