Agent Doc Scanner

An AI-powered document scanning component that handles PDF, CSV, and other document uploads with intelligent extraction, analysis, and export capabilities.

Features

  • Multi-Format Support: Process PDF, CSV, DOCX, XLSX, and TXT files
  • AI Extraction: Automatically extract tables, metadata, and key information
  • Document Preview: View documents with zoom, rotate, and page navigation
  • Confidence Scores: See AI confidence levels for extracted data
  • Smart Sections: Organized extraction of different content types
  • Export Options: Export processed data as JSON, CSV, or TXT
  • Drag & Drop: Intuitive file upload with drag-and-drop support
  • Page Navigation: Multi-page document support with controls

Examples

Basic Usage

Doc Scanner Agent2:34 PM

sample-invoice.pdf

239.3 KB3 pages

PDF

Document preview would appear here

1 / 1
4 sections extracted

Interactive Demo

Doc Scanner Agent2:34 PM

Drop your document here

Supports PDF, CSV, DOCX, XLSX, and TXT files up to 10MB

4 sections extracted

Chat Integration

U
I have an invoice PDF that I need to process and extract the key information from.
DA
I can help you process the invoice and extract key information like vendor details, line items, and total amounts. Please upload the PDF file.
Doc Scanner Agent2:36 PM

invoice-Q1-2024.pdf

317.4 KB2 pages

PDF

Document preview would appear here

1 / 1

Installation

npx shadcn@latest add agents-ui-kit/agents-ui/agent-doc-scanner

API Reference

AgentDocScanner

PropTypeDefaultDescription
documentDocumentInfo-Current document information
extractedSectionsExtractedSection[][]Array of extracted content sections
currentPagenumber1Current page number
totalPagesnumber1Total number of pages
isProcessingbooleanfalseWhether document is being processed
uploadProgressnumber0Upload progress percentage (0-100)
previewUrlstring-URL for document preview
onFileUpload(file: File) => void-Callback when file is uploaded
onExtract(sectionId: string) => void-Callback to extract specific section
onExport(format?: "json" | "csv" | "txt") => void-Callback for data export
onPageChange(page: number) => void-Callback when changing pages
onZoomIn() => void-Callback for zoom in
onZoomOut() => void-Callback for zoom out
onRotate() => void-Callback for rotation
onCopySection(sectionId: string) => void-Callback to copy section content
onHighlightSection(sectionId: string) => void-Callback to highlight section in document
classNamestring-Additional CSS classes
timestampstring"2:34 PM"Display timestamp

DocumentInfo

PropertyTypeRequiredDescription
namestringYesDocument file name
type"pdf" | "csv" | "docx" | "xlsx" | "txt"YesDocument type
sizenumberYesFile size in bytes
pagesnumberNoNumber of pages (for multi-page docs)
uploadedAtstringNoUpload timestamp

ExtractedSection

PropertyTypeRequiredDescription
idstringYesUnique section identifier
type"text" | "table" | "image" | "metadata"YesContent type
titlestringYesSection title
contentanyYesExtracted content (varies by type)
confidencenumberNoAI confidence score (0-1)
pagenumberNoPage number where content was found