Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE void U_EXPORT2 ulocdata_getPaperSize ( const char *  localeID,
int32_t *  height,
int32_t *  width,
UErrorCode status 

Returns the element gives the normal business letter size, and customary units. The units for the numbers are always in milli-meters. For US since 8.5 and 11 do not yeild an integral value when converted to milli-meters, the values are rounded off. So for A4 size paper the height and width are 297 mm and 210 mm repectively, and for US letter size the height and width are 279 mm and 216 mm respectively. Please note that this API will change in ICU 3.6 and will use an ulocdata object.

localeID The id of the locale for which the paper size information to be retrieved.
height A pointer to int to recieve the height information.
width A pointer to int to recieve the width information.
status Must be a valid pointer to an error code value, which must not indicate a failure before the function call. ICU 2.8

Definition at line 212 of file ulocdata.c.


    UResourceBundle* bundle=NULL;
    UResourceBundle* paperSizeBundle = NULL;
    const int32_t* paperSize=NULL;
    int32_t len = 0;

    if(status == NULL || U_FAILURE(*status)){

    bundle = ures_open(NULL, localeID, status);
    paperSizeBundle = ures_getByKeyWithFallback(bundle, PAPER_SIZE, NULL, status);
    paperSize = ures_getIntVector(paperSizeBundle, &len,  status);

        if(len < 2){
            *status = U_INTERNAL_PROGRAM_ERROR;
            *height = paperSize[0];
            *width  = paperSize[1];



Generated by  Doxygen 1.6.0   Back to index