Convert ePub to PDF in Linux command line


/ Published in: Bash
Save to your folder(s)

This script enables the conversion of the HTML files available in the ePub format in only one PDF file


Copy this code and paste it in your HTML
  1. #!/bin/bash
  2. INPUT_DIR=
  3. OUTPUT_DIR=
  4. OUTPUT_FILE=merge.pdf
  5. #INPUT DIR must contain the unzipped ebook file
  6. #unzip file.epub
  7. for i in $( ls $INPUT_DIR ); do
  8. echo $i
  9. wkhtmltopdf "$INPUT_DIR/$i" "$OUTPUT_DIR/$i".pdf
  10. done
  11.  
  12. pdftk `ls "$OUTPUT_DIR"` cat output "$OUTPUT_FILE"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.