Added in Version 1.0.0

StarPrinter

The class that controls the printer

Constructor

init(_ connectionSettings: StarConnectionSettings)

Initialize object

Property

Default value

Type

information

Printer information

nil

StarPrinterInformation?

connectionSettings

Printer connection settings

Value set in constructor

StarConnectionSettings

template

Template

nil

String?

errorDetail

Error details

StarIO10ErrorDetail()

StarIO10ErrorDetail

printerDelegate

Status event for the printer

nil

PrinterDelegate?

drawerDelegate

Status event for the cash drawer

nil

DrawerDelegate?

inputDeviceDelegate

Status event for an input device

nil

InputDeviceDelegate?

displayDelegate

Status event for the customer display

nil

DisplayDelegate?

openTimeout

Open timeout (msec)

10000

Int

printTimeout

Print timeout (msec)

30000

Int

getStatusTimeout

Get status timeout (msec)

5000

Int

starConfigurationTimeout

Set/Get Star Configuration timeout(msec)

90000

Int

Method (for iOS 13 or later)

open() async

Open the printer

print(command: String) async

Print

print(command: String, starSpoolJobSettings: StarSpoolJobSettings) async

Print using the printer’s spooler function

print(raw: Data) async

Print binary data

getStatus() async

Get the printer status

getSpoolJobStatus(jobId: Int) async

Get the print job status of the specified print job ID

getSpoolJobStatusListAsync(size: Int) async

Get the print job history (List of print job status) for the specified number of jobs from the most recent.

getStarConfiguration(password: String? = nil) async

Get the present Star Configuration

getDefaultStarConfiguration() async

Get the default Star Configuration

setStarConfiguration(starConfiguration: String) async

Set Star Configuration

close() async

Close the printer

Warning

Method (for iOS 12) is provided only for compatibility of applications supporting iOS 12 and will be removed in the future when the minimum supported OS version of this SDK is raised to iOS 15.

[Deprecated] Method (for iOS 12)

open(completion: @escaping (Error?) -> Void)

Open the printer

print(command: String, completion: @escaping (Error?) -> Void)

Print

print(command: String, starSpoolJobSettings: StarSpoolJobSettings, completion: @escaping (Int?, Error?) -> Void)

Print using the printer’s spooler function

print(raw: Data, completion: @escaping (Error?) -> Void)

Print binary data

getStatus(completion: @escaping (StarIO10.StarPrinterStatus?, Error?) -> Void)

Get the printer status

getSpoolJobStatus(jobId: Int, completion: @escaping (StarSpoolJobStatus?, Error?) -> Void)

Get the print job status of the specified print job ID

getSpoolJobStatusList(size: Int, completion: @escaping ([StarSpoolJobStatus]?, Error?) -> Void)

Get the print job history (List of print job status) for the specified number of jobs from the most recent.

getStarConfiguration(completion: @escaping (String?, Error?) -> Void)

Get the present Star Configuration

getDefaultStarConfiguration(completion: @escaping (String?, Error?) -> Void)

Get the default Star Configuration

setStarConfiguration(starConfiguration: String, completion: @escaping (Error?) -> Void)

Set Star Configuration

close(completion: @escaping () -> Void)

Close the printer