Sunday, November 7, 2010

djvu2pdf - well manually that is...

As with most conversions from format A to format B, the best results are often obtained by using format A viewer, and 'Export'

djvu -> ps -> pdf

Well if you really want you can go that way, but be warned that .ps files rarely use image compression and other modern techniques, so expect a large intermediate file!

I use postscript and do like the format for short documents (say less than 10 pages).

For longer documents and full books, then .djvu is a great format in itself, and now that djview4 is available in Debian, there is no real pressing need to convert.

If however you are determined to convert then here are your options:
  1. djvups to get a .ps file, and then postscript view export/print
  2. ddjvu -format=tiff  to get a tiff, and then convert that again
  3. djview4 'File' -> 'Export As'
  4. djvu2pdf script by Christoph Sieghart
Option 3 is what worked well for me.

If djview4 was not easy to install using apt-get, then I would probably have taken a closer look at option 4, however having tried the Export feature of djview4, I am happy with the result.


'Export As' option of djview4:

Allows you to set a dpi for the output and 300 dpi was quite readable.
( The original .djvu was good quality so I could afford to be a bit lossy )


There is also an option to adjust the .jpeg compression, but I left it unchanged at 75%.



Best results are often obtained by using format A viewer, and 'Export':

What I meant by this is best illustrated by describing the alternative...

Less preferred alternative:
Having done the conversion to .ps, implicitly* or explicitly, open the file using 'Document Viewer' / Evince / Okular and try exporting.

The above may work, but for me, seems to be a less reliable way of attacking the problem.

Yes, Yes, cups has a pdf output helper

Yes, Yes, Okular has 'Print to file' option

However my experience was that viewing in a native .djvu reader (not Evince or Okular), and Exporting produced the most reliable result.


*ps/pdf viewer software will often open a .djvu file, but in the background, what really happened was probably a quick 'on the fly' conversion.

No comments: