|
Hey All,
Is there any kind of APIs to convert Doc files to Txt files
please let me know
If possible send the Link to learn more
Thanx in Advance
Take care
Bye
|
|
|
The method you'd need to use, would be to read in the content of the .doc file, then convert it into an ANSI text format. Then output that to the new text document.
Problem is though, Microsoft keep very hush about their data formats; and I have not seen any existing Java API's that read in .doc formats, and parse them..
Sorry.
But if it's really important that you do this, then you may be able to find an existing DLL online, which parses the .doc format. You can then use JNI to implement this DLL with your Java program (although this will destroy the compatibilty of your java program).
An alternative solution, would be to get a dedicated machine, which loads the .doc file into Word. It then highlights the text, and copies it. It then outputs that copied data to a .txt file! ;-)
You could alternatively get this product: http://www.softinterface.com/Convert-Doc/Convert-Doc.htm
It has command line support, meaning that you can run it via your Java program secretly!! :-)
An example of running a command line application using Java, is here: http://www.javaalmanac.com/egs/java.lang/Exec.html
You can then capture the output like so: http://www.javaalmanac.com/egs/java.lang/ReadFromCommand.html?l=rel
Hope that helps.
Rob.
|
|
|
|
|
|
|
|
|
// |