harmony 鸿蒙@ohos.print (Print)

2023-10-30 浏览 (471)

@ohos.print (Print)

The print module provides APIs for basic print operations.

NOTE

The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Modules to Import

import print from '@ohos.print';

PrintTask

Implements event listener APIs for print tasks.

on

on(type: 'block', callback: Callback<void>): void

Registers a listener for the print task blocking event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'block', indicating blocking of the print task.
callbackCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.on('block', () => {
        console.log('print state is block');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

on

on(type: 'succeed', callback: Callback<void>): void

Registers a listener for the print task success event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'succeed', indicating success of the print task.
callbackCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.on('succeed', () => {
        console.log('print state is succeed');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

on

on(type: 'fail', callback: Callback<void>): void

Registers a listener for the print task failure event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'fail', indicating failure of the print task.
callbackCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.on('fail', () => {
        console.log('print state is fail');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

on

on(type: 'cancel', callback: Callback<void>): void

Registers a listener for the print task cancel event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'cancel', indicating canceling of the print task.
callbackCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.on('cancel', () => {
        console.log('print state is cancel');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

off

off(type: 'block', callback?: Callback<void>): void

Unregisters the listener for the print task blocking event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'block', indicating blocking of the print task.
callbackCallback<void>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.off('block', () => {
        console.log('unregister state block');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

off

off(type: 'succeed', callback?: Callback<void>): void

Unregisters the listener for the print task success event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'succeed', indicating success of the print task.
callbackCallback<void>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.off('succeed', () => {
        console.log('unregister state succeed');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

off

off(type: 'fail', callback?: Callback<void>): void

Unregisters the listener for the print task failure event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'fail', indicating failure of the print task.
callbackCallback<void>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.off('fail', () => {
        console.log('unregister state fail');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

off

off(type: 'cancel', callback?: Callback<void>): void

Unregisters the listener for the print task cancel event. This API uses a callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
typestringYesListening type.
The value is fixed at 'cancel', indicating canceling of the print task.
callbackCallback<void>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let file = ['file://data/print/a.png', 'file://data/print/b.png'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.off('cancel', () => {
        console.log('unregister state cancel');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

print

print(files: Array<string>, callback: AsyncCallback<PrintTask>): void

Prints files. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
fileArray<string>YesList of files to print. Images in .jpg, .png, .gif, .bmp, or .webp format are supported.
callbackAsyncCallback<PrintTask>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

// Pass in the URIs of the files.
let file = ['file://data/print/a.png', 'file://data/print/b.png'];
// Alternatively, pass in the file IDs.
//let file = ['fd://1', 'fd://2'];
print.print(file, (err: BusinessError, printTask: print.PrintTask) => {
    if (err) {
        console.log('print err ' + JSON.stringify(err));
    } else {
        printTask.on('succeed', () => {
            console.log('print state is succeed');
        })
        // ...
    }
})

print

print(files: Array<string>): Promise<PrintTask>

Prints files. This API uses a promise to return the result.

Required permissions: ohos.permission.PRINT

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
fileArray<string>YesList of files to print. Images in .jpg, .png, .gif, .bmp, or .webp format are supported.

Return value

TypeDescription
Promise<PrintTask>Print result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

// Pass in the URIs of the files.
let file = ['file://data/print/a.png', 'file://data/print/b.png'];
// Alternatively, pass in the file IDs.
//let file = ['fd://1', 'fd://2'];
print.print(file).then((printTask: print.PrintTask) => {
    printTask.on('succeed', () => {
        console.log('print state is succeed');
    })
    // ...
}).catch((error: BusinessError) => {
    console.log('print err ' + JSON.stringify(error));
})

PrintMargin

Defines the page margins for printing.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
topnumberNoTop margin of the page.
bottomnumberNoBottom margin of the page.
leftnumberNoLeft margin of the page.
rightnumberNoRight margin of the page.

PrinterRange

Defines the print range.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
startPagenumberNoStart page.
endPagenumberNoEnd page.
pagesArray<number>NoDiscrete pages.

PreviewAttribute

Defines the print preview attributes.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
previewRangePrinterRangeYesPreview page range.
resultnumberNoPrint preview result.

PrintResolution

Defines the resolution for printing.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
idstringYesResolution ID.
horizontalDpinumberYesHorizontal DPI.
verticalDpinumberYesVertical DPI.

PrintPageSize

Defines the size of the printed page.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
idstringYesPage size ID.
namestringYesPage size name.
widthnumberYesPage width, in millimeters.
heightnumberYesPage height, in millimeters.

PrinterCapability

Defines the printer capabilities.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
colorModenumberYesColor mode.
duplexModenumberYesSingle-sided or double-sided printing mode.
pageSizeArray<PrintPageSize>YesList of page sizes supported by the printer.
resolutionArray<PrintResolution>NoList of resolutions supported by the printer.
minMarginPrintMarginNoMinimum margin of the printer.

PrinterInfo

Provides the printer information.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.
printerNamestringYesPrinter name.
printerStatePrinterStateYesPrinter state.
printerIconnumberNoResource ID of the printer icon.
descriptionstringNoPrinter description.
capabilityPrinterCapabilityNoPrinter capability.
optionsObjectNoPrinter options. The value is a JSON object string.

PrintJob

Defines a print job.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
fdListArray<number>YesFD list of files to print.
jobIdstringYesID of the print job.
printerIdstringYesID of the printer used for printing.
jobStatePrintJobStateYesState of the print job.
copyNumbernumberYesCopy of the file list.
pageRangePrinterRangeYesPrint range.
isSequentialbooleanYesWhether to enable sequential printing.
pageSizePrintPageSizeYesSelected page size.
isLandscapebooleanYesWhether to print in landscape mode.
colorModenumberYesColor mode.
duplexModenumberYesSingle-sided or double-sided printing mode.
marginPrintMarginNoCurrent page margin.
previewPreviewAttributeNoPreview settings.
optionsObjectNoPrinter options. The value is a JSON object string.

PrinterState

Enumerates the printer states.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

NameValueDescription
PRINTER_ADDED0A new printer is added.
PRINTER_REMOVED1The printer is removed.
PRINTER_CAPABILITY_UPDATED2The printer is updated.
PRINTER_CONNECTED3The printer is connected.
PRINTER_DISCONNECTED4The printer is disconnected.
PRINTER_RUNNING5The printer is running.

PrintJobState

Enumerates the print job states.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

NameValueDescription
PRINT_JOB_PREPARE0The printer is prepared for the print job.
PRINT_JOB_QUEUED1The print job is on the print queue of the printer.
PRINT_JOB_RUNNING2The print job is being executed.
PRINT_JOB_BLOCKED3The print job is blocked.
PRINT_JOB_COMPLETED4The print job is complete.

PrintJobSubState

Enumerates the print job substates.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

NameValueDescription
PRINT_JOB_COMPLETED_SUCCESS0The print job is successful.
PRINT_JOB_COMPLETED_FAILED1The print job failed.
PRINT_JOB_COMPLETED_CANCELLED2The print job is canceled.
PRINT_JOB_COMPLETED_FILE_CORRUPTED3The print job is corrupted.
PRINT_JOB_BLOCK_OFFLINE4The printer is offline.
PRINT_JOB_BLOCK_BUSY5The printer is occupied by another process.
PRINT_JOB_BLOCK_CANCELLED6The print job is canceled.
PRINT_JOB_BLOCK_OUT_OF_PAPER7The printer is out of paper.
PRINT_JOB_BLOCK_OUT_OF_INK8The printer is out of ink.
PRINT_JOB_BLOCK_OUT_OF_TONER9The printer is out of toner.
PRINT_JOB_BLOCK_JAMMED10The printer is in a paper jam.
PRINT_JOB_BLOCK_DOOR_OPEN11The printer door is open.
PRINT_JOB_BLOCK_SERVICE_REQUEST12Print service request.
PRINT_JOB_BLOCK_LOW_ON_INK13The printer is low on ink.
PRINT_JOB_BLOCK_LOW_ON_TONER14The printer is low on toner.
PRINT_JOB_BLOCK_REALLY_LOW_ON_INK15The printer is extremely low on ink.
PRINT_JOB_BLOCK_BAD_CERTIFICATE16The print certificate is incorrect.
PRINT_JOB_BLOCK_UNKNOWN99An unknown print error occurs.

PrintErrorCode

Enumerates the print error codes.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

NameValueDescription
E_PRINT_NONE0No error.
E_PRINT_NO_PERMISSION201No permission.
E_PRINT_INVALID_PARAMETER401Invalid parameter.
E_PRINT_GENERIC_FAILURE13100001Printing failure.
E_PRINT_RPC_FAILURE13100002RPC failure.
E_PRINT_SERVER_FAILURE13100003Print service failure.
E_PRINT_INVALID_EXTENSION13100004Invalid printer extension.
E_PRINT_INVALID_PRINTER13100005Invalid printer.
E_PRINT_INVALID_PRINT_JOB13100006Invalid print job.
E_PRINT_FILE_IO13100007Incorrect file input/output.

PrinterExtensionInfo

Provides the printer extension information.

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Attributes

NameTypeMandatoryDescription
extensionIdstringYesID of the printer extension.
vendorIdstringYesVendor ID of the printer extension.
vendorNamestringYesVendor name of the printer extension.
vendorIconnumberYesVendor icon of the printer extension.
versionstringYesVersion of the printer extension.

queryAllPrinterExtensionInfos

queryAllPrinterExtensionInfos(callback: AsyncCallback<Array<PrinterExtensionInfo>>): void

Obtains the information of all installed printer extensions. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<Array<PrinterExtensionInfo>>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.queryAllPrinterExtensionInfos((err: BusinessError, extensionInfos: print.PrinterExtensionInfo[]) => {
    if (err) {
        console.log('queryAllPrinterExtensionInfos err ' + JSON.stringify(err));
    } else {
        console.log('queryAllPrinterExtensionInfos success ' + JSON.stringify(extensionInfos));
    }
})

queryAllPrinterExtensionInfos

queryAllPrinterExtensionInfos(): Promise<Array<PrinterExtensionInfo>>

Obtains the information of all installed printer extensions. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Return value

TypeDescription
Promise<Array<PrinterExtensionInfo>>Promise used to return the result.used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.queryAllPrinterExtensionInfos().then((extensionInfos: print.PrinterExtensionInfo[]) => {
    console.log('queryAllPrinterExtensionInfos success ' + JSON.stringify(extensionInfos));
    // ...
}).catch((error: BusinessError) => {
    console.log('failed to get AllPrinterExtension bacause ' + JSON.stringify(error));
})

startDiscoverPrinter

startDiscoverPrinter(extensionList: Array<string>, callback: AsyncCallback<void>): void

Starts discovering printers with the specified printer extensions. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
extensionListArray<string>YesList of printer extensions to load.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let extensionList: string[] = [];
// If there is no information in extensionList, all extensions are used for printer discovery.
print.startDiscoverPrinter(extensionList, (err: BusinessError, data : void) => {
    if (err) {
        console.log('failed to start Discover Printer because : ' + JSON.stringify(err));
    } else {
        console.log('start Discover Printer success data : ' + JSON.stringify(data));
    }
})

startDiscoverPrinter

startDiscoverPrinter(extensionList: Array<string>): Promise<void>

Starts discovering printers with the specified printer extensions. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let extensionList: string[] = [];
// If there is no information in extensionList, all extensions are used for printer discovery.
print.startDiscoverPrinter(extensionList).then((data : void) => {
    console.log('start Discovery success data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('failed to start Discovery because : ' + JSON.stringify(error));
})

stopDiscoverPrinter

stopDiscoverPrinter(callback: AsyncCallback<void>): void

Stops discovering printers with the specified printer extensions. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.stopDiscoverPrinter((err: BusinessError, data : void) => {
    if (err) {
        console.log('failed to stop Discover Printer because : ' + JSON.stringify(err));
    } else {
        console.log('stop Discover Printer success data : ' + JSON.stringify(data));
    }
})

stopDiscoverPrinter

stopDiscoverPrinter(): Promise<void>

Stops discovering printers with the specified printer extensions. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.stopDiscoverPrinter().then((data : void) => {
    console.log('stop Discovery success data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('failed to stop Discovery because : ' + JSON.stringify(error));
})

connectPrinter

connectPrinter(printerId: string, callback: AsyncCallback<void>): void

Connects to the specified printer. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId: string = 'printerId_32';
print.connectPrinter(printerId, (err: BusinessError, data : void) => {
    if (err) {
        console.log('failed to connect Printer because : ' + JSON.stringify(err));
    } else {
        console.log('start connect Printer success data : ' + JSON.stringify(data));
    }
})

connectPrinter

connectPrinter(printerId: string): Promise<void>

Connects to the specified printer. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId: string = 'printerId_32';
print.connectPrinter(printerId).then((data : void) => {
    console.log('start connect Printer success data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('failed to connect Printer because : ' + JSON.stringify(error));
})

disconnectPrinter

disconnectPrinter(printerId: string, callback: AsyncCallback<void>): void

Disconnects from the specified printer. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId: string = 'printerId_32';
print.disconnectPrinter(printerId, (err: BusinessError, data : void) => {
    if (err) {
        console.log('failed to disconnect Printer because : ' + JSON.stringify(err));
    } else {
        console.log('start disconnect Printer success data : ' + JSON.stringify(data));
    }
})

disconnectPrinter

disconnectPrinter(printerId: string): Promise<void>

Disconnects from the specified printer. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId: string = 'printerId_32';
print.disconnectPrinter(printerId).then((data : void) => {
    console.log('start disconnect Printer success data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('failed to disconnect Printer because : ' + JSON.stringify(error));
})

queryPrinterCapability

queryPrinterCapability(printerId: string, callback: AsyncCallback<void>): void

Queries the printer capability. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId: string = 'printerId_32';
print.queryPrinterCapability(printerId, (err: BusinessError, data : void) => {
    if (err) {
        console.log('failed to query Printer Capability because : ' + JSON.stringify(err));
    } else {
        console.log('start query Printer Capability success data : ' + JSON.stringify(data));
    }
})

queryPrinterCapability

queryPrinterCapability(printerId: string): Promise<void>

Queries the printer capability. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId: string = 'printerId_32';
print.queryPrinterCapability(printerId).then((data : void) => {
    console.log('start query Printer success data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('failed to query Printer Capability because : ' + JSON.stringify(error));
})

startPrintJob

startPrintJob(jobInfo: PrintJob, callback: AsyncCallback<void>): void

Starts the specified print job. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobInfoPrintJobYesInformation about the print job.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobInfo : print.PrintJob = {
    fdList : [0,1],
    jobId : 'jobId_12',
    printerId : 'printerId_32',
    jobState : 3,
    copyNumber : 1,
    pageRange : {},
    isSequential : false,
    pageSize : {id : '', name : '', width : 10, height : 20},
    isLandscape : false,
    colorMode : 6,
    duplexMode : 6,
    margin : undefined,
    preview : undefined,
    options : undefined
};
print.startPrintJob(jobInfo, (err: BusinessError, data : void) => {
    if (err) {
        console.log('failed to start Print Job because : ' + JSON.stringify(err));
    } else {
        console.log('start Print Job success data : ' + JSON.stringify(data));
    }
})

startPrintJob

startPrintJob(jobInfo: PrintJob): Promise<void>

Starts the specified print job. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobInfoPrintJobYesInformation about the print job.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobInfo : print.PrintJob = {
    fdList : [0,1],
    jobId : 'jobId_12',
    printerId : 'printerId_32',
    jobState : 3,
    copyNumber : 1,
    pageRange : {},
    isSequential : false,
    pageSize : {id : '', name : '', width : 10, height : 20},
    isLandscape : false,
    colorMode : 6,
    duplexMode : 6,
    margin : undefined,
    preview : undefined,
    options : undefined
};
print.startPrintJob(jobInfo).then((data : void) => {
    console.log('start Print success data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('failed to start Print because : ' + JSON.stringify(error));
})

cancelPrintJob

cancelPrintJob(jobId: string, callback: AsyncCallback<void>): void

Cancels the specified print job, which is on the print queue of the printer. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobIdstringYesPrint job ID.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobId : string = '121212';
print.cancelPrintJob(jobId, (err: BusinessError, data : void) => {
    if (err) {
        console.log('cancelPrintJob failed, because : ' + JSON.stringify(err));
    } else {
        console.log('cancelPrintJob success, data: ' + JSON.stringify(data));
    }
})

cancelPrintJob

cancelPrintJob(jobId: string): Promise<void>

Cancels the specified print job, which is on the print queue of the printer. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobIdstringYesPrint job ID.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobId : string = '121212';
print.cancelPrintJob(jobId).then((data : void) => {
    console.log('cancelPrintJob success, data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('cancelPrintJob failed, because : ' + JSON.stringify(error));
})

requestPrintPreview

requestPrintPreview(jobInfo: PrintJob, callback: Callback<number>): void

Requests print preview data. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobInfoPrintJobYesInformation about the print job.
callbackCallback<number>YesCallback used to return the result.

Example

import print from '@ohos.print';

let jobInfo : print.PrintJob = {
    fdList : [0,1],
    jobId : 'jobId_12',
    printerId : 'printerId_32',
    jobState : 3,
    copyNumber : 1,
    pageRange : {},
    isSequential : false,
    pageSize : {id : '', name : '', width : 10, height : 20},
    isLandscape : false,
    colorMode : 6,
    duplexMode : 6,
    margin : undefined,
    preview : undefined,
    options : undefined
};
print.requestPrintPreview(jobInfo, (num : number) => {
    console.log('requestPrintPreview success, num : ' + JSON.stringify(num));

})

requestPrintPreview

requestPrintPreview(jobInfo: PrintJob): Promise<number>

Requests print preview data. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobInfoPrintJobYesInformation about the print job.

Return value

TypeDescription
Promise<number>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobInfo : print.PrintJob = {
    fdList : [0,1],
    jobId : 'jobId_12',
    printerId : 'printerId_32',
    jobState : 3,
    copyNumber : 1,
    pageRange : {},
    isSequential : false,
    pageSize : {id : '', name : '', width : 10, height : 20},
    isLandscape : false,
    colorMode : 6,
    duplexMode : 6,
    margin : undefined,
    preview : undefined,
    options : undefined
};
print.requestPrintPreview(jobInfo).then((num: number) => {
    console.log('requestPrintPreview success, num : ' + JSON.stringify(num));
}).catch((error: BusinessError) => {
    console.log('requestPrintPreview failed, because : ' + JSON.stringify(error));
})

on

on(type: 'printerStateChange', callback: (state: PrinterState, info: PrinterInfo) => void): void

Registers a listener for printer state change events. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
type'printerStateChange'YesListening type. The value is fixed at 'printerStateChange'.
callback(state: PrinterState, info: PrinterInfo) => voidYesCallback used to return the result.

Example

import print from '@ohos.print';

print.on('printerStateChange', (state: print.PrinterState, info: print.PrinterInfo) => {
    if (state === null||info === null) {
        console.log('printer state changed state is null or info is null');
        return;
    } else {
        console.log('on printer state changed, state : ' + JSON.stringify(state));
        console.log('on printer state changed, info : ' + JSON.stringify(info));
    }
})

off

off(type: 'printerStateChange', callback?: Callback<boolean>): void

Unregisters the listener for printer state change events. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
type'printerStateChange'YesListening type. The value is fixed at 'printerStateChange'.
callbackCallback<boolean>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.off('printerStateChange', (err: BusinessError, data: boolean) => {
    if (err) {
        console.log('off printerStateChange failed, because : ' + JSON.stringify(err));
    } else {
        console.log('off printerStateChange data : ' + JSON.stringify(data));
    }
})

on

on(type: 'jobStateChange', callback: (state: PrintJobState, job: PrintJob) => void): void

Registers a listener for print job state change events. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
type'jobStateChange'YesListening type. The value is fixed at 'jobStateChange'.
callback(state: PrintJobState, job: PrintJob) => voidYesCallback used to return the result.

Example

import print from '@ohos.print';

print.on('jobStateChange', (state: print.PrintJobState, job: print.PrintJob) => {
    console.log('onJobStateChange, state : ' + JSON.stringify(state) + ', job : ' + JSON.stringify(job));
})

off

off(type: 'jobStateChange', callback?: Callback<boolean>): void

Unregisters the listener for print job state change events. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
type'jobStateChange'YesListening type. The value is fixed at 'jobStateChange'.
callbackCallback<boolean>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.off('jobStateChange', (err: BusinessError, data: boolean) => {
    if (err) {
        console.log('offJobStateChanged failed, because : ' + JSON.stringify(err));
    } else {
        console.log('offJobStateChanged data : ' + JSON.stringify(data));
    }
})

on

on(type: 'extInfoChange', callback: (extensionId: string, info: string) => void): void

Registers a listener for printer extension information change events. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
type'extInfoChange'YesListening type. The value is fixed at 'extInfoChange'.
callback(extensionId: string, info: string) => voidYesCallback used to return the result.

Example

import print from '@ohos.print';

print.on('extInfoChange', (extensionId: string, info: string) => {
    console.log('onExtInfoChange, entensionId : ' + JSON.stringify(extensionId) + ', info : ' + JSON.stringify(info));
})

off

off(type: 'extInfoChange', callback?: Callback<boolean>): void

Unregisters the listener for printer extension information change events. This API uses a callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
type'extInfoChange'YesListening type. The value is fixed at 'extInfoChange'.
callbackCallback<boolean>NoCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.off('extInfoChange', (err: BusinessError, data: boolean) => {
    if (err) {
        console.log('offExtInfoChange failed, because : ' + JSON.stringify(err));
    } else {
        console.log('offExtInfoChange data : ' + JSON.stringify(data));
    }
})

addPrinters

addPrinters(printers: Array<PrinterInfo>, callback: AsyncCallback<void>): void

Adds printers. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printersArray<PrinterInfo>YesList of printers to add.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerInfo : print.PrinterInfo = {
    printerId : '3232',
    printerName : 'hhhhh',
    printerState : 0,
    printerIcon : 12,
    description : 'str',
    capability : undefined,
    options : 'opt'
};
print.addPrinters([printerInfo], (err: BusinessError, data : void) => {
    if (err) {
        console.log('addPrinters failed, because : ' + JSON.stringify(err));
    } else {
        console.log('addPrinters success, data : ' + JSON.stringify(data));
    }
})

addPrinters

addPrinters(printers: Array<PrinterInfo>): Promise<void>

Adds printers. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printersArray<PrinterInfo>YesList of printers to add.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerInfo : print.PrinterInfo = {
    printerId : '3232',
    printerName : 'hhhhh',
    printerState : 0,
    printerIcon : 12,
    description : 'str',
    capability : undefined,
    options : 'opt'
};
print.addPrinters([printerInfo]).then((data : void) => {
    console.log('add printers data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('add printers error : ' + JSON.stringify(error));
})

removePrinters

removePrinters(printerIds: Array<string>, callback: AsyncCallback<void>): void

Removes printers. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdsArray<string>YesList of printers to remove.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId : string = '1212';
print.removePrinters([printerId], (err: BusinessError, data : void) => {
    if (err) {
        console.log('removePrinters failed, because : ' + JSON.stringify(err));
    } else {
        console.log('removePrinters success, data : ' + JSON.stringify(data));
    }
})

removePrinters

removePrinters(printerIds: Array<string>): Promise<void>

Removes printers. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdsArray<string>YesList of printers to remove.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId : string = '1212';
print.removePrinters([printerId]).then((data : void) => {
    console.log('remove printers data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('remove printers error : ' + JSON.stringify(error));
})

updatePrinters

updatePrinters(printers: Array<PrinterInfo>, callback: AsyncCallback<void>): void

Updates information about the specified printers. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printersArray<PrinterInfo>YesList of printers whose information is to be updated.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerInfo : print.PrinterInfo = {
    printerId : '3232',
    printerName : 'hhhhh',
    printerState : 0,
    printerIcon : 12,
    description : 'str',
    capability : undefined,
    options : 'opt'
};
print.updatePrinters([printerInfo], (err: BusinessError, data : void) => {
    if (err) {
        console.log('updataPrinters failed, because : ' + JSON.stringify(err));
    } else {
        console.log('updataPrinters success, data : ' + JSON.stringify(data));
    }
})

updatePrinters

updatePrinters(printers: Array<PrinterInfo>): Promise<void>

Updates information about the specified printers. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printersArray<PrinterInfo>YesList of printers whose information is to be updated.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerInfo : print.PrinterInfo = {
    printerId : '3232',
    printerName : 'hhhhh',
    printerState : 0,
    printerIcon : 12,
    description : 'str',
    capability : undefined,
    options : 'opt'
};
print.updatePrinters([printerInfo]).then((data : void) => {
    console.log('update printers data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('update printers error : ' + JSON.stringify(error));
})

updatePrinterState

updatePrinterState(printerId: string, state: PrinterState, callback: AsyncCallback<void>): void

Updates the printer state. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.
statePrinterStateYesPrinter state.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId : string = '1212';
let state : print.PrinterState = print.PrinterState.PRINTER_CONNECTED;
print.updatePrinterState(printerId, state, (err: BusinessError, data : void) => {
    if (err) {
        console.log('updataPrinterState failed, because : ' + JSON.stringify(err));
    } else {
        console.log('updataPrinterState success, data : ' + JSON.stringify(data));
    }
})

updatePrinterState

updatePrinterState(printerId: string, state: PrinterState): Promise<void>

Updates the printer state. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
printerIdstringYesPrinter ID.
statePrinterStateYesPrinter state.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let printerId : string = '1212';
let state : print.PrinterState = print.PrinterState.PRINTER_CONNECTED;
print.updatePrinterState(printerId, state).then((data : void) => {
    console.log('update printer state data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('update printer state error : ' + JSON.stringify(error));
})

updatePrintJobState

updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState, callback: AsyncCallback<void>): void

Updates the print job state. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobIdstringYesID of the print job.
statePrintJobStateYesState of the print job.
subStatePrintJobSubStateYesSubstate of the print job.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobId : string = '3434';
let state : print.PrintJobState = print.PrintJobState.PRINT_JOB_PREPARE;
let subState : print.PrintJobSubState = print.PrintJobSubState.PRINT_JOB_COMPLETED_SUCCESS;
print.updatePrintJobState(jobId, state, subState, (err: BusinessError, data : void) => {
    if (err) {
        console.log('updataPrintJobState failed, because : ' + JSON.stringify(err));
    } else {
        console.log('updatePrintJobState success, data : ' + JSON.stringify(data));
    }
})

updatePrintJobState

updatePrintJobState(jobId: string, state: PrintJobState, subState: PrintJobSubState): Promise<void>

Updates the print job state. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
jobIdstringYesID of the print job.
statePrintJobStateYesState of the print job.
subStatePrintJobSubStateYesSubstate of the print job.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let jobId : string = '3434';
let state : print.PrintJobState = print.PrintJobState.PRINT_JOB_PREPARE;
let subState : print.PrintJobSubState = print.PrintJobSubState.PRINT_JOB_COMPLETED_SUCCESS;
print.updatePrintJobState(jobId, state, subState).then((data : void) => {
    console.log('update print job state data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('update print job state error : ' + JSON.stringify(error));
})

updateExtensionInfo

updateExtensionInfo(info: string, callback: AsyncCallback<void>): void

Updates the printer extension information. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
infostringYesNew printer extension information.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let info : string = 'WIFI_INACTIVE';
print.updateExtensionInfo(info, (err: BusinessError, data : void) => {
    if (err) {
        console.log('updateExtensionInfo failed, because : ' + JSON.stringify(err));
    } else {
        console.log('updateExtensionInfo success, data : ' + JSON.stringify(data));
    }
})

updateExtensionInfo

updateExtensionInfo(info: string): Promise<void>

Updates the printer extension information. This API uses a promise to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
infostringYesNew printer extension information.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

let info : string = 'WIFI_INACTIVE';
print.updateExtensionInfo(info).then((data : void) => {
    console.log('update print job state data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('update print job state error : ' + JSON.stringify(error));
})

queryAllPrintJobs

queryAllPrintJobs(callback: AsyncCallback<void>): void

Queries all print jobs. This API uses an asynchronous callback to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.queryAllPrintJobs((err: BusinessError, data : void) => {
    if (err) {
        console.log('queryAllPrintJobs failed, because : ' + JSON.stringify(err));
    } else {
        console.log('queryAllPrintJobs success, data : ' + JSON.stringify(data));
    }
})

queryAllPrintJobs

queryAllPrintJobs(): Promise<void>

Queries all print jobs. This API uses a promise used to return the result.

Required permissions: ohos.permission.MANAGE_PRINT_JOB

System API: This is a system API.

System capability: SystemCapability.Print.PrintFramework

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import print from '@ohos.print';
import { BusinessError } from '@ohos.base';

print.queryAllPrintJobs().then((data : void) => {
    console.log('update print job state data : ' + JSON.stringify(data));
}).catch((error: BusinessError) => {
    console.log('update print job state error : ' + JSON.stringify(error));
})

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙Enterprise Device Management Overview (for System Applications Only)

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

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