pdf2epub-calibration
Installation
SKILL.md
PDF→EPUB Classifier Calibration
When to Use
- A converted EPUB has citations in body text, page numbers as phantom endnotes, or broken/duplicate footnote links
- Chapter headings resolve to wrong PDF pages
- The cover image comes out as a texture fragment or a naked photo without typography
Span-merge reality (check the dump, not the flag)
page.get_text("dict")gives lines whose spans merge text at different font sizes. A body line can contain a 5pt footnote-ref span inside 12pt text — text extraction sees ONE line at the max span size.- Superscript flags are unreliable: several authoring tools (QuarkXPress-style CJK exports included) emit footnote refs as STANDALONE 6pt lines with the sup flag UNSET, and emit the note's own number as a leading 5pt span merged into the note's first line. Gate ref detection on size + position, never on the sup flag alone.
- Before changing any threshold, dump per-page lines with text/size/flags/y-ratio. Most classification misses are span-merge artifacts, not wrong thresholds.