AnyConvert
← All docs

Extract Text with Coordinates

Send a PDF, get back every word's text and exact position as JSON. A real text layer is read exactly, character for character; outlined (CAD/P&ID) or scanned text is recognized, with a confidence score and source on every word — nothing is ever reported as certain unless it is.

See the Extract Text with Coordinates tool page, or the docs index for authentication, the shared request/webhook contract, and the generic error table.

Request

POST /webhooks/trigger — same endpoint and fields as every tool, with tool="extract-text" set explicitly (it's not the default).

curl
curl -X POST https://api.anyconvert.app/webhooks/trigger \
  -H "x-api-key: your_api_key_here" \
  -F "file=@drawing.pdf" \
  -F "fileId=document-001" \
  -F "referenceId=reference-001" \
  -F "tool=extract-text"

Options

An optional options multipart field carrying a JSON object, validated synchronously before a credit is charged — a bad value is rejected with 400, not charged and not queued. Every word always carries a conf (0 to 1) and a source (text-layer, vector-ocr, or raster-ocr) — text-layer words that pass the checks are conf 1.0, OCR never reports 1.0.

pagesstring, optionalDefault "all", or a 1-based list like "1-5,8". A page outside the document is invalid_options.
enginestring, optional"auto" (default, picks per page), "text-layer" (fails on pages without a text layer), or "ocr" (ignores the text layer).
granularitystring, optionalWhat the words array holds: "word" (default), "line", or "char" (text-layer pages only — invalid_options on an OCR page). Lines and blocks are always included regardless.
minConfidencenumber, optional0 to 1, default 0. Words below it move to a page's lowConfidence list — never silently deleted.
tagPatternsstring[], optionalUp to 20 regex patterns, 200 characters each. Used only to add a normalized suggestion and an ambiguous flag for characters OCR commonly confuses (I/1, O/0, V/v); the raw text is never changed.
coordinateSpacestring, optional"displayed" (default, points as the page is shown), "normalized" (0 to 1 of the displayed page), or "user" (PDF user space, bottom-left origin).
includeTextboolean, optionalDefault true — include each page's full text in reading order.
passwordstring, optionalTried only if the empty password fails.

Response

The webhook delivers a .json file (not a PDF): every page's class, quality summary, full text, and a words array with each word's text, bounding box, confidence, and source. A page with results below about 50 MB is delivered as plain JSON; larger results are gzip-compressed and delivered as .json.gz.

Pricing

Billed per page, not per document — 1 credit for every 10 pages, rounded up (a 45-page PDF costs 5 credits).

Failure reasons

Delivered via the webhook as outcome=failure with a reason below — see the docs index for the full delivery shape.

invalid_optionsA bad option, a page out of range, or an unsafe regex.
encrypted_fileThe PDF is password protected and the given password (if any) didn't open it.
no_extractable_textNo word was found on any selected page by any engine, or engine: "text-layer" hit a page with no text layer.
invalid_fileThe file could not be read, or was not the format this tool expects.
render_failedSomething failed during conversion that wasn’t a problem with the input itself.
timeoutThe job did not finish within its time budget.
internal_errorAn unexpected error on our side.
AnyConvert
A simple conversion API for teams that need documents turned into the right format, automatically.
Tools
PDF to WordMerge PDFJPG to PDFSign PDFEdit PDFCompress PDFExtract Text with CoordinatesView all tools →
Product
DocsPricing
Legal
Terms of ServicePrivacy PolicyRefund Policy
Support
support@anyconvert.app
© 2026 AnyConvert. All rights reserved.