ios - UIPrintInteractionController 无边框打印

标签 ios objective-c uiprintinteractioncntrler uiprintformatter

A3

我正在使用 UIPrintInteractionController 使用打印图像概念开发 iPhone 应用程序。我一直停留在一点,即 边框,每当我尝试使用打印机打印任何图像时,它总是在所有边上显示边框,这不是必需的。图像应该使用整个纸张尺寸,因为我给出的图像尺寸与纸张宽度和高度相同,但它仍然显示边框。

我没有找到任何去除边框或减少纸张内容边框的方法。查看 iPhone 图片 enter image description here enter image description here

您可以在附图中看到enter image description here ,在此我尝试从 Mac 系统打印图像,其中提供了边框和无边框选项。

我认为它应该在 UIPrintInteractionController framework 中,但没有找到任何人。

如果有人对此有经验,请帮助我。

提前致谢。您的帮助将不胜感激

[![A4][4]][4]

A3

最佳答案

如果你想消除任何边框,你可以通过将 photo outputType 传递给 printInfo 对象来快速实现:

let printController = UIPrintInteractionController.shared
printController.printingItem = someImage
printController.showsPaperSelectionForLoadedPapers = true

let printInfo             = UIPrintInfo.printInfo()
printInfo.outputType      = .photo
printController.printInfo = printInfo

enter image description here

现在,如果您想更好地控制最终渲染,您可以探索 Apple's sample project关于 UIPrintInteractionController

关于ios - UIPrintInteractionController 无边框打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46918375/

相关文章:

objective-c - 更改 NSMutableArray 中的 boolean 值

iphone - 通过 (id)sender 访问 UIButton

ios - 为什么 SLRequest 获取 Twitter 关注者会在 iOS 6.1 而不是 7.1 上崩溃

ios - 如何在快速延迟的情况下一一显示 subview

ios - 如何在Xcode,Swift中拖放枚举?

iphone - 如何在 iphone 中单击左侧 Controller 的 TableView 行更改中心 View ?(MFSideMenu)

ios - UISearchBar 显示错误 : text too far left, 与放大镜图标重叠

ios - UIPrintInteractionController 无法在 iPhone 中打印整页

swift - 如何调整正在打印的图像的大小?