I am trying to print excel file and word document to printer, but I don't know how to do it in Java.
Can anyone please help me and provide the code example?
I am trying to print excel file and word document to printer, but I don't know how to do it in Java.
Can anyone please help me and provide the code example?
I found that if you seeking for source code, surely someone would vote you down. What you need should be an idea, or some hint to the solution only.
For printing Office documents from java, One way is to call .NET from java, but this one is very slow and if you want to integrate the source code, you need a bridge. If you want to write serious projects, this method seems too weak.
Another way is to use the Apache POI, as indicated by Nicholas. But POI also have some problem render Office documents. The positive sides is that it can be stable compared with calling .NET
For the java desktop way, seeing from java API, it seems to leave the solution to your OS. I am not sure about it. You can try it.
Anyway it is not a good way to print Microsoft things from Java, same applies to print PDF documents from .NET or other Microsoft things. Sigh!
Apache POI is one of the more useful libraries for doing MS Word on java.
And Java already has a printing library