PDF to RAG Chunks: Page-Aware Text Extractor with Citations avatar

PDF to RAG Chunks: Page-Aware Text Extractor with Citations

Pricing

from $0.22 / 1,000 pdf pages

Go to Apify Store
PDF to RAG Chunks: Page-Aware Text Extractor with Citations

PDF to RAG Chunks: Page-Aware Text Extractor with Citations

Turn text PDFs into RAG chunks with page numbers, stable chunk IDs and SHA-256 hashes. Preflight mode counts pages before you pay per page. $0.25 per 1,000 pages; scanned PDFs need OCR Citation Chunker.

Pricing

from $0.22 / 1,000 pdf pages

Rating

0.0

(0)

Developer

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Cheapest on short PDFs, capped on long ones: $0.25 per 1,000 pages, and you never pay for more than 30 pages per PDF by default.

PDF to RAG Chunks: Page-Aware Text Extractor with Citations

Cheapest on short PDFs, capped on long ones: $0.25 per 1,000 pages, and you never pay for more than 30 pages per PDF by default.

For embedded-text PDFs, this Actor returns page-aware JSON chunks with the source page number, stable chunk IDs, SHA-256 hashes, and PDF metadata (title, author, creation date, modification date, page count). Supply a public HTTP(S) URL, a file upload, or base64 PDF bytes. Optional pageRanges (for example 1-5,8,10-12) select pages. maxPagesPerPdf defaults to 30: charging and chunk emission stop after that many useful pages in each PDF (you can set a custom cap).

It does not OCR scanned PDFs (use OCR Citation Chunker) or return bounding boxes. Failed input and failed downloads are never charged. If a URL download returns HTTP 403 or 429, the Actor retries once through Apify Proxy; a download that still fails is not charged.

Field per chunkWhy it matters for citations
source PDF page, page-local + document chunk indexcite "p. 12"
original + resolved URL or source label, PDF byte SHA-256, document IDprove which file
document title, author, creation/modification dates, page countcite the file itself
chunk text, char count, token estimatesize for embeddings
SHA-256 content hash, stable chunk ID, chunk configdedupe and re-run safely

The priced event is still page-processed at $0.25 per 1,000 pages on the Free tier ($0.00025/page). Tier prices per page: Free $0.00025 · Bronze $0.00024 · Silver $0.00023 · Gold/Platinum/Diamond $0.00022. Each run also has a tiny Apify Actor start charge of $0.00005 (one event per GB of memory, minimum one). Empty pages, rejected input, and failed downloads never add page-processed charges, and preflight runs pay only the start charge. Check the Actor Pricing tab before running because published rates can change.

Call it: REST skilled_glee~pdf-citation-chunker · MCP https://mcp.apify.com/?tools=skilled_glee/pdf-citation-chunker · Python/JS/LangChain examples: https://github.com/EchoEmpireUtility-bot/echoempire-apify-examples

First run in two steps

  1. Page count first (start charge only, $0.00005). Run with mode = preflight and a public embedded-text PDF (or a file upload / base64 PDF):
{
"mode": "preflight",
"url": "https://www.rfc-editor.org/rfc/rfc9457.pdf"
}

Preflight validates the PDF and reports its page count and the cap. It does not emit page-processed charges.

  1. Chunk the same PDF. Use the same source with mode = chunk. You are charged only for useful pages, and never for more than maxPagesPerPdf (default 30) useful pages in that PDF. Set a run spending limit (maxTotalChargeUsd) before you run so a misconfigured batch cannot overspend.

Ready-made Python, JavaScript, and LangChain scripts that stay dry-run by default and pass a spending cap: https://github.com/EchoEmpireUtility-bot/echoempire-apify-examples

Convert PDF documents into clean, page-aware, citation-ready JSON chunks for AI agents, RAG pipelines, search systems, APIs, and automated document workflows.

Machine contract

INPUT: A public HTTP(S) embedded-text PDF URL (or a batch of URLs), a file upload (pdfFile), or base64 PDF bytes (pdfBase64). Optional pageRanges and maxPagesPerPdf (default 30).

