🩻 Plenti Precheck

Plenti Precheck provides a unified, stateful API for sophisticated date and date-range detection in Australian financial documents

⚠️ This demo will not work when opened as a local file (file:// URL).
Please use a local HTTP server. See setup instructions below.
🔄 Checking system readiness...
📦 Bundle files: Checking...
⚙️ PDF Worker: Checking...
🎯 Overall status: Checking...
📄
Drop your PDF here or browse files

📚 Setup Guide & Documentation

🚨 Important Requirements

This demo requires a local HTTP server due to browser security restrictions:

  • Web Workers cannot load from file:// URLs
  • ES Modules cannot import from file:// URLs
  • Bundle files must be accessible via HTTP/HTTPS

🚀 Quick Start

1. Build the Required Files

npm run build

This creates bundle/bundle.js and bundle/pdf-worker.js

2. Start a Local Server

# Option 1: Using npx serve (recommended)
npx serve . --port 3000

# Option 2: Using Python
python3 -m http.server 3000

# Option 3: Using Node.js http-server
npx http-server . -p 3000

3. Open in Browser

http://localhost:3000/examples/browser/index.html

📁 File Structure

plenti-precheck/
├── bundle/                     # Generated build files
│   ├── bundle.js              # Main library bundle (ESM)
│   └── pdf-worker.js          # Web Worker for PDF processing
├── examples/browser/          # Browser demo
│   ├── index.html            # This demo page
│   ├── main.js               # Demo logic and UI
│   └── style.css             # Demo styling
└── src/                       # Source TypeScript files
    ├── index.ts              # Main library entry
    ├── pdf-worker.ts         # Worker implementation
    └── ...                   # Other library modules
✅ Bundle Location: Bundle files are generated in the bundle/ directory at the project root.

🔧 How It Works

Architecture

  • Main Thread: Handles UI, file selection, and PDF loading using PDF.js
  • Web Worker: Processes PDF text content for bank/date/type detection
  • Bundle Files: Compiled TypeScript modules for browser compatibility

Processing Flow

  1. User selects PDF file
  2. PDF.js extracts text content from all pages
  3. Text data is sent to the Web Worker
  4. Worker analyzes text for banks, dates, and document types
  5. Results are returned and displayed in the UI

Performance Modes

  • Fast Mode (default): Stops analysis as soon as key data is found
  • Deep Analysis: Processes entire document for comprehensive results

🛠️ Troubleshooting

Common Issues

❌ "Worker file not found" or 404 errors
  • Run npm run build to generate bundle files
  • Ensure you're using an HTTP server, not opening file:// URLs
  • Check that bundle/ directory exists with bundle.js and pdf-worker.js
❌ "Cannot load ES modules" or CORS errors
  • Must use HTTP/HTTPS protocol (not file://)
  • Start a local server as shown in Quick Start
  • Ensure server serves files from the project root directory
❌ PDF processing fails or no results
  • Try enabling "Deep Analysis" mode for better detection
  • Check browser console for detailed error messages
  • Ensure PDF contains extractable text (not just images)

Development Commands

# Clean build artifacts
npm run clean

# Build only TypeScript (no bundles)
npm run build:dist

# Build only browser bundle
npm run build:bundle

# Build only worker bundle  
npm run build:worker

# Build everything
npm run build

# Build and serve (shortcut)
npm run serve

🔒 Privacy & Security

✅ 100% Local Processing
  • All PDF analysis happens in your browser
  • No files are uploaded to any server
  • No data leaves your computer
  • Works completely offline once loaded

📖 Library Information

Plenti Checker Library is designed for Australian financial document analysis, specializing in:

  • Bank Detection: Identifies major Australian banks from document text
  • Date Range Detection: Finds statement periods and date ranges
  • Document Type Classification: Categorizes financial document types
  • Fast Processing: Optimized for speed with early exit when key data is found

Version: 0.0.1 | Author: Plenti Experience Team | License: Private