How to index and store pdf file in elastic search using spring boot?

I believe this is a new one which will become available in the 7.7 version.
In the meantime you can use the GET document API and get the source with it.

See https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.x/java-rest-high-document-get.html#java-rest-high-document-get-response