AirPrint - 使份数默认为 2 而不仅仅是 1 份

AirPrint - Make number of copies default to 2 and not just 1 copy

当我使用 AirPrint 打开打印选项时,我想将其默认为 2 份,而不仅仅是 1 份。

找不到任何可以更改副本数的方法。想知道是否有人有任何想法是否可行,因为这个打印选项似乎非常有限。

所以我找到了自己的解决方案。基本上在 UIPrintInteraction Controller 下有一个名为 printItems 的方法。我所做的是制作一个 NSArray 并放置我想要打印的对象的两个副本,并使用该方法而不是 printItem

但是,由于我的应用程序使用了 printFormatter 我无法使用此方法,因为在 IOS 开发人员文档中它说 "If you set this property (printFormatter), UIPrintInteractionController sets the printingItems, printingItem, and printPageRenderer properties to nil. (Only one of these properties can be set for a print job.)"

所以我所做的只是将我正在格式化的 html 页面翻了一番,我相信格式是正确的,可以打印两页。

另一种方法是将相同的 printFormatter 添加到 printPageRenderer 中的第 1 页和第 2 页。