How can I use a servlet to print a file on a printer attached to the client

64 views
Skip to first unread message

deltaaruna

unread,
Feb 29, 2012, 2:20:36 AM2/29/12
to Google Visualization API
Hi all,

I am using google image charts for a reporting app.
I am using imagecharts for that.
I successfully getting the url of the image chart using getImageUrl()
method.
I have passed this URL to a backend servelet. Now what I want is to
print this image in the client's printer.

How can I do it?
Please someone help me.

Regards
Aruna

Johanna Guerrero

unread,
Apr 13, 2012, 5:47:34 PM4/13/12
to Google Visualization API
I need help about this, too
Pls

On Feb 29, 2:20 am, deltaaruna <deltaar...@gmail.com> wrote:
> Hi all,
>
> I am using google image charts for a reporting app.
> I am using imagecharts for that.
> I successfully getting the url of the image chart using getImageUrl()
> method.
> I have passed this URL to a backend servelet. Now what I want is toprintthis image in the client's printer.

Jinji

unread,
Apr 16, 2012, 11:37:49 AM4/16/12
to google-visua...@googlegroups.com
Since you successfully got the image, sending it to browser print is not related to this forum, sorry.



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Peetzer

unread,
Apr 17, 2012, 2:05:29 AM4/17/12
to google-visua...@googlegroups.com
Hi,

This is not related to Google charts. You can try to make a pdf from the image (try itext), then embed print script in the pdf (AcroJs).
You only need to know the printer name (works also with network printers, use full path as shown in pdf reader) on the client. Note that for security reasons when printing automatically a confirmation pops up if you would like to print. You can bypass this by installing trusted print script on the client side (for example in C:\Program Files\Adobe\Reader 10.0\Reader\Javascripts).
It is not perfect but it gets the job done.

HTH,

Regards Peter

Ps, Adobe made fix in 10.1.3 for grey empty page problem in pdf with IE. It is wise to upgrade to this version.

Op woensdag 29 februari 2012 08:20:36 UTC+1 schreef M.W. Aruna Withanage het volgende:

Op woensdag 29 februari 2012 08:20:36 UTC+1 schreef M.W. Aruna Withanage het volgende:
Reply all
Reply to author
Forward
0 new messages