OUTPUT: Deterministic, page-aware, citation-ready JSON chunks with stable document/chunk IDs, SHA-256 hashes, provenance, and PDF metadata.

USE WHEN: Preparing embedded-text PDFs for RAG, retrieval, vector ingestion, citation-grounded AI, APIs, MCP, or other machine processing.

DO NOT USE WHEN: The PDF is scanned or image-only and requires OCR.

FAILURE MODEL: One bad PDF does not destroy useful output from the rest of a batch. Failed input and failed downloads (including 403/429 after a proxy retry) are not charged.

CURRENT BILLING: Pay Per Event with a single event, page-processed, still $0.25 per 1,000 pages on the Free tier, plus the standard Actor start event at $0.00005 per run (per GB of memory, minimum one). The Actor stops charging and stops emitting chunks after maxPagesPerPdf useful pages in each PDF (default 30; a custom cap is honoured). page-processed is charged only after a page produces useful text chunks; empty/no-text pages, failed documents, rejected input, failed downloads, and preflight runs are not charged. Check the Actor Pricing section before running because published rates can change.

What it does

For every extracted chunk, the Actor returns:

  • Original PDF URL
  • Resolved PDF URL after redirects
  • Downloaded PDF byte size
  • PDF-byte SHA-256 and stable document ID
  • Document position within the batch
  • Document title, author, creation date, modification date, and page count
  • Source PDF page
  • Document-wide chunk index
  • Page-local chunk index
  • Normalized text
  • Character count
  • Estimated token count
  • SHA-256 content hash
  • Stable chunk ID and chunking configuration
  • Extraction method
  • Processing timestamp

The result is structured for machine consumption rather than manual copy-and-paste.

Typical uses include:

  • Retrieval-Augmented Generation (RAG)
  • Vector database ingestion
  • AI-agent document analysis
  • Citation-aware retrieval
  • Search indexing
  • Document pipelines
  • Knowledge-base ingestion
  • Archival and research workflows
  • MCP and API-based automation

Input

Single PDF

{
"mode": "chunk",
"url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"chunkSize": 1000,
"overlap": 100
}

Multiple PDFs

Up to 25 PDFs can be submitted in a single run:

{
"urls": [
"https://example.com/document-1.pdf",
"https://example.com/document-2.pdf"
],
"chunkSize": 3000,
"overlap": 300
}

You may use url, urls, a file upload (pdfFile), base64 bytes (pdfBase64), or a combination, up to 25 documents per run.

File upload or base64

{
"mode": "chunk",
"pdfFile": "https://api.apify.com/v2/key-value-stores/<id>/records/document.pdf",
"maxPagesPerPdf": 30
}
{
"mode": "chunk",
"pdfBase64": "<base64-encoded PDF bytes>",
"pageRanges": "1-5,8,10-12",
"maxPagesPerPdf": 10
}

pageRanges is a 1-based list such as 1-5,8,10-12. Invalid syntax fails the run and is not charged. maxPagesPerPdf defaults to 30 useful pages per PDF; a custom cap is honoured. Empty pages are not charged and do not consume the cap.

If a URL download returns HTTP 403 or 429, the Actor retries once through Apify Proxy. Failed downloads are not charged.

Preflight mode (page count only, not charged)

Set "mode": "preflight" to download each PDF and count its pages without extracting text or producing chunks:

{
"mode": "preflight",
"urls": ["https://example.com/document-1.pdf"]
}

Preflight writes no dataset records and charges no page-processed events. The SUMMARY record contains mode: "preflight", status (succeeded only when every URL was readable as a PDF of at most 50 MB, otherwise failed), submittedDocuments, totalPages, and per-document outcomes (inputUrl, status: "quoted", totalPages, or status: "failed"). A failed preflight ends the run with a failed status. Preflight only checks that the bytes are a PDF and counts pages; it does not check whether pages contain embedded text, so a scanned PDF can pass preflight and still return no_extractable_text in chunk mode.

Duplicate URLs are automatically removed while preserving their original order.

Chunking

chunkSize controls the approximate maximum number of characters in each output chunk.

Default:

3000 characters

Allowed range:

500 - 20000

