- (Windows) install gtk3 runtime
- conda env create -f environment.yml or pip install -r requirements.txt
- source activate epub
python epub2pdf.py -i [EPUBPATH] -o [PDFPATH]
- It will generate {filename}.pdf in current directory
-
sample output pages
python epub2pdf.py -i [EPUBPATH] -o [PDFPATH] -s --sample_page [PAGE]
-
change font size
- by ratio
python epub2pdf.py -i [EPUBPATH] -o [PDFPATH] -r --font_size_ratio [RATIO]
- by given size
python epub2pdf.py -i [EPUBPATH] -o [PDFPATH] -r --font_size [FONTSIZE] --font_unit [px|em]
- by ratio
- python mobi2pdf.pf "{filepath}"
- It will generate {filename}.pdf in current directory
- Pdf Outline issues.
- page change for each chapter.
- page lost
- not support Chinese
useencoding=utf8
when write/read files - page lost
locate content files in content.opf instead of toc.ncx - toc lost use regex to update hyperlink
- better css format
- parse css file
- load content selector
- change to suiltable setting
- css overriden problem
Thanks to @liZe's help.
Usecss-inline
to change css style to inline, then it can solve the overriden problem.
- [√] config Font
- [√] better css format
- [√] better page organize
- [] transfer update to mobi
- Epub is zipped file containing xhtml and metadata.
- So I used weasyprint to convert xhtml to pdf.
- But how to know which html to add first.
- That information is contained in *.ncx inside epub bundle. BS4 is used to read ncx file.
- Kindle unpack to extract data.
- Weasyprint to convert html to pdf.