1DDJVU(1) DjVuLibre-3.5 DDJVU(1)
2
3
4
6 ddjvu - Command line DjVu decoder.
7
8
10 ddjvu -format=fmt [options] [djvufile] [outputfile]
11
12
14 Decode the DjVu file djvufile, produces the image file outputfile.
15
16 The DjVu data is read from the standard input when argument djvufile is
17 not specified or when it is equal to a single dash. Similarly, the
18 output data is written to the standard output when argument outputfile
19 is not specified or equal to a single dash. However a valid output
20 file name is always required when producing a TIFF or PDF file.
21
22
23
25 -format=fmt
26 Specify the output file formats. The recognized file formats
27 are pbm, pgm, ppm, pnm, rle, tiff, and pdf.
28
29 * Formats pbm, pgm, and ppm respectively produce a Portable
30 Bitmap (PBM), Portable Graymap (PGM), or Portable Pixmap
31 (PGM) file. Format pnm produces a PBM, PGM, or PPM output
32 file according to the color content of the output image.
33
34 * Format rle produces a compact run length encoded bitonal file
35 that is understood by the DjVuLibre commands cjb2 and
36 csepdjvu.
37
38 * Format tiff produces a Tagged Image Format (TIFF) file. The
39 resulting file uses the best available lossless compression
40 model. Enabling lossy JPEG compression (see option -quality
41 below) often produces much smaller files. Commands tiffcp(1)
42 and tiffsplit(1) are useful for manipulating the resulting
43 TIFF files.
44
45 * Format pdf produces a Portable Document Format (PDF) file.
46 Each page in the resulting file is represented by an image at
47 the specified resolution, using the best available lossless
48 compression model. Enabling lossy JPEG compression (see
49 option -quality below) often produces much smaller files. An
50 alternate way to produce PDF file consists in first using
51 djvups(1) and convert the resulting PostScript file to PDF.
52 Which method gives better results depends on the contents of
53 the DJVU file and on the capabilities of the PS to PDF con‐
54 verter.
55
56 When option -format is not specified, the extension of argument
57 outputfile has no influence on the default output format.
58 Instead the program behavior is modified to ensure backward com‐
59 patibility with previous versions of ddjvu. We recommend to
60 always specify the output format using this option.
61
62 -page=pagespec
63 Specify which pages should be decoded. When this option is not
64 specified, all pages of the documents are decoded and concate‐
65 nated into the output file. The page specification pagespec
66 contains one or more comma-separated page ranges. A page range
67 is either a page number, or two page numbers separated by a
68 dash. For instance, specification 1-10 outputs pages 1 to 10,
69 and specification 1,3,99999-4 outputs pages 1 and 3, followed by
70 all the document pages in reverse order up to page 4.
71
72 -mode=mod
73 Selects which layers of the DjVu image should be rendered.
74 Valid rendering modes are color, black, mask, foreground, and
75 background.
76
77 * Rendering mode color is the default mode. When the DjVu file
78 is bitonal, bitonal or gray-level output is produced depend‐
79 ing on the subsampling factor. Otherwise a color image is
80 produced.
81
82 * Rendering mode black is useful to extract a meaningful black
83 and white image. bitonal or gray-level output is produced
84 depending on the subsampling factor.
85
86 * Rendering modes mask, foreground, and background select spe‐
87 cific layers of a DjVu image. These modes can fail if the
88 DjVu image does not contain the selected layer.
89
90
92 The following options control the resolution of the output image. The
93 default resolution is the native resolution of the DjVu file, equiva‐
94 lent to selecting -1.
95
96 -n Specify an integer sub-sampling factor. The dimensions of the
97 full output image will be n times smaller than the DjVu image
98 size. The legal values for argument n range from 1 to 12.
99 Option -1, for instance, produces an output image whose resolu‐
100 tion is equal to the resolution of the input DjVu image file.
101
102 -subsample=n
103 This is equivalent to option -n.
104
105 -scale=mag
106 Specify a magnification factor relative to the resolution stored
107 in the DjVu image. Specifying magnification of 100 produces an
108 image suitable for displaying on a 100 dpi device such as a com‐
109 puter screen. The magnification factor mag can also be inter‐
110 preted as the resolution of the output image expressed in dot
111 per inch.
112
113 -size=wxh
114 Specify the size of the full output image. Rendering the full
115 DjVu image would create an output image whose width and height
116 would not exceed w and h. To change the aspect ratio, you must
117 also use option -aspect=no.
118
119 -aspect=yesno
120 This option indicates whether the image aspect ratio should be
121 preserved. The defaults is to preserve the aspect ration. This
122 option permits changes in the aspect ratio when used in combina‐
123 tion with option -size.
124
125
127 -verbose
128 Display informational messages describing the structure of the
129 DjVu image and the format of the output file.
130
131 -segment=wxh+x+y
132 Specify an image segment to render. Program ddjvu conceptually
133 renders the full page using the specified resolution, and then
134 extracts a sub-image of width w and height h, starting at posi‐
135 tion (x,y) relative to the bottom left corner of the page. Both
136 operations of course happen simultaneously. Rendering a small
137 sub-image is much faster than rendering the complete image. The
138 output file will always have size wxh when this option is speci‐
139 fied.
140
141 -quality=factor
142 Enables lossy compression in TIFF and PDF files. Without this
143 option, TIFF or PDF output files always use lossless compression
144 or no compression. Argument factor specifies a JPEG quantiza‐
145 tion factor ranging from 25 to 150. See command cjpeg(1) for
146 more information on JPEG quantization factors. Value 80 is a
147 good starting point.
148
149
151 Various options have been maintained to ensure backward compatibility
152 with previous versions of ddjvu. When option -format is not specified,
153 the program only decodes the first page of the document and the default
154 resolution becomes -scale=100. Options -size, -scale, -segment, and
155 -page accept an argument separated by a space. Options -foreground,
156 -background, and -black are shorthands for the -mode=mod option.
157 Please do not rely on these features.
158
159
160
162 Command
163
164 ddjvu -format=tiff myfile.djvu myfile.tif
165
166 decodes all pages and produces a multipage TIFF file.
167
168 Command
169
170 ddjvu -format=ppm -page=1 -size=100x100 myfile.djvu -
171
172 produces a thumbnail for the first page of a document and outputs it as
173 a PPM file on the standard output.
174
175
177 The new version of this program was written by Léon Bottou
178 <leonb@users.sourceforge.net>.
179
180 This program includes code derived from program tiff2pdf, written by
181 Ross Finlayson and released under a BSD license.
182
183
185 djvu(1), djview(1), pnm(5), pbm(5), pgm(5), ppm(5), cjpeg(1), tiffs‐
186 plit(1), tiffcp(1)
187
188
189
190DjVuLibre-3.5 10/19/2002 DDJVU(1)