944,110 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 21435
  • Java RSS
Dec 16th, 2004
0

How can we print an MS Word document from Java

Expand Post »
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..
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
tigerxx is offline Offline
35 posts
since Sep 2004
Dec 19th, 2004
0

Re: How can we print an MS Word document from Java

Hi everyone,

You can't, trust me i have tried

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Jan 20th, 2005
0

Re: How can we print an MS Word document from Java

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pallavi_lodaya is offline Offline
1 posts
since Jan 2005
Jan 20th, 2005
0

Re: How can we print an MS Word document from Java

http://jakarta.apache.org and look for POI.
It's not perfect in that it doesn't understand all capabilities of MS Word but it understands pretty much all core capabilities.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: [MERGED]can anybody help me with this problem; snake game
Next Thread in Java Forum Timeline: Help in printing mulitple documents using print button





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC