We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

List formatting in StructuredDocumentTag

Section srcSection=document.getSection();
for (Node srcNodeFinal : srcSection.getBody()){
DocumentParagraph documentParagraph = new DocumentParagraph();
if (srcNodeFinal.getNodeType() == NodeType.PARAGRAPH)
documentParagraph.setParagraph(((Paragraph) srcNodeFinal));
documentParagraph.setIsListItem(((Paragraph) srcNodeFinal).isListItem());
documentParagraph.setListLevelNumber(((Paragraph) srcNodeFinal).getListFormat().getListLevelNumber());
return documentParagraph;

Hi @tahir.manzoor,
I wand to do same as above for StructuredDocumentTag.

I have used the code given below:
else if(srcNodeFinal.getNodeType() == NodeType.STRUCTURED_DOCUMENT_TAG)
StructuredDocumentTag sdt = (StructuredDocumentTag)srcNodeFinal;
Run run = new Run(parsedDocument);
run.setText(sdt .getText());
Paragraph para = new Paragraph(parsedDocument);
documentParagraph.setText(sdt .getText());
return documentParagraph;

The above else if part of code is not working for me as expected. we want same behavior as paragraph when we are using StructuredDocumentTag. I have attached image for my input data.

Capture.PNG (10.9 KB)


To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a simple Java application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.