converting html to word
807589Jun 27 2008 — edited Jun 27 2008Hi,
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