CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Setup the information the rasterizer requires to rasterize the document page in a way your printer needs it. More...
Functions | |
int | caps_drv_print_medium_default_setup (struct caps_drv *cdrv) |
int | caps_drv_print_medium_colour_format_set (struct caps_drv *cdrv, enum caps_colour_format cf) |
int | caps_drv_print_medium_size_set (struct caps_drv *cdrv, struct caps_rect page_size) |
int | caps_drv_print_medium_favoured_rotation_set (struct caps_drv *cdrv, int rot) |
int | caps_drv_print_medium_width_set (struct caps_drv *cdrv, double min, double max) |
int | caps_drv_print_medium_length_set (struct caps_drv *cdrv, double min, double max) |
int | caps_drv_print_medium_margins_set (struct caps_drv *cdrv, struct caps_area margins) |
int | caps_drv_print_medium_resolution_set (struct caps_drv *cdrv, double x_res, double y_res) |
All these functions hide the details of libcapsraster behind. You can call them in the caps_generic_driver::page_setup() callback.
int caps_drv_print_medium_default_setup | ( | struct caps_drv * | cdrv | ) |
Setup the details in a generic manner how to rasterize the next page for printing
[in] | cdrv | libcapsdriver handle |
0 | On success (but read below) |
-EINVAL | Invalid print colour format (this means the PPD and/or libcapsppd is/are broken) |
-ENOTSUP | The requested print colour format isn't supported |
You can use this call to setup the rasterization of the current page. If your printer is an ordinary short-edge-first-printer for ordinary media formats, you can use this function.
You can still overwrite some or all of these settings with caps_drv_print_medium_size_set(), caps_drv_print_medium_favoured_rotation_set(), caps_drv_print_medium_margins_set(), caps_drv_print_medium_colour_format_set() and caps_drv_print_medium_resolution_set().
Read Dealing with colour formats about details.
int caps_drv_print_medium_colour_format_set | ( | struct caps_drv * | cdrv, |
enum caps_colour_format | cf | ||
) |
Setup the rasterize colour format for the next page
[in] | cdrv | libcapsdriver handle |
[in] | cf | The colour format the rasterizer should create the raster in |
0 | On success |
Setup the target medium's size in [pts]
[in] | cdrv | libcapsdriver handle |
[in] | page_size | The medium size |
0 | On success |
This defines the size of the final raster. And in conjunction with the margins, it defines the printable area.
The final raster will cover this size at the given resolution.
fittopage
for example. Add images for the results when fittopage is used
Add link to the printing parameter
int caps_drv_print_medium_favoured_rotation_set | ( | struct caps_drv * | cdrv, |
int | rot | ||
) |
[in] | cdrv | libcapsdriver handle |
[in] | rot | 0, -90 or +90 |
0 | On success |
int caps_drv_print_medium_width_set | ( | struct caps_drv * | cdrv, |
double | min, | ||
double | max | ||
) |
Set the minimal and maximal width the raster can have in [pts].
[in] | cdrv | The framework handle |
[in] | min | The minimal width the raster must cover |
[in] | max | The maximal width the raster can cover |
0 | On success |
For example a DIN A4 medium has a fixed width and your printer wants always the full pixel data in a line, even if not all pixels are covered by the raster image.
In this case set min and max to the same value. It could be a micro optimization to save bandwidth to only send the data with to be printed pixels. In this case the width of the raster image may only has the size of the really required width.
In this case set the min and max width to their correspoding values.
A different use case is a label printer with variable axis. For example if the printer can cut its medium at every width. In this case the min and max values are describing/considering physical or firmware limitations.
caps_drv_print_medium_size_set() sets min/max the same for both axis at once.
Refer caps_ppd_base::media_coverage for possible usage?
int caps_drv_print_medium_length_set | ( | struct caps_drv * | cdrv, |
double | min, | ||
double | max | ||
) |
Set the minimal and maximal length the raster can have in [pts].
[in] | cdrv | The framework handle |
[in] | min | The minimal length the raster must cover |
[in] | max | The maximal length the raster can cover |
0 | On success |
For example a DIN A4 medium has a fixed length and your printer wants always all lines of data for the full length, even if not all lines are covered by the raster image.
In this case set min and max to the same value.
It could be a micro optimization to save bandwidth to only send the lines with to be printed pixels. In this case the length of the raster image may only has the size of the really required length.
In this case set the min and max length to their correspoding values.
A different use case is a label printer with variable axis. For example if the printer can cut its medium at every length. In this case the min and max values are describing/considering physical or firmware limitations.
caps_drv_print_medium_size_set() sets min/max the same for both axis at once.
Refer caps_ppd_base::media_coverage for possible usage?
Setup the medium's margins in [pts]
[in] | cdrv | libcapsdriver handle |
[in] | margins | Margin settings |
0 | On success |
This defines the margins to keep free from printed dots.
This defines the printable area in conjunction with the medium's size (refer caps_drv_print_medium_size_set()) it is important for printing parameters like fittopage
for example.
Misuse of caps_area! It defines four margins, not an area inbetween them!
Add images for the results when fittopage is used
Add link to the printing parameter
int caps_drv_print_medium_resolution_set | ( | struct caps_drv * | cdrv, |
double | x_res, | ||
double | y_res | ||
) |
Setup the resolution for the raster
[in] | cdrv | libcapsdriver handle |
[in] | x_res | Horizontal resolution |
[in] | y_res | Vertical resolution |
0 | On success |
Horizontal und vertical resolution can be set independently.