overlap controls how much text is carried from one chunk into the next.

Default:

300 characters

Overlap helps preserve context across chunk boundaries when the output is used for embeddings, retrieval, or language-model processing.

Chunks remain page-aware. PDF page provenance is preserved for every result.

Output

Each chunk is stored as a structured dataset record.

Example:

{
"sourceUrl": "https://example.com/document.pdf",
"resolvedUrl": "https://cdn.example.com/document.pdf",
"sourceByteSize": 482193,
"documentSha256": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
"documentId": "sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
"documentIndex": 1,
"documentTitle": "Example Document",
"documentAuthor": "Ada Lovelace",
"documentCreationDate": "2026-01-01T12:00:00+00:00",
"documentModificationDate": "2026-01-02T12:00:00+00:00",
"pageCount": 12,
"sourceType": "url",
"pageStart": 4,
"pageEnd": 4,
"chunkIndex": 7,
"pageChunkIndex": 2,
"chunkId": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"chunking": {
"chunkSize": 3000,
"overlap": 300
},
"text": "Extracted document text...",
"characterCount": 2874,
"estimatedTokens": 719,
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"extractionMethod": "pypdf",
"processedAt": "2026-08-25T00:00:00+00:00"
}

Run summary

Each run also generates a machine-readable SUMMARY record containing:

  • Submitted document count
  • Completed document count
  • Successful document count
  • Failed document count
  • Total pages extracted
  • Total chunks produced
  • Chunk-size setting
  • Overlap setting
  • Overall run status
  • Per-document outcomes (inputUrl, status, pagesProcessed, chunksProduced, and an unsuccessful reason when applicable)
  • URLs not processed because a spending limit stopped the batch
  • Processing timestamp

Example:

{
"submittedDocuments": 3,
"completedDocuments": 3,
"successfulDocuments": 2,
"failedDocuments": 1,
"totalPages": 49,
"totalChunks": 121,
"chunkSize": 1200,
"overlap": 150,
"status": "partial_success",
"documentOutcomes": [
{
"inputUrl": "https://example.com/valid.pdf",
"status": "success",
"pagesProcessed": 49,
"chunksProduced": 121
},
{
"inputUrl": "https://example.com/scanned.pdf",
"status": "failed",
"reason": "no_extractable_text",
"pagesProcessed": 0,
"chunksProduced": 0
}
],
"unprocessedUrls": [],
"processedAt": "2026-08-25T00:00:00+00:00"
}

Partial failure handling

One bad PDF does not automatically destroy an entire batch.

If a document:

  • Returns an HTTP error
  • Is inaccessible
  • Is malformed
  • Is not actually a PDF
  • Cannot be processed

the Actor records a machine-readable document outcome and continues with the remaining documents.

A batch is success only when every submitted document produces useful chunks. It is partial_success when useful output survives one or more failed documents, and failed when no document produces useful chunks.

If a user spending limit stops the batch, the summary status is spending_limit_reached. It includes completed document outcomes and unprocessedUrls for the URLs skipped because of that limit.

This makes the Actor suitable for autonomous pipelines where partial results are more useful than losing an entire batch because of one invalid source.

PDF limitations

The current version extracts embedded PDF text.

Image-only or scanned PDFs without an embedded text layer produce a failed document outcome with reason no_extractable_text; they are not counted as successfully processed.

OCR is not currently performed.

Other current limitations:

  • Maximum PDF size: 50 MB per document
  • Maximum batch size: 25 PDFs
  • Password-protected PDFs may fail
  • Corrupted PDFs may fail
  • Private URLs requiring unsupported authentication may fail

OCR and additional document formats may be added in future versions.

Integrity metadata

Every chunk includes a SHA-256 hash calculated from the exact normalized chunk text.

documentSha256 is the SHA-256 digest of the original downloaded PDF bytes. documentId is sha256:<documentSha256>, so it is stable for the same PDF regardless of input order or processing time.

chunkId is a SHA-256 digest of a canonical JSON object containing the version string pdf-citation-chunker:chunk:v1, documentSha256, page number, page-local chunk index, chunk text SHA-256, chunkSize, and overlap. It is stable for the same emitted chunk and changes when its document, page-local position, content, or chunking configuration changes.

