using spire.doc for Java, version 11.3 I found that when trying to appendHtml text in case of first paragraph, style "display: none" is not applied and the text inside paragraph is visible.
Then in next usage the style is really applied and the paragraph text is not visible.
Inserted html text:
- Code: Select all
<p style="display: none">Text that should not be visible</p>
<p>Text that should be visible<p>
<p style="display: none">Text that should not be visible and is not visible</p>
Code used to append htmlString to existing document is:
- Code: Select all
Section tempSection = document.addSection();
tempSection.addParagraph().appendHTML(htmlString);
TextBodySelection selection = new TextBodySelection(tempSection.getBody(), 0, tempSection.getBody().getChildObjects().getCount() - 1, 0, 0);
TextBodyPart bodyPart = new TextBodyPart(selection);
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
bookmarkNavigator.moveToBookmark(bookmarkName);
bookmarkNavigator.replaceBookmarkContent(bodyPart);