Process EPUB files into structured extraction JSON, guide AI paragraph-aligned translation and summary filling, then assemble bilingual EPUBs with target-lan...
Documents
epub-to-pdf-skill
Try itConvert EPUB e-books to PDF using ebooklib + WeasyPrint with proper CJK font support.
What it does
Convert EPUB e-books to PDF using ebooklib + WeasyPrint with proper CJK font support.
The skill document
EPUB → PDF
Convert .epub files to PDF. Works for Chinese/Japanese/Korean text.
Prerequisites
apt-get install -y weasyprint
pip3 install --break-system-packages ebooklib beautifulsoup4 lxml
CJK fonts required:
/root/.openclaw/workspace/skills/pdf-maker/NotoSansCJKsc.ttf/root/.openclaw/workspace/skills/pdf-maker/NotoSansCJKscB.ttf
Usage
python3 scripts/epub2pdf.py
How it works
ebooklibreads allITEM_DOCUMENTentries from the EPUBBeautifulSoup + lxmlstrips,,,tags- Injects CJK fonts via
@font-faceCSS WeasyPrintrenders combined HTML to A4 PDF (2cm margins, justified)
Troubleshooting
| Symptom | Fix |
|---|---|
| WeasyPrint import fails | apt-get install weasyprint |
| CJK characters garbled | Ensure font TTF path is correct (TTC collections won't work) |
| Empty / tiny PDF | EPUB has no readable document entries — check TNC count |
| calibre root sandbox error | Don't use calibre; use this script instead |
Related skills
Task-mode-driven EPUB reading and analysis skill with overview, targeted reading, chunked full reading, extraction, complex-content inspection, and batch pro...
Use this skill when the user wants to convert ebook or document files between formats with Calibre, including EPUB to PDF, Markdown to EPUB, MOBI to EPUB, AZ...
将扫描版PDF电子书通过OCR识别转换为结构化精排的EPUB格式。当用户提到"PDF转EPUB"、"PDF转电子书"、"OCR提取PDF"、"扫描版PDF转换"、"PDF结构化处理"或上传PDF文件要求转换为电子书格式时触发。不适用于纯文本PDF(可直接提取文字的PDF不需要OCR)、图片格式转换或PDF编辑功能。
Converts Markdown into an ElegantBook LaTeX book project and PDF. Invoke when user asks to typeset Markdown as a Chinese LaTeX book with diagrams.
電子書轉換工具箱:支援 EPUB / PDF / MOBI / AZW3 / FB2 → TXT / Markdown / HTML / JSON;批量轉換、封面萃取、元資料讀寫、圖書館自動分類。