sourceUrl preserves the submitted URL; resolvedUrl records the final HTTP response URL after redirects when available; sourceByteSize records downloaded PDF bytes; and chunking records the chunkSize and overlap used for that record. Together these fields support provenance, deduplication, and idempotent ingestion without relying on batch order or timestamps.

This allows downstream systems to:

  • Detect duplicate chunks
  • Verify content stability
  • Build deterministic caches
  • Track document changes
  • Identify repeated data across runs

Token estimates

Each result includes an approximate token count.

The estimate is intended for planning downstream LLM and embedding workloads. It is not tied to any specific model tokenizer and should not be treated as an exact billing value.

API and automation

Because PDF Citation Chunker runs as an Apify Actor, it can be invoked through:

  • Apify Console
  • Apify API
  • Other Actors
  • Automated workflows
  • Schedules
  • Webhooks
  • External applications
  • Agentic workflows
  • Machine-to-machine systems

The resulting citation chunks are stored in the default Apify dataset and can be retrieved programmatically.

For AI agents and MCP

Contract: public embedded-text PDF URL → deterministic, page-aware citation-ready JSON chunks.

Use this Actor for PDF chunking, RAG ingestion, citation chunks, page provenance, and stable RAG chunk IDs. For scans or image-only PDFs, use OCR Citation Chunker instead.

Read-only discovery for agents

For discovery only, configure an MCP client with:

https://mcp.apify.com?tools=search-actors,fetch-actor-details

Search for skilled_glee/pdf-citation-chunker, then inspect its current input schema and pricing. These discovery tools do not run the Actor. Running Actors and reading their storage require authentication and can incur charges. Keep credentials in the client's secure configuration, never in a prompt or URL. Before execution, verify an approved maximum charge is supported and enforced by the actual client/tool interface; a requested limit in prose is not enforcement.

The single-PDF example above is input, not an execution command or authorization. The multi-PDF examples below/elsewhere use placeholders that must be replaced with public PDFs you are authorized to process.

Official Apify MCP connection and tool documentation

This integration guidance is maintained with automated tooling. No customer endorsement, guaranteed outcome, or measured conversion improvement is implied.

Designed for machine consumption

The Actor intentionally favors predictable JSON over human-oriented document formatting.

A typical pipeline may look like:

PDF URL
↓
PDF Citation Chunker
↓
page-aware JSON chunks
↓
embedding model
↓
vector database
↓
RAG / AI agent / search system

The Actor can also be used as a preprocessing primitive inside larger automated systems.

Privacy and responsible use

Only process documents you are authorized to access and process.

The Actor operates on URLs, uploaded files, or base64 PDFs provided as run input and stores extracted results in the run's Apify storage.

Avoid submitting confidential or sensitive documents unless your Apify environment and intended workflow are appropriate for that data.

Current capabilities

Version 0.2.x includes:

  • Single-PDF and multi-PDF batch processing (up to 25 PDFs per run)
  • URL, file-upload, and base64 PDF input
  • Optional page ranges (1-5,8,10-12)
  • Default 30 useful-page cap per PDF (maxPagesPerPdf; custom caps honoured)
  • Embedded-text extraction (no OCR)
  • Page-aware chunking with configurable size and overlap
  • PDF provenance plus author, creation date, modification date, and page count
  • SHA-256 chunk hashes and stable IDs
  • Estimated token counts
  • HTTP 403/429 download retry through Apify Proxy (failed downloads are not charged)
  • Partial-failure isolation
  • Machine-readable run summaries
  • Pay-per-event billing (one page-processed event per useful page, no start event, capped per PDF)
  • preflight page-count mode (no page-processed charge)
  • Spending-limit awareness
  • API-ready structured output

Output philosophy

PDF Citation Chunker does one job:

Turn a PDF into predictable, provenance-preserving chunks that another machine can immediately use.

No AI-generated summaries are inserted into the document.

No interpretation is performed.

No source text is intentionally rewritten.

The Actor focuses on creating a reliable document-processing primitive that can be composed with other systems.