Docx4j v3 Docx to HTML with Images -


i'm working convert docx html using docx4j version 3.

the document contains white space consisting of tabs, spaces , newlines. resulting html either has unrecognized characters or not preserve whitespace @ all.

the java code i'm using is:

wordprocessingmlpackage wordmlpackage = docx4j.load(is);  htmlsettings htmlsettings = docx4j.createhtmlsettings(); htmlsettings.setimagedirpath( system.getproperty("user.dir") + uploadedimagesdirectory ); htmlsettings.setwmlpackage(wordmlpackage);  docx4j.tohtml(htmlsettings, out, docx4j.flag_export_prefer_xsl);  string result = ((bytearrayoutputstream)out).tostring(); 

how can preserve whitespace in document. also, there method apply css particular node? specifically, have 3 images should evenly spaced horizontally on page.

i've looked on documentation , searched online no success.

thank you.

i resolved issue , not related docx4j. docx4j parsed document perfectly! problem related sending output in email.

i set spring helper javamail mime encoding resolve issue:

mimemessagehelper message = new mimemessagehelper(mimemessage, true, "utf-8"); 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -