我想显示UIPrintInteractionController
以在纸张上打印具有自己大小和位置的图像,但是我尝试将UIViewPrintFormatter
设置为具有边缘插入物,并且图像从屏幕上丢失了
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.orientation = .portrait
printInfo.jobName = "Tracking"
printInfo.outputType = .photo
let printController = UIPrintInteractionController.shared
printController.delegate = self
printController.showsNumberOfCopies = true
printController.printingItem = self.docImage.image
let formatter = UIViewPrintFormatter()
formatter.perPageContentInsets = UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 20)
printController.printFormatter = formatter
printController.present(animated: true, completionHandler: nil)