Skip to main content

OH_Print_Init

Function OH_Print_Init 

Source
pub unsafe extern "C" fn OH_Print_Init() -> Print_ErrorCode
Available on crate features print and api-12 only.
Expand description

This API checks and pulls up the print service, initializes the print client, and establishes a connection to the print service.

ohos.permission.PRINT

ยง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_SERVER_FAILURE] The cups service cannot be started.

Required System Capabilities: SystemCapability.Print.PrintFramework

Available since API-level: 12