It is currently Thu Dec 26, 2024 12:31 am
WordprocessingMLPackage wordMLPackage = Docx4J.load(new File(myTemplate));
TocGenerator tocGenerator = new TocGenerator(wordMLPackage);
tocGenerator.updateToc(false);
public static void addAltChunk(R run, String html){
String chunk = "<!DOCTYPE><html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"><head></head><body>" + html + "</body></html>";
try {
mdp.addAltChunk(AltChunkType.Xhtml, chunk.getBytes(), run);
} catch (Exception e) {
e.printStackTrace();
}
}
Total posts 10113 • Total topics 2844 • Total members 2075