Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got some documents in DjVu which I'll like convert to PDF. Is there a way to do this using command line OSS tools?

share|improve this question
up vote 24 down vote accepted

djvu2pdf should fit the bill, it's a small script that makes use of the djvulibre toolset. If not, there are other methods that require multiple command-line tools.

share|improve this answer
What's a pity that, currently there is not djvu2pdf tool in Arch repo and old ver in Arch User repo – Grzegorz Wierzowiecki Nov 2 '11 at 17:42
Installing djvulibre-bin using apt-get and then installing the deb file in that link did the trick. – thameera Apr 21 '14 at 10:27
On mac you djvu2pdf is available via MacPorts. – Ioannis Filippidis Jul 2 '14 at 7:59

What about simply using DJView and export as PDF?

  1. Goto Synaptic Package Manager (System - Administration - Synaptic Package Manager)
  2. Install DJview4
  3. Run DJview (Applications - Graphics - DJView4)
  4. Open your .djvu document
  5. Menu - Export As: PDF

Look at

share|improve this answer
This is the better and easier solution, thanks! – woohoo Mar 4 '12 at 2:56

The ddjvu program, (which is part of the standard djvulibre package), will do this:

$ ddjvu -format=pdf -quality=85 -verbose a.djvu a.pdf

Warning: this produces large files (but PDF files made by Christoph Sieghart's script are of the same size.)

I also wrote the following small bash script some years ago. It does the same automatically. (Save this as


# convert DjVu -> PDF
# usage:  <file.djvu>

echo "------------ converting $i to PDF ----------------";
o="`basename $i .djvu`"
echo "[ writing output to $o ] "

cmd="ddjvu -format=pdf -quality=85 -verbose $i $o "

The djvu2pdf script by Christoph Sieghart does essentially the same

share|improve this answer

If you don't care about colors and images you can get much smaller files if you drop the colors and use instead:

ddjvu -format=pdf -mode=black input.djvu output.pdf

Texts, codes and formulas looks perfectly, but most of the images are gone

share|improve this answer

I've changed the @Maxim script a little ...

# convert DjVu -> PDF
# usage: [-q quality | -b] <infile.djvu> [outfile.pdf]


aparse() {
  while [ $# != 0 ] ; do
    case "$1" in
aparse "$@"

o=${2:-$(basename $i .djvu).pdf}
if [ -f  "$o" ]; then 
  echo "file $o exists, override [Y/n]?"
  read ans
  case "$ans" in 
   n|N) exit 1;;
echo "[ converting $i to $o ] "

cmd="ddjvu -format=pdf -quality=$quality -mode=$mode -verbose $i $o "

echo "[ executing $cmd ] "
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .