ocr
case.dev OCR
Production-grade document OCR with table extraction and word-level positional data. Processes PDFs and images (PNG, JPG, TIFF, BMP, WEBP) up to 500MB.
Requires the casedev CLI. See setup skill for installation and auth.
Process a Document
Submit a document URL for OCR:
casedev ocr process --document-url "https://example.com/contract.pdf" --json
Flags:
--document-url/--url(required) — publicly accessible URL or presigned vault URL--document-id— optional identifier to tag the job--engine— OCR engine override
Returns a job ID and initial status.
Check Job Status
casedev ocr status JOB_ID --json
Returns: ID, status, page count, created/completed timestamps.
Statuses: queued -> processing -> completed or failed.
Watch Until Complete
casedev ocr watch JOB_ID --json
Polls until the job finishes. Flags:
--interval/-i— poll interval in seconds (default: 3)--timeout/-t— max wait in seconds (default: 900)
Word-Level Data
Retrieve word-level OCR output for a vault object:
casedev ocr words --vault VAULT_ID --object OBJECT_ID --json
This requires the document to be in a vault and have completed OCR ingestion. The object must be a PDF or image (audio/video files are rejected).
Flags:
--page— specific page number--word-start— starting word index--word-end— ending word index
Returns per-page word arrays with text, word index, and confidence scores.
Uses focused vault if set via casedev focus set --vault.
Common Workflow
OCR a document from a vault
# 1. Upload to vault (triggers automatic ingestion + OCR)
casedev vault object upload ./scanned-contract.pdf --vault VAULT_ID --json
# 2. Check ingestion status
casedev vault object list --vault VAULT_ID --json
# 3. Get word-level data
casedev ocr words --vault VAULT_ID --object OBJECT_ID --json
# 4. Get specific page range
casedev ocr words --vault VAULT_ID --object OBJECT_ID --page 3 --json
OCR an external document
# 1. Submit
casedev ocr process --document-url "https://storage.example.com/doc.pdf" --json
# 2. Watch
casedev ocr watch JOB_ID --json
Troubleshooting
"Invalid file type for OCR": OCR only supports PDFs and images (application/pdf, image/*). Check the object's content type with casedev vault object list.
"Invalid object ID for this vault": Run casedev vault object list --vault VAULT_ID to see valid object IDs.
Job stuck in "processing": Increase watch timeout with --timeout 1800. Large documents (100+ pages) take longer.
"OCR job failed": The document may be corrupted or in an unsupported format. Re-upload and retry.
More from casemark/legal-plugin
search
Searches the web, legal databases, case law, patents, and case.dev knowledge base via the casedev CLI. Use when the user mentions "search", "legal research", "find cases", "case law", "patent search", "web search", "fetch URL", "webfetch", "legal skills", or needs to research legal topics, find similar cases, or retrieve web content.
9transcription
Transcribes audio and video files through case.dev with speaker diarization. Supports MP3, WAV, M4A, FLAC, OGG, WEBM, MP4 up to 5GB. Use when the user mentions "transcribe", "transcription", "deposition recording", "hearing audio", "speaker labels", or needs to convert audio/video to text.
5setup
Installs and configures the case.dev CLI for legal AI workflows including document vaults, OCR, transcription, and search. Use when the user mentions "case.dev", "casedev", needs to authenticate with case.dev, run diagnostics, set focus targets, list API routes, track jobs, or make raw API calls. Gateway skill for all case.dev skills.
4vaults
Manages case.dev encrypted document vaults for legal workflows. Creates vaults, uploads files and directories, lists and downloads objects, and runs semantic search across vault contents. Use when the user mentions "vault", "upload documents", "document storage", "download files", "vault search", or needs to manage case files and discovery documents.
3