Swift: Use AirPrint and UIPrintInteractionController to print PostStamp onto an envelope

147 views Asked by At

I would like to print an image (post stamp) onto an envelope with AirPrint. It works with an "DIN A4" paper but not with "Envelope DL".

 @IBAction func printMenu(_ sender: Any) {
    
    let printController = UIPrintInteractionController.shared

    let printInfo = UIPrintInfo(dictionary: nil)
    printInfo.outputType = .general
    printInfo.orientation = .portrait
    printInfo.jobName = "myPrintJob"
    printController.printInfo = printInfo
 
    let paperSize :CGSize = CGSize(width: 831.49606299, height:  415.7480315)

    printController.printingItem = createIMG(paperSize: paperSize)
    
    printController.present(animated: true, completionHandler: nil)
}

Does anyone know a solution for that challenge? Can I choose the paperSize?

0

There are 0 answers