gpt4 book ai didi

ios - 通过 AirPrint 打印为 PDF

转载 作者:行者123 更新时间:2023-11-29 03:55:28 24 4
gpt4 key购买 nike

我正在使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com