• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

redirect output to printer

 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. I have a program that prints "Hello World" in java. I want to redirect the output to my printer (and not to the console). How do I do that?
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW, just to give you a background of the problem

My friend has a program written in FoxPro (remember?) that takes few inputs from the user, performs some calculations and formatting and prints a nice label on the invoice sheet (prints the calculated variables at a predefined x-y pos.)

something like:




I am trying to do the same using Java. Since my friend lives in a different geographical location and I dont know the exact x-y positions of where to print the variables, I took the following approach:



where format.bsh contains something like



I took this approach because I thought this would give my friend a good control over the format of the output variables (He can adjust them according to his needs).

Does this sound like a good approach?
[ January 30, 2007: Message edited by: Richard Green ]
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
or do you think Apache Velocity is a better fit (than BSH) for my requirements ?

or am i out of my mind and thinking in the wrong direction...
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any one?
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic