0

I am utilizing UIPrintInteractionController's print(to:completionHandler:) instance method to directly print to a saved UIPrinter which does allow for duplex printing. In the discussion for print(), it states this method disables duplex printing.

Here is a sample of the code:

var printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.printerID = defaultPrinter.displayName
printInfo.jobName = "My Print Job"
printInfo.orientation = UIPrintInfo.Orientation.portrait
printInfo.outputType = UIPrintInfo.OutputType.general
printInfo.duplex = UIPrintInfo.Duplex.shortEdge
printController.printInfo = printInfo
printController.printingItem = printingItem // ~defined as array of URL(fileURLWithPath: Bundle.main.path(forResource: "some pdf", ofType: "pdf")!)

    printController.print(to: defaultPrinter, completionHandler: {(controller, success, error) -> Void in
        if success {
            debugPrint("Printing Completed.")
        } else {
            debugPrint("Printing Failed.")
        }
    })

As you'd expect, no matter the setting of UIPrintInfo's duplex setting, print(to:completionHandler:) does what is says in disabling the duplex settings.

Other than presenting the user interface — and allowing the user to manually select whether or not the printing selection is single or double-sided, are there any ways around this method's exclusion?

Nicholas Gibson
  • 306
  • 1
  • 3
  • 11

0 Answers0