APIEnv_​GetPrinterParsID

Retrieves the current printer settings.

    GSErrCode ACAPI_Environment (
        APIEnv_GetPrinterParsID,
        API_PrintPars*     printPars
    );

 

Parameters

printPars
[out] the printing parameters

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The printPars parameter is nullptr

For other common API errors see the API Errors document.

 

Remarks

This function retrieves the printing settings currently used.

 

Example


API_PrintPars printPars;
BNZeroMemory (&printPars, sizeof (API_PrintPars));

GSErrCode err = ACAPI_Environment (APIEnv_GetPrinterParsID, &printPars, nullptr);

double pageWidth, pageHeight;
if (err == NoError) {
    pageWidth = printPars.right - printPars.left;
    pageHeight = printPars.bottom - printPars.top;
} else {
    pageWidth = 0.20142199;
    pageHeight = 0.28858633;
}

 

Requirements

Version: API 10 or later
Header: APIdefs_Environment.h

 

See Also

API_PrintPars
APIDo_PrintID
ACAPI_Environment
API Functions