askill
create-table

create-tableSafety 95Repository

Create PDF tables using ReportLab Table class for proper structure detection. Creates tables that Marker and other extractors can parse. Use when you need detectable tables in PDFs.

0 stars
1.2k downloads
Updated 2/26/2026

Package Files

Loading files...
SKILL.md

create-table

Create PDF tables using ReportLab's Table class that extractors (Marker, Camelot) can detect.

Why This Exists

PyMuPDF raw drawing commands (draw_line, insert_text) create visual tables but not proper PDF table structures. Marker and other extractors cannot detect these as tables.

ReportLab's Table class creates proper PDF table structures with cell boundaries that extraction tools recognize.

Quick Start

cd .pi/skills/create-table

# Generate from preset (simple, medium, complex)
uv run generate.py preset simple
uv run generate.py preset complex --output my_table.pdf

# Generate with custom data
uv run generate.py generate --output custom.pdf \
  --columns "ID,Name,Status" \
  --rows '[["1","Alice","Active"],["2","Bob","Pending"]]'

# Borderless table
uv run generate.py generate --no-border --output borderless.pdf

# Thick borders (3pt)
uv run generate.py generate --line-width 3 --output thick.pdf

# Render as image (for scanned document testing)
uv run generate.py preset medium --as-image --dpi 200

# Generate all examples
uv run generate.py example

Commands

preset - Generate from preset complexity

uv run generate.py preset <name> [options]
PresetDescription
simple3x3 basic table
medium8-row requirements matrix with 6 columns
complexMulti-index headers with column spans

generate - Create custom table

uv run generate.py generate [options]

Options:

OptionShortDescriptionDefault
--output-oOutput PDF/PNG pathtable_fixture.pdf
--columns-cComma-separated column headersID,Name,Value
--rows-rJSON array of row data3 sample rows
--spec-sJSON spec file path-
--title-tTable title text-
--stylegrid, plain, coloredgrid
--border/--no-borderEnable or disable borders--border
--line-width-wBorder thickness in points1.0
--multi-index-mJSON multi-index headers-
--as-image-iRender as PNG imageFalse
--dpiImage resolution150

example - Generate all examples

uv run generate.py example

Creates examples/ directory with all presets, styles, and border variations.

Multi-Index Tables

For hierarchical headers that span columns:

uv run generate.py generate \
  --columns "ID,Q1,Q2,Q3,Q4,Total" \
  --rows '[["A","10","20","30","40","100"]]' \
  --multi-index '[[{"text":"","span":1},{"text":"2024 Quarters","span":4},{"text":"","span":1}]]'

Scanned Document Simulation

Generate table as a rasterized PNG image (for testing OCR/VLM extraction):

# 150 DPI (default)
uv run generate.py preset medium --as-image

# Higher quality (300 DPI)
uv run generate.py preset complex --as-image --dpi 300 --output scanned_table.png

Verification

Test that Camelot detects the table:

uv run generate.py preset simple --output test.pdf

python -c "
import camelot
tables = camelot.read_pdf('test.pdf', pages='1', flavor='lattice')
print(f'Tables found: {len(tables)}')
if tables:
    print(tables[0].df)
"

Dependencies

Self-contained via uv run - no pre-installation needed.

[project]
dependencies = [
    "reportlab>=4.0.0",
    "typer>=0.9.0",
    "pymupdf>=1.23.0",
]

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

94/100Analyzed 2/19/2026

High-quality skill for creating detectable PDF tables using ReportLab. Provides comprehensive command-line interface with presets, custom generation, multi-index support, and scanned document simulation. Well-structured with clear triggers, detailed options tables, verification steps using Camelot, and proper dependencies. Located in dedicated skills folder with appropriate tags. Highly actionable and reusable for PDF extraction testing workflows.

95
95
90
95
95

Metadata

Licenseunknown
Version-
Updated2/26/2026
Publishergrahama1970

Tags

ci-cdtesting