0

HI,

How can we print an MS Word document from Java ???
We can print .txt files, but while printing .doc, it gives junk chars in print out when we set
DocFlavor docFlavor = DocFlavor.INPUT_STREAM.AUTOSENSE;

I tried,
1.DocFlavor docFlavor = new DocFlavor("application/msword", "java.io.InputStream");

2. DocFlavor docFlavor = new DocFlavor("application/vnd.ms-word", "java.io.InputStream");

and got PrintJobFlavorException

It would be helpful if any one could help me out..

Thanks in advance..

4
Contributors
3
Replies
5
Views
12 Years
Discussion Span
Last Post by jwenting
0

Hi,

Even We have some requirement to print the Word document from JAVA. How can we achieve that?

One way we thought is to convert word to pdf and then pdf to ps to print the document.
Can anyone suggest some other solution or how to convert word to pdf from JAVA

Thanks in advance.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.