• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can raw data be sent to a client printer from a JSP??

 
Dave Brooks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have serached high and low for a way to do this. I hope someone can help. Project dealine is here!!! I have a barcode printer that I need to send raw data to from my JSP. The file contains instructions for the printer on how to print the document. Using window.print() formats the file as text and I simply get what displays in the web browser. Security is not really an issue as the application is only going to be used over company intranet. Any help anyone could provide would be greatly appreciated. Thanks in advance.

Below is the type of data I need to send to the client printer


N
A300,100,0,3,2,2,R,"123-45467890"
A50,100,0,3,2,2,N,"PART : "
A300,200,0,3,2,2,R,"DEF"
A50,200,0,3,2,2,N,"SUB : "
A300,300,0,3,2,2,R,"9876543210"
A50,300,0,3,2,2,N,"RMA : "
B50,400,0,1,4,6,100,B,"9876543210"
P1
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP technology will be of no help to you. As you know, JSP executes on the server to format the HTML/Javascript page that is sent to the client. Once sent to the browser, all "JSP-ness" is gone. So if you can't do it with HTML/Javascript, you can't do it with JSP.

Problem is, window.print() will, as you have seen, print the page as renderred.

One possibilitiy, which I am not sure will work or not, is to load up the "raw data" in an invisible iframe embedded on the page, and use window.print on it from the parent.

If this does not work, perhaps an Applet approach might work, but I do not know if Applets have access to the print system of the client.

In any case, this isn't a JSP issue so I'm going to move this along to the HTML/Javascript forum for further investigation.
[ May 16, 2004: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!