Как уменьшить верхнее и нижнее пространство в квитанции печати с использованием модели термопринтера (ACE-H1) в ios swift 4 - PullRequest
0 голосов
/ 16 марта 2019

На этой картинке у меня есть пробел круглой отметки, который я должен удалить

На изображении выше закругленная отметка, я должен уменьшить верхнюю часть пространства, что бесполезно. Мне нужна помощь, чтобы уменьшить верхнее и нижнее пространство. Я использовал следующий класс, который содержит код для линии подачи и пробела.

import Foundation

public struct ESC_POSCommand: RawRepresentable {

    public typealias RawValue = [UInt8]

    public let rawValue: [UInt8]

    public init(rawValue: [UInt8]) {
        self.rawValue = rawValue
    }

    public init(_ rawValue: [UInt8]) {
        self.rawValue = rawValue
    }
}


//Control Commands
extension ESC_POSCommand {

    // Clears the data in the print buffer and resets the printer modes to the modes that were in effect when the power was turned on.
    static let Initialize = ESC_POSCommand(rawValue: [27, 64])

    // Prints the data in the print buffer and feeds n lines.
    static func printAndFeed(lines: UInt8 = 1) -> ESC_POSCommand {
        return ESC_POSCommand([27, 100, lines])
    }

    static func feed(points: UInt8) -> ESC_POSCommand {
        return ESC_POSCommand([27, 74, points])
    }

    // Prints the data in the print buffer and feeds n lines in the reverse direction.
    static func printAndReverseFeed(lines: UInt8 = 1) -> ESC_POSCommand {
        return ESC_POSCommand([27, 101, lines])
    }
}
...