CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Get the information about the document and how the user wants to print it. More...
Data Structures | |
struct | caps_drv_page_limits |
The static rasterizer limits. More... | |
Functions | |
struct caps_drv_page_limits | caps_drv_job_limits_get (struct caps_drv *cdrv) |
const char * | caps_drv_job_value_get (struct caps_drv *cdrv, const char *designator, const char *name) |
const char * | caps_drv_job_choice_get (struct caps_drv *cdrv, const char *designator) |
int | caps_drv_job_is_duplex (struct caps_drv *cdrv) |
const char * | caps_drv_print_medium_format_name_get (struct caps_drv *cdrv) |
struct caps_rect | caps_drv_print_medium_size_get (struct caps_drv *cdrv) |
struct caps_area | caps_drv_print_medium_margins_get (struct caps_drv *cdrv) |
enum caps_ppd_paper_leading_edges | caps_drv_print_medium_orientation_get (struct caps_drv *cdrv) |
struct caps_area | caps_drv_print_medium_imageable_get (struct caps_drv *cdrv) |
struct caps_ppd_resolution | caps_drv_print_resolution_get (struct caps_drv *cdrv) |
enum caps_colour_format | caps_drv_print_colour_get (struct caps_drv *cdrv) |
All these functions hide the details of libcapsraster behind. You can call them in the caps_generic_driver::job_start() callback.
struct caps_drv_page_limits caps_drv_job_limits_get | ( | struct caps_drv * | cdrv | ) |
Get the rasterizer dependent (static) limits for the attached document
[in] | cdrv | libcapsdriver handle |
After attaching a job to a rastrizer it can report about limitiations it might have for this kind of document format.
For example a CUPS raster as an input document is limited to exactly one colour format: the one provided in the CUPS raster. Maybe your driver can deal with it - maybe not. This function can help you to see, if printing will be possible. If not, you should reject the job.
const char * caps_drv_job_value_get | ( | struct caps_drv * | cdrv, |
const char * | designator, | ||
const char * | name | ||
) |
Retrieve job related specific PPD value with a special designator (and maybe name
)
[in] | cdrv | libcapsdriver handle |
[in] | designator | Designator to retrieve the value from |
[in] | name | Name of the parameter (can be NULL) |
Pointer | Pointer to the parameter's value |
NULL | If the keyword does not exist |
Refer caps_rstr_job_value_get() how to use this function.
const char * caps_drv_job_choice_get | ( | struct caps_drv * | cdrv, |
const char * | designator | ||
) |
Retrieve job related user selections from the PPD
[in] | cdrv | libcapsdriver handle |
[in] | designator | Designator to retrieve the choice from |
Pointer | Pointer to the value string of the selection |
NULL | If the designator doesn't exist |
Refer caps_rstr_job_choice_get() how to use this function.
PaperSize
for example.int caps_drv_job_is_duplex | ( | struct caps_drv * | cdrv | ) |
Check, if this job is intended to be printed in duplex mode
[in] | cdrv | libcapsdriver handle |
1 | (true) This job is a duplex one |
0 | (false) This job is a simplex one |
const char * caps_drv_print_medium_format_name_get | ( | struct caps_drv * | cdrv | ) |
Retrieve the user's selection of the print medium as a format name
[in] | cdrv | libcapsdriver handle |
a4
or letter
or a printer specific one)This is the medium format name the user has selected to print to. Since it is derived from the settings the printer driver has provided in its caps_ppd_base feature structure, it just contains this data.
Related functions are caps_drv_print_medium_size_get() and caps_drv_print_medium_margins_get()
Retrieve the user's selection of the medium as a size in [pts]
[in] | cdrv | libcapsdriver handle |
.width = 595.27584
x .length = 841.8888
pts for A4)This is the medium size the user has selected to print to. Since it is derived from the settings the printer driver has provided in its caps_ppd_base feature structure, it just contains this data (which has impact to its size and orientation).
It works for all kind of media definition, including the custom formats (if the driver makes use of it).
Related functions are caps_drv_print_medium_format_name_get(), caps_drv_print_medium_margins_get(), caps_drv_print_medium_orientation_get() and caps_drv_print_medium_imageable_get()
The returned size can be used in caps_drv_print_medium_size_set() to setup the raster size which should cover the full medium.
Get the margins of the user's selection of the print medium
[in] | cdrv | libcapsdriver handle |
The returned margins are four individial values, e.g. not coordinates! This is a misuse of struct caps_area!
It can be used in caps_drv_print_medium_margins_set() to setup the rasters margins.
Related functions are caps_drv_print_medium_format_name_get(), caps_drv_print_medium_size_get(), caps_drv_print_medium_orientation_get() and caps_drv_print_medium_imageable_get()
enum caps_ppd_paper_leading_edges caps_drv_print_medium_orientation_get | ( | struct caps_drv * | cdrv | ) |
Get the user's selection of the print medium orientation
[in] | cdrv | libcapsdriver handle |
Only one of the values:
is valid. It is to be used in conjunction with the caps_drv_print_medium_size_get() returned size of the print medium.
Related functions are caps_drv_print_medium_format_name_get(), caps_drv_print_medium_size_get() caps_drv_print_medium_margins_get() and caps_drv_print_medium_imageable_get()
Get the imageable area of the user's selection of the print medium
[in] | cdrv | libcapsdriver handle |
This function returns the combination of the print medium size with the four margins applied and forms an area.
Related functions are caps_drv_print_medium_format_name_get(), caps_drv_print_medium_size_get() caps_drv_print_medium_margins_get() and caps_drv_print_medium_orientation_get()
struct caps_ppd_resolution caps_drv_print_resolution_get | ( | struct caps_drv * | cdrv | ) |
Retrieve the user's selection of the print resolution
[in] | cdrv | libcapsdriver handle |
The caps_ppd_resolution::horizontal refers always the cross medium feed direction.
enum caps_colour_format caps_drv_print_colour_get | ( | struct caps_drv * | cdrv | ) |
Retrieve the user's selection of the colour mode
[in] | cdrv | libcapsdriver handle |
Selected | colour mode for this print job |