ForHosting KIT · Documents & PDF

Extract text from PDF pages

Two page texts, a quarterly report and its appendix, become one document with a clear --- PAGE BREAK --- marker between them, in the order you supplied and with nothing rewritten. Useful after a text reader or an OCR step. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon

Turn separate per-page PDF text blocks into one predictable document string without losing the boundaries between pages. Supply the text that has already been extracted from each page, in page order, and the capability joins those blocks with a clear page break marker. It performs no OCR and does not download or parse a PDF file. Instead, it handles the useful final assembly step for extraction pipelines that already produce one text block per page and need stable, searchable, or exportable output.

Prepare ordered page blocks

Send a pages array containing at least one object, and put the extracted text for each PDF page in that object’s text field. Array position defines page order: the first record is page one, the second record is page two, and so on. The capability does not sort pages, infer page numbers, or inspect a PDF binary, because doing so could silently change an order that the upstream extractor already established.

Each text value may contain headings, paragraphs, blank lines, Unicode characters, or an empty string when a real PDF page contains no extractable text. Empty page text is accepted and its position remains visible through the surrounding break markers. Every page entry must still be an object with a string text value; missing values, numbers, nested arrays, and other shapes are rejected clearly.

This strict record format prevents accidental coercion such as turning a missing block into the literal word undefined. For large documents, submit no more than ten thousand page blocks in one request.

Understand the joined result

The text field contains the original page strings in exactly the supplied order. Between every adjacent pair, the algorithm inserts two newlines, the marker --- PAGE BREAK ---, and two more newlines. It adds no marker before the first page or after the last one.

Aside from inserting delimiters, the algorithm does not trim, normalize, reflow, interpret, or rewrite page content. Leading spaces, trailing newlines, repeated blank lines, punctuation, and non-Latin scripts therefore remain as supplied. That behavior is intentional: an assembly step should preserve extracted evidence rather than make editorial decisions.

If you later want clean prose, run a separate normalization process whose transformations are explicit. If you want to split the combined result again, use the returned marker together with its surrounding newline sequence, while remembering that identical literal text could already exist inside a page.

Place it in a PDF extraction workflow

Use this capability after a PDF text-layer reader, OCR system, document parser, or upload pipeline has produced one text block per page. It is especially helpful when the next system expects a single string but reviewers, search tools, or citation logic still need visible page boundaries. A search-index ingestion job can concatenate pages before indexing while retaining markers that show where context crosses from one page to another.

An archival workflow can store one stable text representation beside the source document. A language-processing pipeline can pass the combined text onward without teaching every consumer how to traverse page arrays. The same input always produces the same output.

Remember that output quality depends entirely on the upstream extraction; scrambled columns, missing glyphs, or image-only pages must be corrected by the extractor or OCR stage.

Prepare text for search indexing

Combine page-level extraction results into one indexable string while retaining explicit boundaries for review and highlighting.

Assemble OCR page output

Join independently recognized pages after OCR so downstream summarization or classification receives one ordered document.

Create an archival text companion

Store a deterministic plain-text representation beside a PDF while keeping page transitions visible to future readers.

Does this capability read a PDF file?

No. It accepts text blocks that have already been extracted from individual PDF pages and performs the ordered assembly step.

Can a page contain an empty text string?

Yes. An empty string represents a page with no extracted text and remains in its original position between page boundaries.

What separates one page from the next in the result?

Two line breaks, the marker --- PAGE BREAK --- and two more line breaks. Nothing is added before the first page or after the last one, so the text starts and ends exactly as you supplied it.

Does it clean up spacing or line breaks in my text?

No. Leading spaces, trailing line breaks, repeated blank lines, punctuation and non-Latin scripts all stay as supplied. If you want clean prose, run a separate normalization step afterwards whose changes are explicit.

Can I split the combined text back into pages?

Yes, by cutting at the marker together with the line breaks around it. Keep in mind that the same literal text could already appear inside one of the pages, so check for that before relying on the split.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/extract-text

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/pdf/extract-text \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pages":[{"text":"Quarterly report\nRevenue increased by 12%."},{"text":"Appendix\nFigures are unaudited."}]}'
{
  "pages": [
    {
      "text": "Quarterly report\nRevenue increased by 12%."
    },
    {
      "text": "Appendix\nFigures are unaudited."
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.extract_text",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Understand the joined result

The response returns text, pages, and page_break_marker. The pages field reports how many blocks were joined, while page_break_marker makes the delimiter discoverable for downstream code.

Place it in a PDF extraction workflow

Processing is deterministic and local to the supplied JSON: there is no network request, random choice, current-time dependency, OCR operation, or PDF decoding. Requests cost $0.002 when automated, and the browser implementation can use the same pure assembly logic.

What marker is inserted between pages?

It inserts --- PAGE BREAK --- surrounded by two newlines on each side, and also returns the marker in page_break_marker.

What happens if I send no pages?

The request fails with an invalid_input error because at least one page block is required.

How much does a request cost?

Automated requests use the published base price of $0.002; there is no additional per-page price in this capability.

Read the full KIT documentation →