PDF to RAG chunks with page numbers
John Wilkinson
Split a PDF into heading-aware chunks for RAG. Every chunk carries its start and end page and its heading path, so answers can cite the exact page and section. Set chunk size and overlap in tokens and load the JSON straight into a vector database.
Input
Output fields
Sign up on Apify or log in
The PDF to Markdown Converter: OCR, Tables, RAG Actor is ready to run with the inputs already set for "PDF to RAG chunks with page numbers". Sign up or log in and you'll land in Apify Console with a copy of this exact task.
Start the "PDF to RAG chunks with page numbers" task
The PDF to Markdown Converter: OCR, Tables, RAG Actor will start running based on the input automatically. You can also change all the input fields, like PDF URLs, outputs, and more, to match your specific use case.
Receive the "PDF to RAG chunks with page numbers" output
Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as source, status, title, and more.
Integrate into your workflow
The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also run the "PDF to RAG chunks with page numbers" task via API.

Each chunk from the PDF to RAG task has its text, start and end page, the heading path (such as 3 Model Architecture > 3.2 Attention), a character count and an approximate token count.
Use chunkSize and chunkOverlap in the PDF to RAG task. Both are approximate tokens, where one token is about 4 characters. The defaults are 512 and 64.
Yes. Set pageRange in the PDF to RAG task, for example 1-10 or 2,4,6-, and you only convert and pay for those pages.
Yes. The PDF to RAG chunks task runs from the Apify API, schedules and webhooks, and from n8n, Make or Zapier, and returns JSON, CSV or Excel.