使用自定义偏移打印图像

时间:2018-09-03 11:38:03

标签: ios swift

我想显示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)

0 个答案:

没有答案