Install
openclaw skills install pdf2ofdConverts PDF documents (invoices, reports) to High-Fidelity OFD format with pixel-perfect precision.
openclaw skills install pdf2ofdA specialized skill for converting PDF documents into the Chinese National Standard OFD (GB/T 33190-2016) format. Optimized for Electronic Invoices (OFD版式发票) with advanced rendering capabilities that exceed standard conversion libraries.
DeltaX arrays) and baseline origin data extracted via rawdict to ensure text layout is 100% identical to the source PDF.Alpha and FillOpacity for vector paths and SMask transparency for images (e.g., electronic seals and signatures).128 0 0) for financial documents while preserving non-standard colors.When a user asks to convert a PDF or a "High-Fidelity" invoice to OFD:
Direct Execution:
python3 pdf2ofd.py <input_path.pdf> [output_path.ofd]
Plugin Integration:
The script implements a PDF2OFDConverter class that can be easily imported and used in other Python workflows.
Success: /path/to/invoice.ofd
Dependencies required in the environment:
PyMuPDF (fitz): For advanced PDF parsing and raw character data extraction.Pillow: For image processing and transparency handling.easyofd: The base library for OFD structure (extended via internal monkey patches).xmltodict: For XML manipulation.easyofd to fix known library limitations regarding character positioning and resource ID tracking.