OFD Text Extractor for Openclaw

A specialized technical utility for extracting structured text and millimeter-precise character coordinates from Open Fixed-layout Document (OFD) files.

liuwei19820201
v1.0.1
Apr 7, 2026
0
689
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ofd-text-extractor

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ofd-text-extractor using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OFD Text Extractor?

The OFD Text Extractor is a professional-grade tool designed to parse the Open Fixed-layout Document format, which is a standard for electronic documents and invoices. This skill within the Openclaw Skills library goes beyond basic text scraping by providing developers with deep access to the document's internal XML structure, including template mapping and precise coordinate systems.

By leveraging this skill, users can transform unstructured OFD ZIP containers into highly actionable JSON data. It is specifically optimized to handle complex layouts, including DeltaX character spacing and template-based headers (Form-style), ensuring that the extracted information maintains its original spatial context for downstream data analytics or automation tasks.

OFD Text Extractor Use Cases

  • Automating the extraction of financial data from OFD-formatted electronic invoices.
  • Mapping character-level positions for document reconstruction or search indexing.
  • Batch processing document archives to convert fixed-layout files into structured datasets.
  • Analyzing the internal XML architecture of OFD containers for quality assurance.
  • Identifying specific data points based on precise page coordinates in official documents.

How OFD Text Extractor Works

  1. The skill accesses the OFD file, which acts as a ZIP container, and identifies the main entry point via OFD.xml.
  2. It parses Document.xml to resolve mapping for template pages and document layers.
  3. It extracts content from individual page XML files (Content.xml), identifying all TextObject elements.
  4. It calculates precise coordinates for every character by combining the base X/Y position with DeltaX spacing arrays.
  5. It merges template-layer data (such as recurring labels or headers) with the primary page content.
  6. The processed data is then exported as a structured JSON object, preserving metadata, boundaries, and source origins.

OFD Text Extractor Setup

To get started with this skill, ensure you have the necessary script files in your project directory.

# Navigate to the skill scripts folder
cd scripts

# Basic text extraction from an OFD file
python extract_ofd.py "path/to/your/document.ofd"

# Extraction with full character-level coordinate data
python extract_ofd.py "path/to/your/document.ofd" --show-chars

# Export the extracted data directly to a JSON file
python extract_ofd.py "path/to/document.ofd" --output "result.json" --show-chars

OFD Text Extractor Data Schema & Taxonomy

Field Description
text The full string content found within a specific text block.
x, y The starting horizontal and vertical coordinates in millimeters (mm).
boundary The bounding box (X, Y, Width, Height) defining the text area.
source Specifies if the data originated from a page or a template.
isTemplate A boolean flag indicating if the text belongs to a template layer.
characters A detailed array containing each character and its specific X/Y coordinates.

OFD Text Extractor Advanced Features

  • Full support for DeltaX attributes to ensure character-level spatial accuracy.
  • Automatic template resolution (Tpl_X) to correctly identify and extract recurring document headers.
  • Multi-platform compatibility with both Python and PowerShell extraction scripts provided in Openclaw Skills.
  • Precise millimeter-based coordinate system for high-fidelity data mapping.
  • Structured JSON output optimized for integration with AI agents and database pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*