【问题标题】:Print to PDF via AirPrint通过 AirPrint 打印为 PDF
【发布时间】:2013-05-15 09:21:32
【问题描述】:

我正在使用 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);
                                 }
                                 });

【问题讨论】:

标签: ios objective-c cordova


【解决方案1】:

如果您找到更好的答案,请告诉我,因为我正在寻找相同的解决方案。同时,我所做的是在新窗口中打开浏览器(一起跳过插件)并通过 pdfcrowd.com 运行 html 文档。然后我直接从浏览器使用airprint。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-27
    • 1970-01-01
    • 1970-01-01
    • 2016-05-29
    • 2011-06-14
    • 1970-01-01
    • 2015-08-05
    • 1970-01-01
    相关资源
    最近更新 更多