- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在使用 UIPrintInteractionController 时遇到问题 我发送了一个 pdf 来打印,当我按下打印按钮将文件发送到打印机并工作时,我使用带有 ios 5 的设备发送了一个问题。但是当我在装有 ios 6 的设备上进行测试时,我无法正常工作并导致应用程序崩溃。
当 UIPrintInteractionController 的 View 出现在 ios 6 上时,这是日志:
Save\032in\032folder\032Aptana\032Rubles._ipp._tcp.local.:
Get-Printer-Attributes failed: Undefined error: 0
No document-format-supported attribute found or no supported formats
found.
No media-col-database found in response from printer.
Defaulting to generic media size values.
No print-quality-supported attribute found. Defaulting to normal
quality.
No sides-supported attribute found. Defaulting to single-sided.
这是我的代码:(self.myPDF 是一个 NMutableSData 类型)
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
if (controller && [UIPrintInteractionController canPrintData: self.myPDF] ) {
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = [NSString stringWithFormat:@"Coupon"];
printInfo.orientation = UIPrintInfoOrientationPortrait;
printInfo.duplex = UIPrintInfoDuplexLongEdge;
controller.printInfo = printInfo;
controller.showsPageRange =NO;
controller.printingItem = self.myPDF;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if (!completed && error) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Error."
message:[NSString stringWithFormat:NSLocalizedString(@"An error occured while printing: %@", @"Printing error"), error]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil];
[av show];
[av release];
}
};
[controller presentAnimated:YES completionHandler:completionHandler];
}
我没有支持 AirPrint 的打印机,但我使用了 handyPrint。注意:在 iOS 6 上,它可以使用 handyPrint 通过 safari 进行打印。
谁知道哪里出了问题? =(
最佳答案
使用 Xcode 附带的 AirPrint 打印机模拟器对其进行测试。这个问题很可能出在 handyPrint 不支持 AirPrint 的新功能上。
关于iphone - 使用 UIPrintInteractionController 打印 PDF ios 5 有效,但在 ios 6 中不起作用并使我的应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17218689/
这个问题刚刚出现在 iOS 13 中,之前不是问题。如果我展示 UIPrintInteractionController带有单个图像的 Controller ,一切正常。如果我提交多张图片,打印 Co
我正在尝试通过我的 iPad 应用程序打印从网络服务器中提取的 PDF 文档。该文档是横向的(通过预览证明),但 UiPrinterInteractionController 以纵向模式打印文档。 我
UIPrintInteractionController 语言为中文时只显示英文。 有什么建议吗? 最佳答案 在 xcode 中,选择您的项目,在项目信息选项卡中,转到 [Localizations]
我想知道是否有一种方法可以通过代码设置要打印的最小份数,因为我需要一份文档来重复打印。 我阅读了 Apple 开发者页面上的文档,但找不到任何内容。 我知道您可以从打印机对话框中设置份数,但我需要默认
我想编写一个应用程序来为 AirPrint 打印机(Brother QL-820NWB)提供打印功能。问题是,如果我在应用程序中显示 UIPrintInteractionController,则不会显
我想打印一些 PDF NSData,当我显示 UIPrintInteractionController 时PDF 显示正确,但文本和其他数据在 UITableViewCell 上的 UIPrintIn
我正在使用 UIPrintInteractionController 使用打印图像概念开发 iPhone 应用程序。我一直停留在一点,即 边框,每当我尝试使用打印机打印任何图像时,它总是在所有边上显示
当使用 UIPrintInteractionController 时, 关闭“页面范围”和“份数”选项很容易 UIPrintInteractionController *pic = [UI
我正在使用 UIPrintInteractionController 从 rect 中呈现它。 UIPrintInteractionController *controller = [UIPrintI
很直接... 现在我认为自己是一名经验丰富的 iOS 开发人员,但这似乎是 iOS 中一个明显的错误,除非我遗漏了一些东西。 请看下面的代码。 文件路径指向两个一页的 PDF。 显示的是一个没有要打印
UIPrintInteractionController (Swift) 最多可以执行多少次打印? 我目前正在为一个项目进行 AirPrint。想知道如何使用打印机模拟器进行批量打印的压力测试。 是否
我有一个以编程方式创建的 UIPrintInteractionController。它设置为从我的服务器中提取 pdf,并打印所述 pdf。我的问题是如何更改 View 的字体。我已经在我的应用程序委
编写了 UIPrintInteractionControllerDelegate 后,我希望在 printInteractionController:choosePaper: 中对其纸张选择功能进行单
我正在使用 UIPrintInteractionController presentAnimated 从 UIActionSheet 中的按钮显示打印对话框。 只要我触摸按钮,设备就会在约 10 秒内
有没有办法判断 UIPrintInteractionController 是否正在显示(可能类似于您检查弹出窗口的方式)? if ([popover isPopoverVisible]) {
我正在使用“UIPrintInteractionController”来打印一些文档。出于安全原因,不应启用其他共享选项。 但是在缩放“UIPrintInteractionController”中的内
我正在尝试像这样打印通过 NSURLConnection 下载的 pdf 文档 UIPrintInteractionController *pic = [UIPrintInteractionC
如何更改 UIPrintInteractionController 的导航栏标题(打印机选项)? 最佳答案 您可以使用 UIPrintInteractionController 的委托(delegat
苹果蓝与我的应用颜色不匹配,因此打印对话框非常不和谐。 在我的 iPhone 应用程序中,我可以使用以下 UIPrintInteractionControllerDelegate 代码获得正确的导航栏
我目前正在开发一个应用程序,通过 UIPrintInteractionController printToPrinter 方法使用直接打印,但是当我启动打印订单时,弹出窗口显示: Printing t
我是一名优秀的程序员,十分优秀!