I need to print an image with my application. I need a phonegap plugin for the same. It is just a command window.print() for browsers but I am not sure how its done for mobile applications. Any suggestions on that?
Is it possible if we have the printer configured on the device?
What’s possible is to implement the
SENDintent to share it with a printing application.EDIT (list of printing applications your app would “Share” with):
https://market.android.com/details?id=com.dynamixsoftware.printershare
https://market.android.com/details?id=com.hp.android.print
https://market.android.com/details?id=jp.co.canon.bsd.android.aepp.activity
just to name a few. That’s really the only reasonable way to expect people to print at the moment. Although with the introduction of Android’s USB Host support, in the future, Linux Printer drivers may make their way into Android and allow for Plug and Play Printing from MANY printers just by plugging in a USB.
At the very bare minimum you need:
in your manifest…which will at least make it show up in the ‘share’ listing.
How you send the data from the page you are displaying depends on what you want to export/print.
If it is an image you want to share, like you said:
http://sudarmuthu.com/blog/sharing-content-in-android-using-action_send-intent
will help. Basically for an image, it would look something like:
Hope that is a valid solution, much more complex than the browser’s
window.print()🙁Now, As far as PhoneGap:
Phonegap – Share functionality to Email, Twitter and Facebook
and
http://smus.com/android-phonegap-plugins
should help in understanding it’s use of sharing.
and
http://www.ryangillespie.com/downloads/SharePlugin.java
is an actual PhoneGap Plugin example for sharing.