Question: I found there are some library for extracting images from PDF or word, like docx2txt and pdfimages. But how can I get the content around the images (like there may be a title below the image)? Or get a page number of each image？

Some other tools like PyPDF2 and minecart can extract image page by page. However, I cannot run those code successfully.

Is there a good way to get some information of the images? (from the image got from docx2txt or pdfimages, or another way to extract image with info)

Answer: 
I believe you're on the wrong path here.

Spring dependency injection is wonderful, but that does not mean that you'll *never* find a call to `new` in a properly written Spring Boot app.

This is a case where calling `new` is the right thing to do. Every `Executor` in the pool should get its own instance of `Runnable`/`Callable` when it starts.

This is true for any method scoped variable: better to instantiate it in method scope and let the garbage collector clean it up when you exit the method. No reason for Spring to be responsible for the bean life cycle in that case.

You go too far when you try to share `Runnable` instances, especially if they have state.
Even as the question is closed, stumbled over another solution, which is - @Lookup, which meets the task:
entity:

```
@Component
@Scope("prototype")
public class Proto {
    private static int counter;
    public Proto() {
        System.out.println("count: "+counter++);
    }
}

```

service:

```
@Service
public class ProtoService {
    @Lookup
    public Proto getProto() {
        return null;
    }
}

```

and the test:

```
@Service
public class LookupWorks {
    @Autowired
    private ProtoService serv;

    @PostConstruct
    private void test() {
        System.out.println(">>>>>>>>>>>>>>");
        serv.getProto();
        serv.getProto();
        serv.getProto();
        serv.getProto();
        serv.getProto();
        System.out.println(">>>>>>>>>>>>>>");
    }

}

```

with the output:

```
>>>>>>>>>>>>>>
count: 0
count: 1
count: 2
count: 3
count: 4
>>>>>>>>>>>>>>

```