How to do chunking of dataset before sending into index

I have a huge set of PDF documents, i am able to read them one after another. But each PDF files has 20-30 page, i want to break them into multiple document inside index, how can i do chunking in a easy way without using langchain or llamaindex kind of library.

Is there any better way in this ecosystem?