• 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 wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Printing textual data from browser

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Ours is a web based (Struts, Spring, Hibernate) application.
In a particular use case, print-receipt; we pull up data from database and display it a new window ... followed by a javascriptLwindow.print()

To print the content.

But this prints the browser window - in graphic mode.

The target printer, attached to the browser machine is a Dot matrix printer; and consumes a lot off time to print a single window (because of the graphic nature)

Can the printing be done in text mode ?

thank you.
jeevan




 
Sheriff
Posts: 67754
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
You can either:
  • Use CSS to control what gets printed.
  • Instead of window.print(), have the link serve a PDF of just the data you want to print.
  •  
    Ranch Hand
    Posts: 147
    Eclipse IDE Tomcat Server Debian
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I don't know that JSP will offer you much in terms of client-side printing. However ...

    Depending on the Browser you are using, you may be able to take advantage of CSS to change the way the page prints.

    Here's a good starting point for CSS for print media - http://www.w3schools.com/css/css_mediatypes.asp
     
    Jeevan Sunkersett
    Ranch Hand
    Posts: 78
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    HI,

    for the benefit of everyone, this solution worked for me;

    http://www.codingforums.com/showthread.php?p=1125268

    ~jeevan
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic