1DDJVU(1)                         DjVuLibre-3.5                        DDJVU(1)
2
3
4

NAME

6       ddjvu - Command line DjVu decoder.
7
8

SYNOPSIS

10       ddjvu -format=fmt [options] [djvufile] [outputfile]
11
12

DESCRIPTION

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

MAIN OPTIONS

24       -format=fmt
25              Specify  the  output  file formats.  The recognized file formats
26              are pbm, pgm, ppm, pnm, rle, tiff, and pdf.
27
28              *  Formats pbm, pgm, and ppm  respectively  produce  a  Portable
29                 Bitmap  (PBM),  Portable  Graymap  (PGM),  or Portable Pixmap
30                 (PPM) file.  Format pnm produces a PBM, PGM,  or  PPM  output
31                 file according to the color content of the output image.
32
33              *  Format rle produces a compact run length encoded bitonal file
34                 that  is  understood  by  the  DjVuLibre  commands  cjb2  and
35                 csepdjvu.
36
37              *  Format  tiff produces a Tagged Image Format (TIFF) file using
38                 lossless compression.  Enabling lossy JPEG  compression  (see
39                 option  -quality  below)  often  produces much smaller files.
40                 Commands tiffcp(1) and tiffsplit(1) are useful for manipulat‐
41                 ing the resulting TIFF files.
42
43              *  Format  pdf  produces  a Portable Document Format (PDF) file.
44                 Each page in the resulting file is represented by an image at
45                 the   specified   resolution,   using  lossless  compression.
46                 Enabling lossy JPEG compression (see option  -quality  below)
47                 often  produces much smaller files.  An alternate way to pro‐
48                 duce PDF file consists in first using djvups(1)  and  convert
49                 the  resulting  PostScript  file  to PDF.  Which method gives
50                 better results depends on the contents of the DJVU  file  and
51                 on the capabilities of the PS to PDF converter.
52
53              When  option -format is not specified, the extension of argument
54              outputfile has  no  influence  on  the  default  output  format.
55              Instead the program behavior is modified to ensure backward com‐
56              patibility with previous versions of  ddjvu.   We  recommend  to
57              always specify the output format using this option.
58
59       -page=pagespec
60              Specify  which pages should be decoded.  When this option is not
61              specified, all pages of the documents are decoded  and  concate‐
62              nated  into  the  output  file.  The page specification pagespec
63              contains one or more comma-separated page ranges.  A page  range
64              is  either  a  page  number,  or two page numbers separated by a
65              dash.  For instance, specification 1-10 outputs pages 1  to  10,
66              and specification 1,3,99999-4 outputs pages 1 and 3, followed by
67              all the document pages in reverse order up to page 4.
68
69       -eachpage
70              When this option is specified, program ddjvu generates one sepa‐
71              rate  file  per  page named by replacing the %d specification in
72              outputfilename by the page number in a  manner  simular  to  the
73              printf(3) function.
74
75       -mode=mod
76              Selects  which  layers  of  the  DjVu  image should be rendered.
77              Valid rendering modes are color, black,  mask,  foreground,  and
78              background.
79
80              *  Rendering mode color is the default mode.  When the DjVu file
81                 is bitonal, bitonal or gray-level output is produced  depend‐
82                 ing  on  the  subsampling factor.  Otherwise a color image is
83                 produced.
84
85              *  Rendering mode black is useful to extract a meaningful  black
86                 and  white  image.   bitonal or gray-level output is produced
87                 depending on the subsampling factor.
88
89              *  Rendering modes mask, foreground, and background select  spe‐
90                 cific  layers  of  a DjVu image.  These modes can fail if the
91                 DjVu image does not contain the selected layer.
92
93       -skip  Instead of aborting when encountering  a  corrupted  page,  this
94              option  causes  ddjvu to simply skip the corrupted page and con‐
95              tinue with the next.  This is useful for processing certain dam‐
96              aged files.
97
98

RESOLUTION OPTIONS

