Skip to main content

OH_Print_QueryPrinterProperties

Function OH_Print_QueryPrinterProperties 

Source
pub unsafe extern "C" fn OH_Print_QueryPrinterProperties(
    printerId: *const c_char,
    propertyKeyList: *const Print_StringList,
    propertyList: *mut Print_PropertyList,
) -> Print_ErrorCode
Available on crate features print and api-12 only.
Expand description

This API queries the corresponding printer property values based on the list of property keywords.

ohos.permission.PRINT

§Arguments

  • printerId - The id of the printer to be queried.

  • propertyKeyList - The list of property keywords to be queried

  • propertyList - The list of printer property values queried.

§Returns

  • Returns Print_ErrorCode if the execution is successful. [PRINT_ERROR_NO_PERMISSION] The permission ohos.permission.PRINT is needed. [PRINT_ERROR_INVALID_PARAMETER] One of the params is NULL or the keyword list is empty. [PRINT_ERROR_INVALID_PRINTER] The printer properties for the specified printer could not be found. [PRINT_ERROR_GENERIC_FAILURE] Unable to copy the printer properties.

Required System Capabilities: SystemCapability.Print.PrintFramework

Available since API-level: 12