Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Mar 11, 2022 1:55 am

Hi Team,

We need to extract image ,table shape from bullet point. Please let us know the solution.

if(paragraph.getListFormat() != null && paragraph.getListFormat().getCurrentListStyle() != null
&& paragraph.getListFormat().getListType().name().equals(LIST_TYPE_NUMBER) ||
//all list types
paragraph.getListFormat().getListType().name().equals(LIST_TYPE_BULLET)) {

//extract image ,table ,shapes
}



Many Thanks in advance

pr20080798
 
Posts: 146
Joined: Wed Jan 20, 2021 1:15 pm

Fri Mar 11, 2022 6:22 am

Hello,

Thanks for your inquiry.
You can refer to the below code to extract images, shapes from the paragraphs. But, we can't extract tables from paragraphs as table is not a childitem of paragraph.
Code: Select all
        for(Object obj:paragraph.getChildObjects()){
            //Get the pictures in the paragraph
            if(obj instanceof DocPicture){
                DocPicture picture= (DocPicture) obj;
                //Do what you want to do
            }
            //Get the shapes in the paragraph
            if(obj instanceof ShapeObject){
                //Group shapes
                if(obj instanceof ShapeGroup){
                    ShapeGroup shapeGroup= (ShapeGroup) obj;
                    //Do what you want to do
                }else{
                    ShapeObject shape= (ShapeObject) obj;
                    //Do what you want to do
                }

            }
        }
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.Doc