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

Makes the life easier (sometimes) More...

Functions

const char * caps_drv_medium_name_from_size_get (const struct caps_rect *size)
 
struct caps_rect caps_drv_medium_size_from_name_get (const char *paper_name)
 

Detailed Description

You can call these functions in most of all callbacks.

Function Documentation

◆ caps_drv_medium_name_from_size_get()

const char * caps_drv_medium_name_from_size_get ( const struct caps_rect size)

Get the medium format name for a specific size

Parameters
[in]sizeThe size information in [pts]
Returns
The name of the format

Returns the best matching format name like a4 or letter for the specific size. This is a convenience function and a wrapper around libpaper and the returned name is more or less guessed.

If it returns "custom", nobody has a clue what kind of format it is. Be prepared!

◆ caps_drv_medium_size_from_name_get()

struct caps_rect caps_drv_medium_size_from_name_get ( const char *  paper_name)

Get dimension information about a specific medium format name in [pts]

Parameters
[in]paper_nameName of the paper (refer "paperconf -a" for valid names)
Returns
The size information for paper_name in portrait orientation

If the paper isn't known, the returned size will be 0.0 in both axis (e.g. empty). Refer CAPS_REC_IS_EMPTY to catch this case.

This is a wrapper around libpaper and for convinience and not related to the job and document.