Page 5 of 6

How to do print currnt page when click on Print button.

Posted: Wed Apr 30, 2014 7:20 pm
by Asif

Hi Levgen,
Thanks for you help.
I have made changes in the id field and now i m not getting any error but when i click on the button to execute my code nothing is happening and i m getting this warning:
code
05-01 00:40:29.297: W/PluginManager(25023): THREAD WARNING: exec() call to Printer.print blocked the main thread for 45ms. Plugin should use CordovaInterface.getThreadPool().
05-01 00:40:39.427: D/webview(25023): blockWebkitViewMessage= false

/code


How to do print currnt page when click on Print button.

Posted: Wed Apr 30, 2014 8:44 pm
by Asif

I think it is working now
thanks a lot for your support..!!


How to do print currnt page when click on Print button.

Posted: Sat Jul 19, 2014 1:28 pm
by Asif

Hi,
I have tried the print plugin for giving print from the app but i got stuck after calling third party printing apps. So what i have thought that i will save my page content as an html file and then open it in app browser and then with normal window.print i'll take a print.

Please let me know if it is doable and how to do it..


How to do print currnt page when click on Print button.

Posted: Tue Jul 22, 2014 9:14 am
by Kateryna Grynko

Hi Asif,

This plug-in works with a third-party app that you specify when call print() (https://github.com/katzer/cordova-plu...). You can also use usual window.print() (https://developer.mozilla.org/en-US/d...) but note it works only in browser, not on device.


How to do print currnt page when click on Print button.

Posted: Tue Jul 22, 2014 11:49 am
by Asif

Hi Katya,
I know that this plugin works with the third party app. When i call print () from my app, it opens the third party app which i have specified but after that nothing happens. Some of the the app does not even open and it crashes my app also. Only one app opens successfully which is Bluetooth Smart Printing, but this app is also not scanning the printer, So finally i thought of not using this plugin.
Some app gives error as invalid intent or some says internal error.

Now what i am thinking is that i'll save my invoice as html page and open it in a new phone browser then with window.print() function i'll give a print.

If you have successfully used the plugin than please guide me with that otherwise let me know if the second option is doable or not.


How to do print currnt page when click on Print button.

Posted: Thu Jul 24, 2014 7:02 am
by Kateryna Grynko

Hi Asif,

Please try using another plug-in. You can also use Google cloud print.
http://stackoverflow.com/questions/19...
http://www.badrit.com/blog/2014/1/28/...


How to do print currnt page when click on Print button.

Posted: Sat Aug 02, 2014 11:52 am
by Asif

Hi Katya,
This plugin is almost same as the old one.

I have written a code to open my print content on a new page(browser)
pre
function printClick() {
var w = window.open();
var html = $("#ipadscreen1_mobilegrid_119").html();

// how do I write the html to the new window with JQuery?
$(w.document.body).html(html);

}
/pre

This code is working in browser but when i am doing it from the app, next window opens but the page is coming with following message
"The Web page at null might be temporarily down or it may have moved permanently to a new web address."


How to do print currnt page when click on Print button.

Posted: Mon Aug 04, 2014 6:29 pm
by Evgene Karachevtsev

Hello Asif,

Could you please try to use inAppBrowser for devices: http://devcenter.appery.io/tutorials/...


How to do print currnt page when click on Print button.

Posted: Mon Aug 04, 2014 7:22 pm
by Asif

Hi Evgene,
I thought of using inAppBrowser, but i need to pass a url to it, and in my case i have the html content not the url,
If you can show me an example of inAppBrowser with html content as input parameter then it would be a great help
thanks..!!


How to do print currnt page when click on Print button.

Posted: Thu Aug 07, 2014 8:45 am
by Maryna Brodina

Hello!

Sorry, we don't have example unfortunately. There is an error because you missed url parameter in request prewindow.open();/preHere is more information http://cordova.apache.org/docs/en/3.3...