Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

Once 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic