Skip to main content

OH_Print_QueryPrinterInfo

Function OH_Print_QueryPrinterInfo 

Source
pub unsafe extern "C" fn OH_Print_QueryPrinterInfo(
    printerId: *const c_char,
    printerInfo: *mut *mut Print_PrinterInfo,
) -> Print_ErrorCode
Available on crate features print and api-12 only.
Expand description

This API queries printer information based on the printer id.

ohos.permission.PRINT

§Arguments

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

  • printerInfo - A pointer to a Print_PrinterInfo pointer to store the printer infomation.

§Returns

  • Returns Print_ErrorCode if the execution is successful. [PRINT_ERROR_NO_PERMISSION] The permission ohos.permission.PRINT is needed. [PRINT_ERROR_RPC_FAILURE] Unable to connect to the print service. [PRINT_ERROR_INVALID_PARAMETER] printerId is NULL or printerInfo is NULL. [PRINT_ERROR_INVALID_PRINTER] Unable to find the printer in the connected printer list.

Required System Capabilities: SystemCapability.Print.PrintFramework

Available since API-level: 12