package com.ffii.fpsms.modules.master.print

import com.ffii.core.utils.CanonPrinterUtil
import java.io.File

class CanonA4Driver : A4PrintDriver {
    override fun print(pdfFile: File, ip: String, port: Int, printQty: Int) {
        val duplexMode = if (CanonPrinterUtil.isLandscape(pdfFile)) {
            CanonPrinterUtil.DuplexMode.DUPLEX_SHORT_EDGE
        } else {
            CanonPrinterUtil.DuplexMode.DUPLEX_LONG_EDGE
        }
        CanonPrinterUtil.printPdfToCanon(pdfFile, ip, port, printQty, duplexMode)
    }
}