How can I batch convert comic ZIP files to PDF?

6,707

Solution 1

http://calibre-ebook.com/ - Add your collection and batch convert

enter image description here enter image description here enter image description here

Solution 2

I had to modify "cbz2pdf.sh" as follows to work for me:

#!/bin/bash
#set -xev
ORIGINAL_FOLDER=`pwd`
d="`mktemp -d`"
TMP=$1
unzip -d "$d" "$1"
v="${TMP%.*}"
cd "./$v"
ls -1 ./*.jpg | xargs -L1 -I {} img2pdf {} -o {}.pdf
pdftk *.pdf cat output combined.pdf
cp "combined.pdf" "$ORIGINAL_FOLDER/$v.pdf"

Solution 3

Unfortunately calibre changes the image, which is very important to CBR and CBZ, so to have minimal loss of quality, practically using the original jpg inside the CBR(CBZ) you need to use img2pdf, I use this commands:

1) This to make a pdf file out of every jpg image without loss of either resolution or quality:

ls -1 ./*jpg | xargs -L1 -I {} img2pdf {} -o {}.pdf

2) This to concatenate the pdfpages into one:

pdftk *.pdf cat output combined.pdf

I made this batch files

./cbr2pdf.sh:

#!/bin/bash
#set -xev
ORIGINAL_FOLDER=`pwd` 
JPEGS=`mktemp -d`
unrar e "$1" "$JPEGS"
cd "$JPEGS"
ls -1 ./*jpg | xargs -L1 -I {} img2pdf {} -o {}.pdf
pdftk *.pdf cat output combined.pdf
cp "$JPEGS/combined.pdf" "$ORIGINAL_FOLDER/$1.pdf"

cat cbz2pdf.sh

#!/bin/bash
#set -xev
ORIGINAL_FOLDER=`pwd` 
JPEGS=`mktemp -d`
unzip "$1" -d "$JPEGS"
cd "$JPEGS"
ls -1 ./*jpg | xargs -L1 -I {} img2pdf {} -o {}.pdf
pdftk *.pdf cat output combined.pdf
cp "$JPEGS/combined.pdf" "$ORIGINAL_FOLDER/$1.pdf"
Share:
6,707

Related videos on Youtube

user782234
Author by

user782234

Updated on September 18, 2022

Comments

  • user782234
    user782234 over 1 year

    I have many comics in CBR, CBZ format. I want to convert them to PDFs. I know Jomic can do this, but I am using Windows and Jomic only works on OS X.

    Is there any way to do that?

  • Scott - Слава Україні
    Scott - Слава Україні over 5 years
    I realize that Eduard Florinescu didn’t do a very good job in his answer, but can you explain your script? at least the parts that you changed from Eduard’s version, and why? Please do not respond in comments; edit your answer to make it clearer and more complete.