Pricing
from $3.00 / 1,000 page parseds
PDF to RAG Markdown Chunks for Embeddings
Convert PDFs into token-bounded Markdown chunks for RAG, embeddings, and vector databases (Pinecone, Chroma, Weaviate, Qdrant). Set maxTokens + overlap; get clean chunks with page number, token count, and SHA-256 content hash for dedup. JSON dataset ready for any LLM pipeline.
Pricing
from $3.00 / 1,000 page parseds
Rating
0.0
(0)
Developer
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
DocForge: PDF β AI-Ready Markdown Chunks for RAG
Turn PDF files you own into clean, deterministic, token-bounded text chunks β each tagged with the page it came from β ready for RAG pipelines and embeddings.
What it does
DocForge takes a list of PDF URLs that you own or are authorized to process, downloads each file, and extracts its text page by page. Each page's text is cleaned of the artifacts that normally wreck embeddings β words split by a hyphen at a line break, ligatures, control characters, and the runs of stray whitespace PDFs emit between columns β and then split into sentence-aware, token-bounded chunks. Each chunk is emitted as a structured dataset record carrying its source document, its true originating page number, a chunk index, an estimated token count, and a content hash. A final run summary reports how many pages were parsed and how many chunks were emitted.
The chunker is sentence-aware and overlap-aware: it packs whole sentences up to your target chunk size instead of cutting mid-sentence, carries a configurable overlap between consecutive chunks, and guarantees no chunk exceeds your configured maxTokens. Each chunk's text is emitted in the markdown field as clean extracted text, so it drops straight into a vector store or embedding job β and because every chunk knows its page, retrieved passages can cite the exact page they came from.
Before any work begins, DocForge requires an explicit ownership attestation. If that attestation is not set, the run is rejected with zero billing. Pages that contain no extractable text (e.g. scanned images) are skipped rather than emitted as blank chunks, and documents that fail to download or parse are caught, logged, and skipped rather than guessed at, so the dataset only contains content that was actually extracted.
Input
| Field | Type | Required | Description |
|---|---|---|---|
pdfUrls | array of strings | Yes | URLs of PDFs you own or are authorized to process. |
chunking | object | No | Chunking options. Prefilled with maxTokens: 512 and overlapTokens: 64. |
ownership_attestation | boolean | Yes | You confirm you own or are authorized to process these documents. Must be true or the run is rejected before any billing. |
The chunking object accepts:
maxTokens(default512) β the maximum estimated token size of each chunk; no chunk exceeds this.overlapTokens(default64) β how much each chunk overlaps the previous one, to preserve context across chunk boundaries.
Token counts are word-based estimates (approximately words Γ 1.3), not exact tokenizer counts.
Output
DocForge writes two record types to the dataset, distinguished by record_type.
chunk β one record per emitted text chunk:
| Field | Type | Description |
|---|---|---|
record_type | string | Always chunk. |
source_doc | string | The source PDF URL the chunk came from. |
page_number | integer | The 1-based page the chunk's text was extracted from. Use it to cite or filter retrieved passages by page. |
chunk_index | integer | Zero-based index of the chunk within its document (continuous across pages). |
markdown | string | The chunk's cleaned text (de-hyphenated, whitespace- and unicode-normalized). |
token_count | integer | Estimated token count for the chunk (never exceeds maxTokens). |
content_hash | string | Deterministic sha256:<64 hex> hash of the chunk text. |
run_summary β one record per run:
| Field | Type | Description |
|---|---|---|
record_type | string | Always run_summary. |
pages_parsed | integer | Total document pages parsed in the run. |
chunks_emitted | integer | Total chunks emitted in the run. |
Pricing
DocForge uses Apify Pay-Per-Event pricing. You are billed only for what a successful, gated run actually does:
| Event | Price (USD) | When it fires |
|---|---|---|
actor_run_start | $0.02 | Once per run, after the run's gates pass. |
page_parsed | $0.003 | Per document page converted to text. |
chunk_emitted | $0.0005 | Per RAG chunk emitted. |
Example run cost. Processing a single 40-page PDF that yields 120 chunks:
- 1 Γ
actor_run_start= $0.02 - 40 Γ
page_parsed= $0.12 - 120 Γ
chunk_emitted= $0.06 - Total β $0.20
If the ownership attestation is missing, the run is rejected with zero billing.
Why this Actor
- Page-accurate citations. Every chunk carries the real page it was extracted from, so retrieved passages can point back to the exact page β not a placeholder. (On a 14-page sample paper, that's 14 distinct page numbers across the chunks instead of one.)
- Clean text, not PDF soup. De-hyphenation reconnects words broken across line wraps (β150 fixes on a typical research PDF), ligatures and full-width characters are unicode-normalized, control characters are stripped, and runs of whitespace are collapsed β so your embeddings see real words, not
inter- national. - Sentence-aware chunking. Chunks are packed from whole sentences up to your
maxTokensinstead of being cut mid-sentence, with configurable overlap to preserve context across boundaries. No chunk ever exceedsmaxTokens. - Deterministic, idempotent output. Every chunk carries a
sha256:content hash computed directly from its text, so identical input produces identical hashes β ideal for deduplication, change detection, and re-run safety. - Ownership-gated by design. A required attestation must be
truebefore any processing or billing happens. DocForge runs on PDFs you provide and are authorized to use; it does not crawl or scrape third-party sites. - No invented content. Text is extracted deterministically with no LLM in the loop. Empty/scanned pages and documents that fail to fetch or parse are caught, logged, and skipped β they are not hallucinated or padded. The run summary reflects only what was genuinely parsed and emitted.
About this Actor
This Actor is AI-authored and operated under the publisher's LLC. It uses Actor.charge() strictly to bill the customer for the Pay-Per-Event units above; the Actor contains no payout or money-out capability. All claims here reflect behavior present in the Actor's code.
