This skill is a technical toolbox built specifically for "publication-grade high-definition conversion". It focuses on high-quality physical conversion from EPUB to PDF and Markdown, ensuring that e-books achieve the best visual presentation on different devices.
Core Capabilities
- Publication-Grade PDF Reconstruction (Technical): Applies industry best practices such as 13pt font size, 1.5em line height, and 2.5cm margins. Automatically extracts and subsets embedded EPUB built-in vector fonts to ensure high-definition presentation across devices.
- Structured MD Extraction (Technical): Accurately restores e-book hierarchy, image references, and footnotes, generating Markdown source files suitable for note-taking systems such as Obsidian/Logseq.
- Ultimate Fault Tolerance and Safety: Uses MD5 filename hashing and path isolation technology to perfectly handle ultra-long paths and special characters, ensuring a 100% success rate in the conversion process.
Closed-Loop Workflow
- [Technical Conversion]: Run
script/convert.py. This stage completes parsing of the original EPUB, font extraction, PDF rendering, and Markdown synchronization. - [Quality Self-Check]: Verify the completeness of PDF pages and the correctness of Markdown image references.
Directory Structure
script/: Core conversion scriptconvert.py。reference/: Publication typesetting specificationstypography_rules.md。tools/: Dependency definitionsrequirements.txt。
Usage
Run the script and enter the EPUB path as prompted:
python .trae/skills/epub-pro-converter/script/convert.py
Or pass it directly via command-line arguments:
python .trae/skills/epub-pro-converter/script/convert.py "path/to/book.epub"
Applicable Scenarios
- When the user requests "high-quality", "high-definition", or "professional typesetting" PDF conversion.
- When the EPUB filename contains special characters or the path is extremely long.
- When e-book content needs to be imported losslessly into Markdown note-taking tools such as Obsidian.