I have extract paragraphs in documents using bookmark options. But i need to skip or does not require for following kind of contents Title, Item-Info, Author Group, Affiliation, Section Headings, References.i have attached input and extracted output.
Thanks for your inquiry. Please use Paragraph.ParagraphFormat.StyleName property to get the name of the paragraph style applied to paragraph. If the paragraph has style name mentioned in your post, please do not add bookmark for them.
Thanks for your inquiry. Please use the following code example to get the desired output. If you want to highlight the text, please refer to the following article. How to Find and Highlight Text
Document doc = new Document(MyDir + "inp.docx");
doc.getRange().replace("(", "<skip>(", new FindReplaceOptions());
doc.getRange().replace(")", ")</skip>", new FindReplaceOptions());
doc.save(MyDir + "18.2.docx");
Thanks for your inquiry. In the bookmark(Document inputdoc) method, you can stop adding bookmark into document when the paragraph has text “References”. Please check the following code snippet.
for(Paragraph para : (Iterable) inputdoc.getChildNodes(NodeType.PARAGRAPH, true))
{
if (para.toString(SaveFormat.TEXT).trim() == “References”)
break;
Thanks for your inquiry. Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.