0

I'm building an app using Cordova and I used this Plug-in to print the content of an HTML page. I would try to print this to a PDF, not using AirPrint printer. How can I do it (also by modifying .m and .h files in the Plugin Folder)? Here's the plugin I've used: https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/PrintPlugin Thank you!

 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);
                                 }
                                 });
4

1 回答 1

1

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

于 2013-07-09T17:03:50.470 回答