Page 1 of 1

weird behaviour for text

PostPosted: Thu Feb 21, 2013 3:41 am
by mmoselhy
Hi Jason,

when I converted a word document by the sample code I get strange behavior

The text
"Design Specification" with Heading 1 style
is converted to be
" org.docx4j.wml.P ""
org.docx4j.wml.CTBookmark ""
org.docx4j.wml.CTMarkupRange ""
org.docx4j.wml.R ""
org.docx4j.wml.Text "Design"
org.docx4j.wml.R ""
org.docx4j.wml.Text " Specification"
org.docx4j.wml.P ""
org.docx4j.wml.P ""
org.docx4j.wml.R """

Why it is splitted like that while it should be at the same line without the org.docx4j.wml.R object between the two words??

Re: weird behaviour for text

PostPosted: Thu Feb 21, 2013 7:40 am
by jason
docx4j gives you exactly what it finds in the document.xml part (unzip your docx to have a look). What you see on the document surface in the Word (or for that matter, LibreOffice/OpenOffice) GUI, may be simpler than what that program actually creates at the XML level.

If you were creating the content in docx4j, you'd likely do it as you describe.