Specify the output file formats.
The recognized file formats are
|When option -format is not specified, the extension of argument outputfile has no influence on the default output format. Instead the program behavior is modified to ensure backward compatibility with previous versions of ddjvu. We recommend to always specify the output format using this option.|
|Specify which pages should be decoded. When this option is not specified, all pages of the documents are decoded and concatenated into the output file. The page specification pagespec contains one or more comma-separated page ranges. A page range is either a page number, or two page numbers separated by a dash. For instance, specification 1-10 outputs pages 1 to 10, and specification 1,3,99999-4 outputs pages 1 and 3, followed by all the document pages in reverse order up to page 4.|
Selects which layers of the DjVu image should be rendered.
Valid rendering modes are
Instead of aborting when encountering a corrupted page,
this option causes
ddjvu to simply skip the corrupted page and continue with the next.
This is useful for processing certain damaged files.
The following options control the resolution of the output image. The default resolution is the native resolution of the DjVu file, equivalent to selecting -1.
-n Specify an integer sub-sampling factor. The dimensions of the full output image will be n times smaller than the DjVu image size. The legal values for argument n range from 1 to 12. Option -1, for instance, produces an output image whose resolution is equal to the resolution of the input DjVu image file. -subsample=n This is equivalent to option -n. -scale=mag Specify a magnification factor relative to the resolution stored in the DjVu image. Specifying magnification of 100 produces an image suitable for displaying on a 100 dpi device such as a computer screen. The magnification factor mag can also be interpreted as the resolution of the output image expressed in dot per inch. -size=wxh Specify the size of the full output image. Rendering the full DjVu image would create an output image whose width and height would not exceed w and h. To change the aspect ratio, you must also use option -aspect=no. -aspect=yesno This option indicates whether the image aspect ratio should be preserved. The defaults is to preserve the aspect ration. This option permits changes in the aspect ratio when used in combination with option -size.
-verbose Display informational messages describing the structure of the DjVu image and the format of the output file. -segment=wxh+x+y Specify an image segment to render. Program ddjvu conceptually renders the full page using the specified resolution, and then extracts a sub-image of width w and height h, starting at position (x,y) relative to the bottom left corner of the page. Both operations of course happen simultaneously. Rendering a small sub-image is much faster than rendering the complete image. The output file will always have size wxh when this option is specified. -quality=factor Enables lossy compression in TIFF and PDF files. Without this option, TIFF or PDF output files always use lossless compression or no compression. Argument factor specifies a JPEG quantization factor ranging from 25 to 150. See command cjpeg(1) for more information on JPEG quantization factors. Value 80 is a good starting point. -quality=uncompressed Completely disables compression in TIFF and PDF files. Although the resulting files are often huge, this is sometimes useful for maximal compatibility with hastily written software.
Various options have been maintained to ensure backward compatibility with previous versions of ddjvu. When option -format is not specified, the program only decodes the first page of the document and the default resolution becomes -scale=100. Options -size, -scale, -segment, and -page accept an argument separated by a space. Options -foreground, -background, and -black are shorthands for the -mode=mod option. Please do not rely on these features.
decodes all pages and produces a multipage TIFF file.
ddjvu -format=tiff myfile.djvu myfile.tif
produces a thumbnail for the first page of a document and outputs it as a PPM file on the standard output.
ddjvu -format=ppm -page=1 -size=100x100 myfile.djvu -
The new version of this program was written by L146;eon Bottou <email@example.com>.
This program includes code derived from program tiff2pdf, written by Ross Finlayson and released under a BSD license.