This directory contains tools and utilities for creating OCR templates for Archparser.
- standalone-template-creator.html - ⭐ Recommended - Standalone tool that works offline with any PDF
- TEMPLATE-CREATOR-GUIDE.md - Complete guide for using both creator tools
- README.md - This file
- TEMPLATE-CREATOR-GUIDE.md - How to create templates
-
Open the standalone creator:
open standalone-template-creator.html
-
Load your PDF drawing
-
Set viewport scale to match your backend (default: 2.0)
-
Draw regions by clicking and dragging on the PDF
-
Export JSON and save the file
-
Import into Archparser via the frontend UI
Templates can be used when uploading drawing sets in the Archparser frontend. Select your template from the dropdown during upload.
✅ Works completely offline ✅ No backend required ✅ Can be shared with team members ✅ Production users can use it ✅ Converts PDFs directly in browser ✅ Can be hosted on any web server
Use when:
- Creating templates for production use
- Sharing with team members
- Working with new PDFs
The viewport scale determines the resolution at which PDFs are rendered. This must match between:
- The template creator tool
- Your Archparser backend configuration
| Scale | DPI | Quality | Use Case |
|---|---|---|---|
| 2.0 | ~150 | Good | Recommended default |
| 4.0 | ~300 | Excellent | Medium - average processing speed |
| 6.0 | ~450 | Overkill | Very large drawings only |
Check the Archparser backend configuration:
// backend/src/drawing-processing/ocr-config.ts
export const DEFAULT_OCR_CONFIG: OcrProcessingConfig = {
viewportScale: 2.0 // ← This value
// ...
};Templates are JSON files with this structure:
{
"name": "Template Name",
"type": "standard",
"viewportScale": 2.0,
"regions": {
"title": { "x": 100, "y": 200, "width": 500, "height": 80 },
"drawing": { "x": 100, "y": 300, "width": 400, "height": 60 }
}
}Common region names:
title- Drawing titledrawing- Drawing numberrevision- Revision informationdate- Drawing dateproject- Project namearchitect- Architect namecontractor- Contractor nameengineer- Engineer namedrawingType- Type of drawingdrawingCategory- Category
Coordinates are in pixels from the top-left corner:
(0,0) ────────────────► X
│
│ ┌─────────┐
│ │ Region │ ← (x, y, width, height)
│ └─────────┘
│
▼
Y
x- Distance from left edgey- Distance from top edgewidth- Region widthheight- Region height
All values are in pixels at the specified viewport scale.
- Create template with standalone tool
- Export JSON file
- Share file with team members
- They import via Archparser UI
Consider creating a repository of common templates:
- Generic Arch D titleblock
- Standard ANSI formats
- Common AEC firm formats (with permission)
You can host these HTML files on any web server:
# Simple Python server
cd template-creator
python3 -m http.server 8000
# Or use any static hosting service
# Netlify, Vercel, GitHub Pages, etc.Then share the URL with your team.
Cause: Template viewport scale doesn't match backend
Solution:
- Check backend viewport scale
- Recreate template at matching scale
- Or update backend to match template
Cause: Regions positioned incorrectly
Solution:
- Process a test drawing
- Check where title block actually appears
- Adjust regions accordingly
Cause: Regions too small or positioned slightly off
Solution:
- Make regions slightly larger
- Use template creator's zoom feature for precision
- Test with multiple drawings to verify
For issues or questions:
- Check documentation in
/guidesdirectory - Review backend logs for coordinate warnings
- Test with standalone tool to verify coordinates
- Compare viewport scales between tool and backend
- Name templates clearly - Include firm, drawing type, and version
- Match viewport scale - Always verify backend settings first
- Test thoroughly - Process multiple drawings to verify accuracy
- Document quirks - Note any special considerations
- Version control - Keep backups of working templates
- Share with team - Make templates available to all users
- TEMPLATE-CREATOR-GUIDE.md - Detailed usage guide
