LM-Kit OneDocs2026.8.10lm-kit.com
Document Utilities

PDF Layout Analysis

Analyzes the physical layout of a PDF document.#

POST/lmkit/v1/pdf-layout

Detects paragraphs, lines, and their bounding boxes within each page of a PDF document. Returns a structured JSON map of the document's physical layout including text direction, word counts, and precise coordinates in points. This is a pure document processing operation that does not require an AI model. If processing exceeds the configured timeout, returns 202 Accepted with a job_id. Poll GET /lmkit/v1/jobs/ for status and results.

Request body

application/json ·

PropertyTypeDescription
inputrequiredstring

The input PDF document to analyze. When input_format is 'Base64EncodedFile', provide a base64-encoded PDF payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.

input_format

How the input is provided. Accepted values: 'Base64EncodedFile' or 'FileIdentifier'. 'Base64EncodedFile' expects a base64-encoded PDF file. 'FileIdentifier' references a file previously uploaded via lmkit/v1/files/upload. Defaults to 'Base64EncodedFile'.

pagesstring

An optional page range to analyze (e.g. "1-3", "1,3,5", "2-"). When empty or not specified, all pages are analyzed. Page numbers are 1-based.

Responses

StatusTypeDescription
200

OK

202

Accepted

400

Bad Request

404

Not Found

500application/json

Internal Server Error

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/pdf-layout" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "",
  "input_format": "Base64EncodedFile",
  "pages": ""
}'