Skip to main content

OH_Print_QueryPrinterList

Function OH_Print_QueryPrinterList 

Source
pub unsafe extern "C" fn OH_Print_QueryPrinterList(
    printerIdList: *mut Print_StringList,
) -> Print_ErrorCode
Available on crate features print and api-12 only.
Expand description

This API queries for a list of added printers.

ohos.permission.PRINT

§Arguments

  • printerIdList - A pointer to a Print_StringList instance to store the queried printer id list.

§Returns

  • Returns Print_ErrorCode if the execution is successful. [PRINT_ERROR_NO_PERMISSION] The permission ohos.permission.PRINT is needed. [PRINT_ERROR_INVALID_PARAMETER] printerIdList is NULL. [PRINT_ERROR_INVALID_PRINTER] Unable to query any connected printers. [PRINT_ERROR_GENERIC_FAILURE] Unable to copy the printer id list.

Required System Capabilities: SystemCapability.Print.PrintFramework

Available since API-level: 12