Here are a couple of scripts that might help you out if you are a Kobo user trying to load third party eBooks. Script 1: strip out all style data (this fixes up the margins and any font issues that you may be experiencing).

Simply put the epub files you want to convert in the same directory as the script (tested on Mac OS 10.5 - but should work on all Unix variants).

#!/bin/bash
mkdir _unpack
#iterate over each epub in this folder
find . -name '*.epub' -depth 1|while read epub
do
unzip "${epub}" -d ./_unpack
cd ./_unpack/OEBPS
for xhtml_file in `ls|grep xhtml`
do
awk '{gsub("", "");print}' "${xhtml_file}" > "${xhtml_file}.new"
mv "${xhtml_file}.new" "${xhtml_file}"
done
cd ../
echo `pwd`
mv "../${epub}" "../${epub}.old"
zip -r "../${epub}" *
cd ../
rm -rf _unpack
done

Script 2: strip out all style data and load a jpg image for the book cover (note that both book and jpeg must be in a sub directory for this to work).

#!/bin/bash
find . -type d -depth 1|while read dir
do
cd "${dir}"
mkdir _unpack
#iterate over each epub in this folder
find . -name '*.epub' -depth 1|while read epub
do
unzip "${epub}" -d ./_unpack

cd ./_unpack/OEBPS
for xhtml_file in `ls|grep xhtml`
do
awk '{gsub("", "");print}' "${xhtml_file}" > "${xhtml_file}.new"
mv "${xhtml_file}.new" "${xhtml_file}"
done
cp ../../../title.xhtml ./
cp ../../*.jpg ./cover.jpg
cd ../
echo `pwd`
mv "../${epub}" "../${epub}.old"
zip -r "../${epub}" *
cd ../
rm -rf _unpack
done
cd ..
done

The working directory must have the following title.xhtml file in it: