SHARE
TWEET

Untitled

a guest Jun 20th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage(PageSizePaper.LETTER, false);
  2.  
  3. XHTMLImporterImpl XHTMLImporter = new XHTMLImporterImpl(wordMLPackage);
  4. XHTMLImporter.setRunFormatting(FormattingOption.CLASS_PLUS_OTHER);
  5. NumberingDefinitionsPart ndp = new NumberingDefinitionsPart();
  6.  
  7. wordMLPackage.getMainDocumentPart().addTargetPart(ndp);
  8. ndp.unmarshalDefaultNumbering();
  9.  
  10. wordMLPackage.getMainDocumentPart().getContent().addAll(XHTMLImporter.convert({STRING_OF_HTML_CONTENT}, null));
  11.  
  12. File exportFile = new File(somepath/sample.docx);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top