100       The  following options control the resolution of the output image.  The
101       default resolution is the native resolution of the DjVu  file,  equiva‐
102       lent to selecting -1.
103
104       -n     Specify  an  integer sub-sampling factor.  The dimensions of the
105              full output image will be n times smaller than  the  DjVu  image
106              size.   The  legal  values  for  argument  n range from 1 to 12.
107              Option -1, for instance, produces an output image whose  resolu‐
108              tion is equal to the resolution of the input DjVu image file.
109
110       -subsample=n
111              This is equivalent to option -n.
112
113       -scale=mag
114              Specify a magnification factor relative to the resolution stored
115              in the DjVu image.  Specifying magnification of 100 produces  an
116              image suitable for displaying on a 100 dpi device such as a com‐
117              puter screen.  The magnification factor mag can also  be  inter‐
118              preted  as  the  resolution of the output image expressed in dot
119              per inch.
120
121       -size=wxh
122              Specify the size of the full output image.  Rendering  the  full
123              DjVu  image  would create an output image whose width and height
124              would not exceed w and h.  To change the aspect ratio, you  must
125              also use option -aspect=no.
126
127       -aspect=yesno
128              This  option  indicates whether the image aspect ratio should be
129              preserved.  The defaults is to preserve the aspect ration.  This
130              option permits changes in the aspect ratio when used in combina‐
131              tion with option -size.
132
133

OTHER OPTIONS

135       -verbose
136              Display informational messages describing the structure  of  the
137              DjVu image and the format of the output file.
138
139       -segment=wxh+x+y
140              Specify  an image segment to render.  Program ddjvu conceptually
141              renders the full page using the specified resolution,  and  then
142              extracts  a sub-image of width w and height h, starting at posi‐
143              tion (x,y) relative to the bottom left corner of the page.  Both
144              operations  of  course happen simultaneously.  Rendering a small
145              sub-image is much faster than rendering the complete image.  The
146              output file will always have size wxh when this option is speci‐
147              fied.
148
149       -quality=factor
150              Enables lossy JPEG compression for TIFF  and  PDF  files.   This
151              option only affects images that cannot be encoded using the pre‐
152              ferred TIFF/G4 compression.  Argument factor is  a  quantization
153              factor  ranging  from  25 to 150.  See command cjpeg(1) for more
154              information on JPEG quantization factors.  Value 80  is  a  good
155              starting point.
156
157       -quality=uncompressed
158              Completely disables compression in TIFF and PDF files.  Although
159              the resulting files are often huge, this is sometimes useful for
160              maximal compatibility with hastily written software.
161
162       -quality=deflate
163              Enables  DEFLATE compression for TIFF files.  Images that cannot
164              be encoded using  the  preferred  TIFF/G4  compression  will  be
165              encoded  with  DEFLATE  compression if available.  Otherwise the
166              more portable PACKBITS compression  is  used.   Specifying  this
167              option  is  not  necessary  for  PDF  files  because this is the
168              default behavior.
169
170

DEPRECATED OPTIONS

172       Various options have been maintained to ensure  backward  compatibility
173       with previous versions of ddjvu.  When option -format is not specified,
174       the program only decodes the first page of the document and the default
175       resolution  becomes  -scale=100.   Options -size, -scale, -segment, and
176       -page accept an argument separated by a  space.   Options  -foreground,
177       -background,  and  -black  are  shorthands  for  the  -mode=mod option.
178       Please do not rely on these features.
179
180
181

EXAMPLES

183       Command
184
185          ddjvu -format=tiff myfile.djvu myfile.tif
186
187       decodes all pages and produces a multipage TIFF file.
188
189       Command
190
191          ddjvu -format=ppm  -page=1-10  -eachpage  -size=100x100  myfile.djvu
192          thumb%03d.ppm
193
194       produces  100x100  thumbnails  for the first ten page of a document and
195       outputs them as PPM files named thumb001.ppm to thumb010.ppm.
196
197

CREDITS

199       The  new  version  of  this  program  was  written   by   Léon   Bottou
200       <leonb@users.sourceforge.net>.
201
202       This  program  includes  code derived from program tiff2pdf, written by
203       Ross Finlayson and released under a BSD license.
204
205

SEE ALSO

207       djvu(1), djview(1), pnm(5), pbm(5), pgm(5),  ppm(5),  cjpeg(1),  tiffs‐
208       plit(1), tiffcp(1), printf(3)
209
210
211
212DjVuLibre-3.5                     10/19/2002                          DDJVU(1)
Impressum