Forums Register Login

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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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 ]
It's exactly the same and completely different as this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1886 times.
Similar Threads
Printing API Question
JSP Printing
Help with HTTP I/O
Can raw data be sent to a client printer from a JSP??
Print raw bytes to thermal printer
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:26:07.