documenttodjvu

Synopsis
Parameters
Examples

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.

 

Synopsis

documenttodjvu [options...] <inputfile> <[inputfile...]> <outputfile|outputdir>

 

Parameters

optionsSpecifies an optional encoding requirement. You can specify multiple options each time you run a command. See table below.

 

documenttodjvu Options

Setup options

--profile=<name>

--config=<filename>

--filelist=<filename>

--page-range=<range>

 

Transform options

--dpi=<-1200 to -25, 0, 25 to 1200>

--vflip

--hflip

--rotate=<angle>

--invert

--togray

--upsample=<factor>

--subsample=<factor>

--tobitonal=[<1-255>]

--black-normalize=<-1, 0-100>

--white-normalize=<-1, 0-100>

--scale-normalize=<1- >

 

Segmenter options

--background-floss

--pix-filter-level=<0-100>

--shape-filter-level=<0-100>

--threshold-level=<0-100>

--inversion-level=<0-100>

--subsample-refine

--fg-subsample=<1-12>

--bg-subsample=<1-6>

--mask-upsample=<1-3>

--resolution-multiplier=<1-2>

 

Background options

--quality=<1-100>

--gamma=<0.3-5.0>

--sizes=#,#,#,...

--slices=#,#,#,...

--decibels=#.#,#.#,#.#,...

--crcbnormal

--crcbfull

--crcbhalf

--crcbnone

--crcbdelay=<1-32>

 

Text options

--normal

--conservative

--aggressive

--lossless

--fg-quality=<1-100>

--disable-halftone

--pages-per-dict=<value>

--jb2-format=<bitonal, color, none>

 

Other options

--help

--version

--verbose

 

 

inputfileSpecifies 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|outputdirSpecifies 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.

 

Examples

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

 

Using documenttodjvu to Create Multiple-Page DjVu Files

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.

 

Troubleshooting Information for PDF Support in documenttodjvu

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.