Hi, I have one image (sampleImage.png).. Already i connected my system to printer....
Manually i open the image and select print option , then i got image from printer....
Now i want print image using JavaScript....
i also write the code for print the text are content, the code is :
The script is :
The above script work for print the text area content into the printer....
So i reed to print the image into the printer...
help me about this..
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
In the future, please UseCodeTags. It's unnecessarily hard to read the code as it is, making it less likely that people will bother to do so. I have added those for you here.
Since you're successful printing arbitrary HTML, it should be possible to add an <img> tag instead of the contents of "textElem", no?
Thanks for your response.
But i don't need html tag.
i must use jsf tags only.
Also i want to write a javascript for support to jsf tags.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
But i don't need html tag.
I don't think I understand what you mean by this, but in any case it's much better to work with well-formed HTML (which contains all required tags) than with HTML that is not.
Also i want to write a javascript for support to jsf tags.
What do you mean by that? JSF is a server-side technology -while JavaScript works on the client- so how can JavaScript support JSF?
Robert Jack
Ranch Hand
Joined: Apr 13, 2010
Posts: 37
posted
0
I used <img> tag, i can receive image by JavaScript. i can get image location and image object...
The code is :
The Java script is :
And i also apply the same way in JSF tag, but i can't receive
The tag is :
And Java script is :
i used the following combination, but no response
Eswar Nec
Ranch Hand
Joined: May 02, 2010
Posts: 105
posted
0
Hi jack ,
This script perfectly worked in Firefox 3.0.18
Here no need to pass id.
But, i received image id using both h:form and h:graphicImage tag id's
The Java script is :
JSF code is :
Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar
Robert Jack
Ranch Hand
Joined: Apr 13, 2010
Posts: 37
posted
0
Its worked.
Thanks Eswar.
Robert Jack
Ranch Hand
Joined: Apr 13, 2010
Posts: 37
posted
0
I check it, and successfully printed.
But, the content is also open in pop winwow.
Because i use the script
Is there any possible to print the image, without open the popup winwow, and print the image.
Thanks in advance.
Muneeswaran Balasubramanian
Ranch Hand
Joined: Mar 19, 2010
Posts: 138
posted
0
Hi Jack,
Please try this instead of yours,I thinks its work fine.