[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6 Paper functions

Data type: void * stp_papersize_t
This is an opaque data type, whose structure is not visible to the user. It describes a papersize, with a short name, long name, width, height, and top, bottom, left and right edges.

Data type: stp_papersize_unit_t
 
typedef enum papersize_unit
{
  PAPERSIZE_ENGLISH,
  PAPERSIZE_METRIC
} stp_papersize_unit_t;
This data type is used to select either English (Imperial) or metric units of measurement.

Function: int stp_known_papersizes (void)
This function returns the total number of available paper sizes.

Function: const stp_papersize_t stp_get_papersize_by_name (const char *name)
This function returns the papersize with name name. If name is NULL or nonexistant, then NULL is returned.

Function: const stp_papersize_t stp_get_papersize_by_size (int l, int w)
This function returns the papersize with height l and width w. If a matching papersize cannot be found, the nearest matching size will be returned, providing the difference between the requested and nearest papersizes does is less than 20 points (height difference plus width difference). If a match cannot be made, NULL is returned.

Function: const stp_papersize_t stp_get_papersize_by_index (int index)
This function returns the papersize of a given papersize number index. index must be less than the number returned by stp_known_papersizes. If index is out of the allowed range, NULL is returned.

Function: const char * stp_papersize_get_name (const stp_papersize_t pt)
This function is used to obtain a pointer to the name string of a given papersize pt.

Function: const char * stp_papersize_get_text (const stp_papersize_t pt)
This function is used to obtain a pointer to the long name string of a given papersize pt. The string is translated and encoded according to the current locale. Otherwise, its behaviour is identical to stp_papersize_get_name.

Function: unsigned stp_papersize_get_width (const stp_papersize_t pt)
Get the width of papersize pt.

Function: unsigned stp_papersize_get_height (const stp_papersize_t pt)
Get the height of papersize pt.

Function: unsigned stp_papersize_get_top (const stp_papersize_t pt)
Get the top edge of papersize pt.

Function: unsigned stp_papersize_get_left (const stp_papersize_t pt)
Get the width of papersize pt.

Function: unsigned stp_papersize_get_bottom (const stp_papersize_t pt)
Get the bottom edge of papersize pt.

Function: unsigned stp_papersize_get_right (const stp_papersize_t pt)
Get the right edge of papersize pt.

Function: stp_papersize_unit_t stp_papersize_get_unit (const stp_papersize_t pt)
Get the measurement unit of papersize pt.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Robert Krawitz on September, 1 2003 using texi2html