Posted By

chema_ar on 04/22/13


Tagged

Bash pdf epub


Versions (?)

Convert ePub to PDF in Linux command line


 / Published in: Bash
 

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

  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  

You need to login to post a comment.