- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Cordova 构建一个应用程序,并使用此插件来打印 HTML 页面的内容。我会尝试将其打印为 PDF,而不是使用 AirPrint 打印机。我该如何做到这一点(也可以通过修改插件文件夹中的 .m 和 .h 文件)?这是我使用过的插件:https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/PrintPlugin谢谢!
var html = document.getElementById("printHTML").innerHTML;
window.plugins.printPlugin.print(
html,
function(result) {
alert("Printing successful");
},
function(result) {
if (!result.available){
alert("Printing is not available");
}
else{
//Localised error description
alert(result.error);
}
});
最佳答案
如果您找到更好的答案,请告诉我,因为我正在寻找相同的解决方案。与此同时,我所做的是在新窗口中打开浏览器(一起跳过插件)并通过 pdfcrowd.com 运行 html 文档。然后我直接从浏览器使用airprint。
关于ios - 通过 AirPrint 打印为 PDF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16561265/
我向自定义 QLPreviewController 的 navigationItem 添加了一个操作按钮。当点击操作按钮时,我会呈现一个 UIPrintInteractionController。 我
我正在开发一个应用程序,需要能够在用户完成注册过程后打印出名称标签。它需要在不显示使用 UIPrintInteractionController 时自动创建的弹出窗口的情况下执行此操作。 我知道其他应
我正在制作一个应用程序,用户首先选择默认打印机,然后在单击“打印”按钮时继续,照片会自动打印,无需任何对话框。下面是我的代码。我收到错误消息“PrintViewController 没有初始化程序”
在我的应用程序中,可以打印不同尺寸的照片。这工作正常,但对于 iOS 8,即使打印对话框显示例如 5"x7",纸张大小始终为字母/A4。如果用户再次选择纸张尺寸,则纸张尺寸变为例如5"x7". 有没有
我已经在我的应用程序中实现了 AirPrinting,但我遇到了一个奇怪的问题。每当出现打印对话框时,都不会显示取消或完成/打印按钮,如下图所示。 我使用的代码如下: if ([UIPrintInte
我是否必须使用支持 Apple AirPrint 的打印机才能在我的 iPad 应用程序中使用 AirPrint? 我不能在 Mac 上设置共享 Bonjour 打印服务并连接到它吗? 最佳答案 您必
我想将 AirPrint 功能添加到我的 iPad 应用程序 我一直在尝试显示 Apple 的 Drawing and Printing Guide 中描述的打印机选项。 我有工具栏和UIBarBut
我有一个单例弹出窗口,因此我一次只显示一个弹出窗口。当我执行共享弹出窗口并选择 AirPrint 时,共享弹出窗口会正确消失,并在其位置显示 AirPrint 弹出窗口。 但是,如果我再次按下共享按钮
我有Posiflex打印机。据我所知,它没有启用 AirPrint。而且它也没有wifi。我需要做的是连接到打印机并使用我的 iPad (IOS 5) 中安装的支持 AirPrint 的应用程序打印输
我正在编写使用收据打印机将收据打印到连续纸卷上的代码。这些收据类似于您在商店使用信用卡付款时收到的收据。 我正在使用 UIMarkupTextPrintFormatter,您可以在下面的代码中看到。
我需要在没有用户交互的情况下在后台使用 Xcode 进行 AirPrint。我不在乎是否必须使用第 3 方框架来执行此操作。这是我的代码,但需要用户的交互。 NSMutableString *pri
我愿意在 iOS 中使用 AirPrint 从我的应用程序中导出一些 pdf 文件。然而,当我呈现 UIPrintInteractionController 时,它显示两个后退图标 <<。我附上了图像
我有点卡住了:-) 我有一个小应用程序,它允许我将地址簿中的字段放入标签类型 UIView 中。现在我希望能够打印出这些标签:-)如果它出现在一张普通的纸上,我现阶段不介意 - 我稍后会整理这部分内容
我的应用程序当前正在创建大小为 2480 3508 的图像(A4 页面)如何将此图像发送到 A4 页面上的 AirPrint?创建图像后,它会将其保存到照片应用程序中,我还想将其发送以进行打印。有任何
我可以选择在我的 iPhone 应用程序中进行打印。 按下“打印”按钮后,将显示 UIPrintInteractionController。问题是如果没有连接打印机,我想在按下打印按钮时显示警告。 我
我正在尝试在我的应用程序中实现 AirPrint。目前,我的代码是这样的: AirPrintingViewController.h #import @interface AirPrintingVie
我必须在横向模式下向我的 WebView 发送 Airprint。但是我在设置方向时遇到错误。我写了这段代码 let printcontroller = UIPrintInteractionC
我无法打印到我的打印机模拟器... 这是我所做的: 找到打印机模拟器 https://developer.apple.com/download/more/?=for%20Xcode 下载并安装 Add
我想显示一个列表,其中包含设备可通过 AirPrint 访问的所有打印机。 我使用 UIPrinterPickerController 让它工作。 是否有以自定义方式显示此 PickerControl
在我的 iOS 应用程序中,我有以下代码用于 AirPrinting 一个简单的 NSString。 #pragma mark - Print -(IBAction)print:(id)sender
我是一名优秀的程序员,十分优秀!