• 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

how to print a word document in java?

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

is it possible in java to write a program that takes an input and sends it printer. I want this specially for word documents.
i already have a program that works for images but not for word documents.
Please guide me, where i am wrong or help me to get some links or code snippets regarding this. Any kind of help will be greatly appreciated.
I have done lot of RnD on this. Like HWPF and OpenOffice.org. But anything simpler is possible or not, i am surprised to find that such a simple thing is so tough in java. Please help.

//program that works for images but not for document is given below



[Nitesh: Added code tags, please UseCodeTags while posting code.]
[ November 01, 2008: Message edited by: Nitesh Kant ]
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy "wicked_yudi112233"!

Welcome to javaranch!
We being a very friendly community, do not have much rules but there is a naming policy that we are very strict about!
Unfortunately, your display name does not follow the policy. Please take a moment to change the same.

Also, this does not seem to be an advanced question, moving it to Java In General (Intermediate). You may get better answers there.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "an input" - an arbitrary file? .doc in particular is not a file format that is generally understood by printers. You will need a piece of software that understands .doc files and can render (and thus print) them.

Apache POI might help a bit if you use it to render a document into a Printable, but that will not work for complex documents, and would be quite a bit of programming effort on your part.

You might look into using OpenOffice as a server component for handling MS Office files. It does have a Java API.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic