How can we print an MS Word document from Java

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2004
Posts: 35
Reputation: tigerxx is an unknown quantity at this point 
Solved Threads: 0
tigerxx tigerxx is offline Offline
Light Poster

How can we print an MS Word document from Java

 
0
  #1
Dec 16th, 2004
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..
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 8
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

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

 
0
  #2
Dec 19th, 2004
Hi everyone,

You can't, trust me i have tried

Richard West
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 1
Reputation: pallavi_lodaya is an unknown quantity at this point 
Solved Threads: 0
pallavi_lodaya pallavi_lodaya is offline Offline
Newbie Poster

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

 
0
  #3
Jan 20th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

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

 
0
  #4
Jan 20th, 2005
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 16225 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC