Skip to content
github-actions edited this page Aug 12, 2026 · 21 revisions
DPSPREP(1)                                 dpsprep Manual                                 DPSPREP(1)

NAME
       dpsprep - Convert DjVu files to PDF.

SYNOPSIS
       dpsprep [OPTIONS] SRC [DEST]

DESCRIPTION
       Convert DjVu files to PDF.

           The  name  comes from Sony's Digital Paper System (DPS), for which the tool was initially
       developed.

           The usage should be straightforward, however the options that accept page ranges  require
       some
           elaboration. For example, the --mode option accepts the following values:

               "rgb", "rgb[3]", "rgb[3,4,5]", "rgb[3-5]", "rgb[3-end]", "bitonal[3],rgb[10-end]"

           Furthermore, --mode can be passed multiple times with the same effect as placing commas.


OPTIONS
       --version
              Show the version and exit.

       -m, --mode COMMA-SEPARATED IMAGE MODES WITH PAGE RANGES
              Override  the  image modes encoded in the DjVu file for individual pages. Valid values
              are "infer" (default), "bitonal", "grayscale" and "rgb". It sometimes makes  sense  to
              force bitonal images since they compress well.

       --dpi COMMA-SEPARATED INTEGERS WITH PAGE RANGES
              Override the DPI values encoded in the DjVu file for individual pages.

       -q, --quality COMMA-SEPARATED INTEGERS WITH PAGE RANGES
              Determine  the quality of images in output. Valid values range between 1 and 100. Used
              only for JPEG compression, i.e. RGB and Grayscale images. Passed  directly  to  Pillow
              and to OCRmyPDF's optimizer.

       -d, --delete-working
              Delete any existing files in the working directory prior to writing to it.

       -w, --preserve-working
              Preserve the working directory after script termination.

       -f, --overwrite
              Overwrite destination file.

       -o     Deprecated flag for overwriting destination file. The short variant of --overwrite has
              been renamed to -f.

       -v, --verbose
              Display debug messages.

       -t, --no-text
              Disable the generation of text layers. Implied by --ocr.

       -O1    Use the lossless PDF image optimization from OCRmyPDF (without performing OCR).

       -O2    Use the PDF image optimization from OCRmyPDF.

       -O3    Use the aggressive lossy PDF image optimization from OCRmyPDF.

       -p, --pool-size INTEGER RANGE
              Size  of  the  MultiProcessing  pool that handles page-by-page operations. Defaults to
              os.process_cpu_count() with a fallback to 2 * os.cpu_count()  [x>=1]

       --tmp DIRECTORY
              Override the default temporary directory (Python's tempfile.gettempdir() with a  pref‐
              erence for /var/tmp on Unix-like systems).

       --ocr JSON OBJECT
              Perform OCR via OCRmyPDF rather than trying to convert the text layer. If this parame‐
              ter has a value, it should be a JSON dictionary of options to be passed to OCRmyPDF.

       --socr COMMA-SEPARATED LANGUAGES
              "Streamlined" OCR; `--ocrs eng,grc` expands to `--ocr '{"language": ["eng", "grc"]}'`.

EXAMPLES
       Produce "file.pdf" in the current directory:

              dpsprep /wherever/file.djvu

       Produce "output.pdf" with reduced image quality and aggressive PDF image optimizations:

              dpsprep --quality=30 -O3 input.djvu output.pdf

       Produce an output file using a large pool of workers:

              dpsprep --pool=16 input.djvu

       Force all pages to be bitonal:

              dpsprep --mode bitonal input.djvu

       Force  bitonal  pages  but  leave  the  cover  page as-is (can be useful with badly digitized
       books):

              dpsprep --mode bitonal[2-end] input.djvu

       Produce an output file by disregarding the text layer and running OCRmyPDF instead:

              dpsprep --socr rus,eng,grc input.djvu

       Simply disregard the text layer without OCR:

              dpsprep --no-text input.djvu

2.8.3                                        2026-08-12                                   DPSPREP(1)

Usage:

Implementation details:

Clone this wiki locally