Hi Team,
CSS style & format is not applied in word file, when we convert html file into word file using aspose word. Therefore, when we convert word file into pdf file. Then, in pdf file also css style & format is not applied.
Please find code snippet for html conversion to word file.
String bookmarkName="Glb_bkm_bp_disclosures";
Document discWordDoc= new Document(sampleHtmlPath);
org.jsoup.nodes.Document htmlDoc = Jsoup.parse(htmlFile, "UTF-8");
String htmlText = htmlDoc.outerHtml();
Bookmark bookmark = resultWordDoc.getRange().getBookmarks().get(bookmarkName);
if(bookmark != null) {
DocumentBuilder builder = new DocumentBuilder(resultWordDoc);
bookmark.setText("");
builder.moveToBookmark(bookmarkName, true, false);
builder.insertHtml(htmlText );
bookmark.remove();
}
Please find attached sample for your reference.
issue_with_word.zip (451.9 KB)