invoice-template-from-pdf

Installation
SKILL.md

Rebuild an invoice PDF as an invoice-api template

Do not eyeball. Measure the original, build with the helpers, render through the API, compare, correct. Repeat at most 5 rounds, then report what is left.

Setup

  • pip install pdfplumber pillow (Python 3.8+). Scripts are in scripts/.
  • INVOICE_XHUB_API_KEY as environment variable or .env in the working directory. Never print it.
  • Each render is one API call (counts against the quota). A full job takes about 8-12 calls.
  • Keep the original PDF and everything derived from it (sample data, renders) local; it contains customer data. Never commit it.

Workflow

  1. Measure the original:
    python3 scripts/analyze_pdf.py original.pdf --out analysis
    
    Look at analysis/page-1.png, then read analysis/analysis.json: every text line with x/top/size/font/bold/colour, filled areas, rules, images (logo cut out to analysis/assets/), palette and font sizes. These numbers are your spec.
Installs
2
First Seen
Today