It is currently Sun Nov 24, 2024 11:03 am
inputfilepath1 = HTML File contains following String
<table>
<tbody>
<tr>
<td>
<span>Serious Adverse Event</span>
</td>
</tr>
</tbody>
</table>
Body body = wordMLPackage.getMainDocumentPart().getJaxbElement().getBody();
XHTMLImporterImpl xHTMLImporter = new XHTMLImporterImpl(wordMLPackage);
wordMLPackage.getMainDocumentPart().getContent().addAll(xHTMLImporter.convert(new File(inputfilepath1), null));
System.out.println(XmlUtils.marshaltoString(wordMLPackage.getMainDocumentPart().getJaxbElement(), true,true));
File output1 = new java.io.File("C:\\html_table.docx");
wordMLPackage.save(output1);
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(wordMLPackage);
Docx4J.toFO(foSettings, byteArrayOutputStream, Docx4J.FLAX_EXPORT_PREFER_NONXSL);
Docx4J.toPDF(wordMLPackage, byteArrayOutputStream);
Total posts 10111 • Total topics 2842 • Total members 2074