Page 1 of 1

convert doc to docx exception

PostPosted: Thu Jul 23, 2009 5:51 am
by dqkit
used org.docx4j.convert.in.Doc to convert an .doc to .docx file, I got an exception here:
Exception in thread "main" java.lang.IllegalArgumentException: The end (17060) must not be before the start (18871)
at org.apache.poi.hwpf.usermodel.Range.sanityCheckStartEnd(Range.java:247)
at org.apache.poi.hwpf.usermodel.Range.<init>(Range.java:181)
at org.apache.poi.hwpf.usermodel.Paragraph.<init>(Paragraph.java:103)
at org.apache.poi.hwpf.usermodel.Range.getParagraph(Range.java:830)
at org.apache.poi.hwpf.usermodel.Range.getTable(Range.java:870)
at org.docx4j.convert.in.Doc.convert(Doc.java:169)
at org.docx4j.convert.in.Doc.convert(Doc.java:61)
at test.TestDoc2Docx.main(TestDoc2Docx.java:14)

I've tried "b2xtranslator", but it's offline and using C#, are there any good ways to convert doc to docx ?
thanks,jason.

KitLiao

Re: convert doc to docx exception

PostPosted: Sat Jul 25, 2009 12:09 pm
by jason
I'd be interested to see how well b2xtranslator works for you. (Its on sourceforge, so you should be able to download it; if it works well, we could port it to java, and add it to docx4j; the licence was ok iirc).

Otherwise, you could try opening your document with POI, and if you still get the above error, report it there.

Re: convert doc to docx exception

PostPosted: Sun Jul 26, 2009 3:38 am
by dqkit
Thanks, jason.
I have tried yestoday, and it works well.
but, it's C# project. and you need to install .net framework. My project is a java project, and my envierament won't let me do that. any other ways ?
Thank you again. ;)