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.

Tue Mar 08, 2022 3:24 pm

Hi Team,

Please let me know how to extract image in the below mentioned scenario.

I have written code to extract image from the paragraph but due to bullet point in the beginning of paragraph I am not able to extract image

//mycode
if(paragraph.getText().equals("")) {
Iterable<DocumentObject> paraCollection = (Iterable<DocumentObject>) paragraph.getChildObjects();
for(DocumentObject childObj : paraCollection) {
//below condition is not matching because of bullet point
if(childObj.getDocumentObjectType().equals(DocumentObjectType.Picture)) {
}
}

How to avoid bullet points ,number list and hyphen symbols while extracting the image

I have attached screenshot for your reference

Thanks in advance

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

Wed Mar 09, 2022 8:50 am

Hello,

Thanks for your inquiry!
I simulated a word file and then extracted the pictures with the latest Spire.Doc for Java Version:5.2.3, but I didn't reproduce your problem. Please provide us with below more information for further investigation, thanks in advance.
1.You test input file.
2. Your system information (E.g. Win7, 64 bit) and region setting (E.g. China, Chinese);
3. The JDK version you used.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Doc