harmony 鸿蒙ohprint.h

2025-06-12 浏览 (1)

ohprint.h

Overview

Declares APIs for discovering and connecting to printers, printing files, and querying the list of added printers and printer information.

Library: libohprint.so @kit BasicServicesKit

System capability: SystemCapability.Print.PrintFramework

Since: 12

Related module: OH_Print

Summary

Structs

NameDescription
struct Print_MarginDefines the page margin.
struct Print_PageSizeDefines the page size.
struct Print_RangeDefines the page range.
struct Print_PrintAttributesDefines the print attributes.
struct Print_PrintDocCallbackDefines the print job callback.

Types

NameDescription
typedef void(* Print_WriteResultCallback) (const char *jobId, uint32_t code)Defines a callback used to return the file write-back result.
typedef void(* Print_OnStartLayoutWrite) (const char *jobId, uint32_t fd, const Print_PrintAttributes *oldAttrs, const Print_PrintAttributes *newAttrs, Print_WriteResultCallback writeCallback)Defines a callback to be invoked when the file write-back starts.
typedef void(* Print_OnJobStateChanged) (const char *jobId, uint32_t state)Defines a callback used to return the print job state.

Enums

NameDescription
Print_ErrorCode {
PRINT_ERROR_NONE = 0, PRINT_ERROR_NO_PERMISSION = 201, PRINT_ERROR_INVALID_PARAMETER = 401, PRINT_ERROR_GENERIC_FAILURE = 24300001,
PRINT_ERROR_RPC_FAILURE = 24300002, PRINT_ERROR_SERVER_FAILURE = 24300003, PRINT_ERROR_INVALID_EXTENSION = 24300004, PRINT_ERROR_INVALID_PRINTER = 24300005,
PRINT_ERROR_INVALID_PRINT_JOB = 24300006, PRINT_ERROR_FILE_IO = 24300007, PRINT_ERROR_UNKNOWN = 24300255
}
Enumerates the error codes.
Print_JobDocAdapterState {
PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY = 0, PRINT_DOC_ADAPTER_PRINT_TASK_SUCCEED = 1, PRINT_DOC_ADAPTER_PRINT_TASK_FAIL = 2, PRINT_DOC_ADAPTER_PRINT_TASK_CANCEL = 3,
PRINT_DOC_ADAPTER_PRINT_TASK_BLOCK = 4, PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY_FOR_CANCELED = 5, PRINT_DOC_ADAPTER_PREVIEW_ABILITY_DESTROY_FOR_STARTED = 6
}
Enumerates the print job states.

Functions

NameDescription
Print_ErrorCode OH_Print_StartPrintByNative (const char *printJobName, Print_PrintDocCallback printDocCallback, void *context)Calls the API for opening the print preview page.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Basic Services Kit

harmony 鸿蒙DeviceInfo

harmony 鸿蒙InitSync

harmony 鸿蒙OH_Print

harmony 鸿蒙OsAccount

harmony 鸿蒙Pasteboard

harmony 鸿蒙Print_Margin

harmony 鸿蒙Print_PageSize

harmony 鸿蒙Print_PrintAttributes

harmony 鸿蒙Print_PrintDocCallback

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/hDmDaK