Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

converting html to word

807589Jun 27 2008 — edited Jun 27 2008
Hi,
I was trying to convert html file to doc file. I have written a simple code. The problem is that it gives incorrect allignment when there is image on html file along with text.

Again it cannot load a html file sometimes showing the following error.

java.io.FileNotFoundException: F:\b.html (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at pdftoword1.pdftoword1.main(pdftoword1.java:82)
Exception in thread "main" java.lang.NullPointerException
at pdftoword1.pdftoword1.main(pdftoword1.java:90)
Java Result: 1


Can you please tell me where is the problem and what should i do to get correct allignment?

my code:

FileInputStream fileinstream = null;
FileOutputStream fileoutstream = null;
byte[] b=new byte[200000];

File infile = new File("F:/b.html");
File outfile = new File("F:/a.doc");
fileinstream = new FileInputStream(infile);
fileoutstream = new FileOutputStream(outfile);
fileinstream.read(b);
fileoutstream.write(b);

Thanks
chintito
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2008
Added on Jun 27 2008
5 comments
247 views