0

UIPrintInteractionController (Swift) 最多可以执行多少次打印?

我目前正在为一个项目做 AirPrint。想知道如何在使用打印机模拟器时进行批量打印的压力测试。

  • 有类似的代表printInteractionControllerIsPrintingJob吗?

  • 如何调试多个printing waiting in queue

  • 有没有办法自定义打印的警报视图?

干杯,

4

1 回答 1

0

从文档中:

1- var printingItems:[任何]?{ get set } 获取一组可打印的对象(NSURL、NSData、UIImage 或 ALAsset)。该文档没有引用任何限制,因此我们假设该限制将是您的体系结构中 unsigned int 的值。

2- 打印开始和结束有 2 种委托方法:打印作业的开始和结束

func printInteractionControllerWillStartJob(UIPrintInteractionController)
//Tells the delegate that the print job is about to start.
func printInteractionControllerDidFinishJob(UIPrintInteractionController)
//Tells the delegate that the print job has ended.

您可以使用它们来获取IsPrinting状态。(在第一和第二之间)。

3- 文档没有提供任何委托方法来让队列中的等待

4-您可以使用以下方式自定义警报:

printInfo UIPrintInfo: The aforementioned print job configuration.
printPaper UIPrintPaper: A simple type that describes the physical and printable size of a paper type; except for specialized applications, this will be handled for you by UIKit.
showsNumberOfCopies Bool: When true, lets the user choose the number of copies.
showsPageRange Bool: When true, lets the user choose a sub-range from the printed material. This only makes sense with multi-page content—it’s turned off by default for images.
showsPaperSelectionForLoadedPapers Bool: When this is true and the selected printer has multiple paper options, the UI will let the user choose which paper to print on.

关于使用 Swift 打印的一些详细解释,请参考以下链接: UIPrint​Interaction​Controller - Written by Nate Cook

如果这个回复有帮助并且有你需要的,请不要忘记验证它:)。

祝你的应用好运。

于 2016-10-06T15:15:24.980 回答