pdf2ofd: High-Fidelity PDF to OFD Converter for Openclaw

A specialized skill for converting PDFs to the Chinese National Standard OFD format with character-level precision and transparency support.

xzw
v1.0.2
Mar 15, 2026
0
898
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install pdf2ofd

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 pdf2ofd 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 pdf2ofd: High-Fidelity PDF to OFD Converter?

The PDF to OFD High-Fidelity Converter is a specialized Openclaw Skills module designed to bridge the gap between standard PDF documents and the Chinese National Standard OFD (GB/T 33190-2016) format. Unlike basic converters, this tool focuses on high-fidelity reproduction, making it essential for financial documents, electronic invoices (OFD版式发票), and reports that require exact visual fidelity.

This skill utilizes advanced rendering techniques, ensuring that every character, vector path, and image transparency layer is preserved. It is particularly effective at handling complex elements like electronic seals and signatures, providing a robust solution for developers and enterprises needing to comply with national digital document standards using the Openclaw Skills ecosystem.

pdf2ofd: High-Fidelity PDF to OFD Converter Use Cases

  • Converting standard PDF invoices into official OFD formatted electronic invoices for financial compliance.
  • Preserving pixel-perfect positioning for legal documents and governmental reports.
  • Migrating legacy PDF archives to the OFD standard for long-term digital preservation.
  • Automating high-volume document conversion workflows in financial or accounting systems.

How pdf2ofd: High-Fidelity PDF to OFD Converter Works

  1. The skill parses the input PDF using PyMuPDF to extract raw dictionary data, including character-level positioning (DeltaX) and baseline origins.
  2. Vector graphics are analyzed to extract stroke colors, fill colors, and line widths, ensuring original path integrity.
  3. Font mapping occurs, translating platform-specific font names (e.g., STSong on macOS) to standardized OFD font names like SimSun.
  4. Images and transparency masks (SMasks) are processed and packaged in-memory to maintain security and speed.
  5. The skill applies heuristic color snapping to ensure financial document accuracy, such as correcting Invoice Red.
  6. A final, compliant OFD ZIP structure is generated and saved as the output file.

pdf2ofd: High-Fidelity PDF to OFD Converter Setup

To use this skill, ensure you have the required dependencies installed in your Python environment:

pip install pymupdf pillow easyofd xmltodict

You can then execute the conversion via the CLI:

python3 pdf2ofd.py <input_path.pdf> [output_path.ofd]

pdf2ofd: High-Fidelity PDF to OFD Converter Data Schema & Taxonomy

Element Description
Input PDF document (.pdf)
Output High-Fidelity OFD package (.ofd)
Font Mapping Intelligent macOS/Windows to GB/T standard mappings
Packaging Secure In-memory ZIP structure
Metadata GB/T 33190-2016 compliant XML manifests

pdf2ofd: High-Fidelity PDF to OFD Converter Advanced Features

  • DeltaX character positioning for 100% layout accuracy compared to the source PDF.
  • Full SMask and Alpha transparency support specifically for electronic seals and signatures.
  • Heuristic "Invoice Red" color snapping optimized for financial document compliance.
  • Deep monkey-patching of the easyofd library to resolve native resource ID and positioning limitations.
  • Zero-copy resource handling to maximize image quality during conversion within the Openclaw Skills framework.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*