LM-Kit OneDocs2026.10.6lm-kit.comEULA
Document Utilities

Document to PDF

Renders a Word document, an e-mail, an HTML, Markdown or text file, or an image as a PDF.#

POST/lmkit/v1/document-to-pdf

Gives a document without pages of its own a PDF the page tools can act on (pdf-redact, pdf-search, pdf-layout). A Word document (.docx) and the text formats are rendered through their Markdown reading; an e-mail (.eml, Outlook .msg) is rendered with its headers and body, its attachments embedded in the PDF as files; an image becomes one page per frame; a PDF passes through unchanged. 'source_format' names the input; omitted, it is read from the content and the stored file name. The PDF is stored on the server and its 'file_id' returned. Involves no AI model. Returns 400 with error 'unsupported_format' for any other input. 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 document. When input_format is 'Base64EncodedFile', provide a base64-encoded payload. When 'FileIdentifier', provide the file ID previously returned by the lmkit/v1/files/upload endpoint.

input_format

How the input is provided: 'Base64EncodedFile' or 'FileIdentifier'. Defaults to 'Base64EncodedFile'.

source_formatstring

What the input is: 'docx', 'eml', 'msg', 'html', 'md', 'txt', 'pdf' or 'image'. Omit to read it from the content (a PDF, a ZIP package holding a Word document, an Outlook message, an image) and the stored file name.

strip_quotesboolean

For an e-mail: drops the quoted earlier messages of a reply. Default: false.

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/document-to-pdf" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "",
  "input_format": "Base64EncodedFile",
  "source_format": "string",
  "strip_quotes": false
}'