Open GoogleCodeExporter opened 9 years ago
> It looks like more a POI problem which expect an integer for
I agree with you Pascal, but perhaps we could try/catch this error?
@tulasi : please add your docx.
@pascal : it seems that xdocreport users cannot attach document in xdocreport
forum (size of attached document is not enough)
Original comment by angelo.z...@gmail.com
on 18 Nov 2014 at 8:41
Thanks for your reply.Can you please tell me how can i attach the document.
Original comment by tulasi.k...@gmail.com
on 25 Nov 2014 at 5:06
I asked again google to increase the quota but It takes time It seems.
As a workaround, can you please try posing your content on the mailing list ?
https://groups.google.com/forum/#!forum/xdocreport ?
Original comment by pascal.leclercq
on 25 Nov 2014 at 5:18
Hi tulasi,
Your problem is because your docx contains not valid integer.
If you unzip you docx and you see the word/document.xml you can see that page
margin, page size contains dot character :
---------------------------------------------------------------------
<w:sectPr>
<w:pgSz w:w="12240.0" w:orient="portrait" w:h="15840.0"/>
<w:pgMar w:right="1440.0" w:left="1440.0" w:top="1440.0" w:header="720.0" w:gutter="0" w:footer="720.0" w:bottom="1440.0"/>
</w:sectPr>
---------------------------------------------------------------------
For instance header is "720.0" altough it should have "720".
The problem coes from xmlbeans JavaIntegerHolder lex method
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.xmlbeans/xmlbeans/2.4
.0/org/apache/xmlbeans/impl/values/JavaIntegerHolder.java#46
To fix your problem, lex should remove the '.' like this :
---------------------------------------------------------------------
int index = s.indexOf( '.' );
if ( index != -1 )
{
s = s.substring( 0, index );
}
---------------------------------------------------------------------
So I suggest you that you post your problem to POI forum by attaching your docx
and explaining your problem.
Regard's Angelo
Original comment by angelo.z...@gmail.com
on 26 Nov 2014 at 9:28
Thanks for your reply.I am able to resolve the above exceptions with your
fix.But getting some other exceptions.
java.lang.ExceptionInInitializerError
at org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown Source)
at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:134)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:159)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:123)
at com.word.pdf.wordtopdf.createPDF(wordtopdf.java:62)
at com.word.pdf.wordtopdf.main(wordtopdf.java:20)
Caused by: java.lang.IllegalStateException: Cannot load getContextTypeLoader:
verify that xbean.jar is on the classpath
at org.apache.xmlbeans.XmlBeans.buildMethod(XmlBeans.java:181)
at org.apache.xmlbeans.XmlBeans.buildNoArgMethod(XmlBeans.java:190)
at org.apache.xmlbeans.XmlBeans.buildGetContextTypeLoaderMethod(XmlBeans.java:200)
at org.apache.xmlbeans.XmlBeans.<clinit>(XmlBeans.java:126)
... 6 more
Caused by: java.lang.ClassNotFoundException:
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:344)
at org.apache.xmlbeans.XmlBeans.buildMethod(XmlBeans.java:174)
... 9 more
Are you able to convert the provided docx to pdf.
Original comment by siva.kar...@gmail.com
on 26 Nov 2014 at 7:31
It's a problem with POI. Please post your question to POI forum.
Thank's
Original comment by angelo.z...@gmail.com
on 26 Nov 2014 at 8:20
Thanq so much for all your help.Can you please provide me POI forum link.I
didn't find proper link from google.
Original comment by tulasi.k...@gmail.com
on 27 Nov 2014 at 6:07
Original issue reported on code.google.com by
tulasi.k...@gmail.com
on 14 Nov 2014 at 8:53