PDF Zone Templates
Learn how to create and manage PDF zone templates in Foreman to define areas for automated text extraction and streamline QA/QC document checks.
What Are Zone Templates?
A zone template defines rectangular areas on a PDF page where Foreman should extract text. You draw zones on specific parts of a document -- title blocks, revision tables, approval stamps, notes panels -- and Foreman extracts text from those areas during checks.
Zone templates are user-scoped (each user manages their own) and reusable across any project check.
Uploading a Sample PDF
- Go to the Zone Templates tab on the QA/QC page.
- Click Upload PDF and select a representative document (max 10 MB).
- Foreman auto-detects the page dimensions and defaults to the last page (common for title blocks).
- The template is named after the file. Hover over the name and click the pencil icon to rename it.
The detected page size (e.g. A1, A3) is shown as a badge on the template card if it matches a standard sheet size.
The Zone Editor
Click Edit Zones on a template card to open the full-screen zone editor.
Drawing Zones
- Click and drag on the PDF to draw a rectangular zone.
- A label input appears in the zone panel on the right. Type a name (e.g. "Drawing Number", "Revision", "Date").
- Draw as many zones as needed. Each gets a unique colour for easy identification.
Selecting and Editing
- Click a zone on the PDF or in the side panel to select it.
- Drag edges to resize a selected zone.
- Rename by editing the label in the side panel.
- Delete by clicking the X button on the zone row.
Navigation Controls
The floating toolbar at the bottom of the viewer provides:
| Control | Action |
|---|---|
| Fit | Fits the page to the viewport |
| Zoom +/- | Zoom in and out (also Ctrl+scroll) |
| Pan | Two-finger trackpad or middle-click drag |
| Page nav | Previous/next page (for multi-page documents) |
| Auto-detect | Analyses the current page and suggests zones based on text block positions |
Multi-Page Support
Zones can span multiple pages. Use the page navigator to switch pages, then draw zones on each page. Zones are grouped by page in the side panel.
OCR for Scanned Documents
If a PDF page has fewer than 5 text elements (indicating a scanned document), Foreman automatically falls back to Tesseract OCR to extract text with positional data. 15 languages are supported:
English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Swedish, Norwegian, Danish, Finnish, Turkish, Romanian.
Preview
Click Preview on a zone row to extract and display the text from that zone using the sample PDF. This lets you verify zone placement before running a check.
Saving
Click Save in the zone panel footer. An amber pulse indicator appears on the Save button when you have unsaved changes. The editor warns you if you try to close with unsaved changes.
Zone coordinates are stored as normalised values (0.0 to 1.0) relative to the page dimensions. This means zones adapt if the PDF is regenerated at a slightly different resolution.
Generate Rules from Template
Once a template has zones defined, the Generate Rules button on the template card (the bolt-icon, blue-filled button next to Edit Zones) produces a complete rule set in one click. It's the fastest way to bridge zone setup → working validation rules.
Click Generate Rules to open the Generate Rules from Template dialog:
- The dialog header shows the template name and zone count.
- The settings bar has one option: Use AI for smarter patterns (on by default). With AI on, Foreman analyses the actual extracted text from your sample PDF and writes regex patterns that match the structure (e.g. it sees
A204and writes^[A-Z]\d{3}$, not the literal^A204$). With AI off, the same logic runs as a heuristic — fast and free, but less precise. - Click Generate Rules. Foreman extracts the text from each zone using the sample PDF, then proposes one Content Convention rule per zone.
- The Extracted Zone Values section is collapsible — expand to verify the sample text Foreman found before committing.
- Each proposed rule is shown with:
- A checkbox to include / exclude
- An editable name (default: zone name)
- A zone tag showing which zone the rule belongs to
- A severity dropdown (Error / Warning / Info)
- When selected: an editable regex field, plus a green/red matches / no match chip that live-tests the regex against the extracted sample
- Use Select all / Deselect all to bulk-toggle.
- Type a rule set name in the footer (must be at least 3 characters).
- Click Create Rule Set (N rules) to save.
The new rule set lands in the Rules tab with all selected rules pre-populated. Run a check against it immediately, or open it to fine-tune individual patterns.
Generate Rules is one-shot — clicking it again on the same template creates a new rule set. To update an existing one, edit the rules directly in the Rules tab.
When to use it
- Just defined a new template and want a sensible starting set of validation rules without writing each one by hand.
- Onboarding a project — upload one canonical title block, draw the zones, generate rules, hand over.
- Regression-checking your standard — generate rules against a known-good PDF, then disable / tweak the proposed patterns to match the looser cases your standard allows.
Next Steps
- Size Variants for Different Sheet Sizes -- handle A0, A1, A3, and other sizes
- Creating Rule Sets & Rules -- set up Content Match rules that use zone templates