Using documenttodjvu to Create Multiple-Page DjVu Files
Troubleshooting Information for PDF Support in documenttodjvu
The documenttodjvu command encodes raster image files into DjVu® documents (for more information about these types of images, see Color DjVu Documents).
The documenttodjvu command can also be used to rasterize and convert PDF and PS files, provided that the PDFtoDjVu Converter (pdftodjvu, or more specifically, GhostScript) has been correctly installed and configured (see Troubleshooting Information for PDF Support in documenttodjvu below). For most PDF files containing only raster images, documenttodjvu yields better results. If the file contains fonts, bookmarks and other vector data, then the PDFtoDjVu Converter should be used.
NOTE: the defaults for the documenttodjvu command are different from those of the PDFtoDjVu Converter.
documenttodjvu [options...] <inputfile> <[inputfile...]> <outputfile|outputdir>
options – Specifies an optional encoding requirement. You can specify multiple
options each time you run a command. See table below.
documenttodjvu
Options |
|
|
|
--dpi=<-1200 to -25, 0, 25 to 1200> |
|
|
|
|
|
--jb2-format=<bitonal, color, none> |
|
|
inputfile – Specifies the name of the input image file. Additional input file names are optional to create a DjVu document that contains multiple pages. If you do not want to type each file name individually, create a filelist text file that specifies all the input files to be encoded. For more information, see the filelist command option.
outputfile|outputdir – Specifies a name for either the output DjVu file (if you are creating a single-page DjVu document or a multiple-page bundled DjVu document) or the output directory (if you are creating a multiple-page indirect DjVu document). For more information, see the Bundled DjVu Documents and Indirect DjVu Documents topics.
NOTE: If the path does not exist then it is created. This was not the case
prior to version 5.0.
documenttodjvu
--page-range=1,4,5-8 file1.tiff outputfile.djvu
documenttodjvu
--lossless file1.tiff file2.tiff file3.pnm outputdir
documenttodjvu
--pages-per-dict=5 file1.tiff outputfile.djvu
You can use documenttodjvu to create multiple-page DjVu documents that are either bundled or indirect. For information about these formats, see the topics Bundled DjVu Documents and Indirect DjVu Documents.
Document Express generates a bundled DjVu document when you list multiple input image files after documenttodjvu and specify an output name that is a DjVu file. For example:
documenttodjvu
beagle.tiff collie.jpeg chihuahua.jpeg dogs.djvu
Using documenttodjvu in this manner results in a bundled DjVu file, dogs.djvu, that contains three pages, one for each encoded image.
To create an indirect DjVu document, list several input image files after documenttodjvu and specify an output name that is an existing directory. For example:
documenttodjvu
beagle.tiff collie.jpeg chihuahua.jpeg dogs
In this example, documenttodjvu creates an index.djvu file and the following DjVu files: beagle.djvu, collie.djvu, and chihuahua.djvu. The index.djvu file displays three pages, each of which references one of the DjVu files. All of these files comprise the indirect DjVu document and are placed in the dogs directory.
NOTE: All input image files must be located in the same directory to create an indirect DjVu document.
To support PDF and PS files, documenttodjvu depends on the PDF2DJVUDIR environment variable to find the GhostScript PDF-rendering application. On Win32 systems the installer sets this variable to point to the parent directory of GhostScript:
F:\work>echo
%PDF2DJVUDIR% e:\Program Files\LizardTech\Lizardtech Document Express
Enterprise 5.1
If this variable is
not set, docmenttodjvu checks to see if GhostScript is available
in the standard path. If it is not, then the conversion fails:
F:\work>set
PDF2DJVUDIR=
F:\work>echo
%PDF2DJVUDIR%
%PDF2DJVUDIR%
F:\work>documenttodjvu
--profile=scan300 korean1.pdf korean1.djvu
Error:
[1-30701] Unsupported IO format
Known Issue – This process creates large temp files as the PDF document is rasterized to TIFF format. If the system runs out of disk space the user may encounter error messages referencing “unsupported tiff variants”.
See also phototodjvu.