Barcodes
Reads the barcodes of a document or an image: QR, Data Matrix, PDF417, Aztec, Code 128, Code 39, EAN/UPC, ITF, DataBar...#
/lmkit/v1/barcode-readingFinds and decodes every barcode on the pages of a PDF, a multi-page TIFF or an image, with its format, its text and raw bytes, its position on the page (points for a PDF, pixels for an image) and its orientation. Deterministic image analysis: no AI model is involved. Restrict 'formats' to what you expect for speed and fewer false detections. If processing exceeds the configured timeout, returns 202 Accepted with a job_id; poll GET /lmkit/v1/jobs/. Returns 422 with an ErrorResponse when the file cannot be opened ('password_required', 'invalid_format'...).
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
inputrequired | string | The document or image to read: a PDF, an image (PNG, JPEG, BMP, WebP...) or a multi-page TIFF. When input_format is 'Base64EncodedFile', provide a base64-encoded payload. When 'FileIdentifier', provide the file ID returned by lmkit/v1/files/upload or by another endpoint. |
input_format | How the input is provided: 'Base64EncodedFile' (default) or 'FileIdentifier'. | |
page_range | string | The pages to read, 1-based ('1-5, 8'); absent, empty or '*' reads every page. |
formats | string[] | The formats to look for; empty looks for every readable format. Names are matched ignoring case and ' ', '-', '_' ('QRCode', 'qr code', 'EAN-13', 'DataMatrix'); a symbology or a group ('AllLinear', 'AllMatrix') covers its formats. Fewer formats read faster and avoid false detections. |
dpi | object (int32) | The resolution PDF pages are rendered at to be read (36-1200). Image pages are read at their own resolution. Default 200. |
reader | How the reader searches each page. | |
return_errors | boolean | Also return symbols that were located but failed to decode (is_valid false). Default false. |
max_symbols_per_page | object (int32) | Stop reading a page after this many symbols (0-255); 0 reads them all. Default 0. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 422 | Unprocessable Entity | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/barcode-reading" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "",
"input_format": "Base64EncodedFile",
"page_range": "string",
"formats": [
"string"
],
"dpi": 200
}'Splits a batch into documents by barcodes: separator sheets, first or last page markers, a value that changes, or a value shared by a document's pages.#
/lmkit/v1/barcode-splittingSplits a PDF, a multi-page TIFF or an image batch into its documents using the barcodes on its pages. 'mode' says what a barcode means: a separator page (removed or kept), a document's first or last page, a change of value, or a value shared by all the pages of a document (gathered even when apart). 'match' says which barcodes count (formats, values, pattern, page area, size); 'value_pattern' extracts each document's value (its label and file name). The blank back of a duplex separator and any blank page can be removed. Every scanned page is reported with its role, and barcodes the rule rejected are listed as ignored, so a rule can be tuned from a real batch. With split_documents true, each document is stored as a PDF (pages copied, never rasterized) or a TIFF and returned as a file_id to download or chain. Deterministic: no AI model is involved; for boundaries only the content reveals, use document-splitting. If processing exceeds the configured timeout, returns 202 Accepted with a job_id; poll GET /lmkit/v1/jobs/. Returns 422 with an ErrorResponse when the file cannot be opened.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
inputrequired | string | The batch to split: a PDF, a multi-page TIFF or an image. When input_format is 'Base64EncodedFile', provide a base64-encoded payload. When 'FileIdentifier', provide the file ID returned by lmkit/v1/files/upload or by another endpoint. |
input_format | How the input is provided: 'Base64EncodedFile' (default) or 'FileIdentifier'. | |
mode | What a matching barcode means. 'SeparatorPage' (default): the page stands between two documents. 'FirstPageOfDocument': it marks a document's first page, which stays in it. 'LastPageOfDocument': it marks a document's last page. 'ValueChange': a new document starts when the barcode value changes; pages without a barcode follow. 'GroupByValue': all pages with the same value form one document, even when apart. | |
separator_handling | What becomes of a separator page ('SeparatorPage' mode): 'Remove' (default), 'KeepAsFirstPage' of the document it opens, or 'KeepAsLastPage' of the document it closes. | |
leading_pages | What becomes of the pages no barcode accounts for (before the first barcode; after the last one in 'LastPageOfDocument' mode): 'KeepAsDocument' (default), 'Discard', or 'MergeIntoNearestDocument'. | |
match | Which barcodes count. Absent: every valid barcode. | |
value_pattern | string | A .NET regular expression that extracts a document's value from its barcode text: the group named 'value' when there is one, else the whole match; a text it does not match keeps its full text. The value labels the document, names its file and is the key of 'ValueChange' and 'GroupByValue'. |
remove_blank_page_after_separator | boolean | Remove a blank page right after a separator: the back of the separator sheet in a duplex scan. Default false. |
remove_blank_pages | boolean | Remove every blank page from the documents. Default false. |
blank_tolerance | object (int32) | Per-channel noise (0-255) under which a light, uniform page counts as blank. Default 10; use 0 for born-digital files. |
skip_empty_documents | boolean | Leave out documents left without a page (two separators in a row). Default true. |
pages_to_scan | string | The pages scanned for barcodes, 1-based ('1-20'); absent scans every page. Pages left out stay content. |
render_dpi | object (int32) | The resolution PDF pages are rendered at to be scanned (36-1200). Image pages are scanned at their own resolution. Default 200. |
reader | How the reader searches each page. | |
split_documents | boolean | When true, each document is written and stored on the server: its 'file_id' and 'file_name' are returned. When false (default), only the boundaries are returned. |
output_format | The format of the documents written: 'Pdf' (default; a PDF's pages are copied as they are, never rasterized), 'Tiff' (multi-page), or 'SameAsSource' (PDF for a PDF, TIFF for an image). | |
output_dpi | object (int32) | The resolution PDF pages are rendered at when written as TIFF (36-1200). Default 300. |
file_name_template | string | How written documents are named, without extension. Tokens: , ( pads it), , , , , . Default '_'. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 422 | Unprocessable Entity | |
| 500 | application/json | Internal Server Error |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/barcode-splitting" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "",
"input_format": "Base64EncodedFile",
"mode": 0,
"separator_handling": 0,
"leading_pages": 0
}'