OfdReader for Openclaw

A Python-powered utility to extract content from Chinese national standard OFD files and convert them into clean Markdown or plain text.

zhanjian1972
v1.0.0
Feb 17, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install ofdreader

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 ofdreader 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 OfdReader?

OfdReader is a specialized document processing tool designed to handle the Open Fixed-layout Document (OFD) format, which is the national standard for electronic documents in China. This skill allows users to seamlessly extract text content and structural elements like headers, paragraphs, and tables, transforming them into developer-friendly Markdown or raw text files.

By leveraging OfdReader within the Openclaw Skills ecosystem, developers can automate the ingestion of official government documents, certificates, and reports into their AI workflows or knowledge bases. It provides a lightweight solution for parsing XML-based fixed-layout files without requiring heavy external dependencies.

OfdReader Use Cases

  • Extracting text content from official Chinese government documents and certificates for data entry.
  • Converting OFD reports into Markdown for integration into documentation sites or static site generators.
  • Automating the processing of electronic invoices or legal documents stored in the OFD format.
  • Preparing OFD data for LLM analysis by stripping away complex layout formatting while preserving logical structure.
  • Batch processing document archives in Openclaw Skills automation pipelines.

How OfdReader Works

  1. Validates the OFD file integrity by confirming it is a properly structured ZIP archive.
  2. Unpacks the internal XML structure, specifically targeting the document content within the Doc_0 directory.
  3. Parses the XML using the standard OFD namespace to identify TextCode, Paragraph, and Table elements.
  4. Applies heuristic rules to detect document headers and structural hierarchies based on text patterns.
  5. Generates the final output as either a continuous text stream or a formatted Markdown document.

OfdReader Setup

The core functionality of this skill relies on the Python standard library, making it highly portable.

# Extract plain text from an OFD file
python scripts/ofd_to_text.py <path_to_ofd_file> [output_file.txt]

# Convert an OFD file to Markdown
python scripts/ofd_to_markdown.py <path_to_ofd_file> [output_file.md]

# Optional: Install dependencies if needed for extended features
python scripts/install_dependencies.py

OfdReader Data Schema & Taxonomy

The skill organizes extracted data by mapping internal OFD XML elements to standard text formats. It specifically targets the http://www.ofdspec.org/2016 namespace.

Element Description Markdown Mapping
TextCode Raw text strings Plain text
Paragraph Logical text groupings Paragraphs and newlines
Table Grid data Markdown tables
Row/Cell Tabular components Table rows and cells
OFD.xml Document manifest Metadata reference

OfdReader Advanced Features

  • Heuristic-based title detection for improved Markdown hierarchy generation.
  • Support for table extraction via XML structure mapping to maintain data relationships.
  • Automatic UTF-8 encoding handling to ensure Chinese characters are rendered accurately.
  • CLI-first design allowing for easy integration into larger Openclaw Skills workflows.
  • Lightweight implementation using zipfile and xml.etree.ElementTree for zero-config deployments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*