tiff2pdf – Convert TIFF Files to PDF

Version: 3.0

Part of DaVince Tools
Web Site: www.davince.com

Last Modified: July 8, 2004

Command Syntax

Description

Problem TIFF Files

New Features / Changes

Additional Information

About DaVince Tools


Command Syntax

Refer to the "DaVince Tools" Converters page for a description of the command line syntax for all converters.

Description

"tiff2pdf" is a command line program that converts TIFF (Tagged Image File Format) files to PDF (Portable Document Format) files (for a Windows interface to this program, see wdavince). The program can convert a TIFF file by either recompressing the data for PDF use or taking the raw image data from the file "as is" and putting it into a PDF wrapper when possible. This analogous to removing a letter from a letter size envelope and placing it in a business size envelope. The original image data is unaltered, so no data recompression is required (not all TIFF raw image data is compatible with PDF; these files will automatically be recompressed). The key features of this program are: The following TIFF tags are required in order for the file to be converted. If any of these tags are missing, the application will skip over the image. The "tiffdump" program, part of DaVince Tool set, can be used to display the tags of a TIFF file.
 
ImageLength The # of scan lines of an image
ImageWidth The # of pixels in a scan line of an image
Compression The type of compression used (valid values are: 2 (Modified Huffman), 3 (Group 3) and 4 (Group 4)
StripOffsets/TileOffsets Array of one or more offsets to image data
StripByteCounts/TileByteCounts Array of one or more values of lengths pointed to by the StripOffsets tag for stripped images, or TileOffsets for tiled images
TileLength The # of scan lines in a tile (only required for tiled Tiff images)
TileWidth The # of pixels in a scan line in a tile (only required for tiled Tiff images)

The following TIFF tags are recognized by tiff2pdf but are not required for a conversion.
 
NewSubFileType Used to skip over thumb nail and transparency mask images
Xresolution The scan resolution in the X direction. If this tag is not present, then either 300 dpi or the resolution specified by the DefaultDPI option is used.
Yresolution The scan resolution in the Y direction. If this tag is not present, then either 300 dpi or the resolution specified by the DefaultDPI option is used.
ResolutionUnit Used to specify the XResolution and Yresolution tags are in inches or centimeters (default is ‘inches’ if tag is not present)
BitsPerSample Number of bits per component.
SamplesPerPixel The number of components per pixel. SamplesPerPixel is usually 1 for bilevel, grayscale, and palette-color images. SamplesPerPixel is usually 3 for RGB images.
T4Options Used to determine 1 or 2 dimensional encoding and byte aligned rows for compression type 2.
PhotometricInterpretation Used to determine if the data is black and white, pallete color, RGB color, CMYK color or grayscale. For black and white data, this also specifies if the zero pixel is either black or white
FillOrder The program supports the FillOrder tag.

The height, width and resolution tags are used to determine the physical page size. For example, an image 2,544 pixels wide and 3,287 pixels long and scanned at 300 DPI results in a PDF page size of 2,544/300 by 3,287/300, or 8.48 inches wide by 10.96 inches long. The resulting page size may not match a standard paper size, however, this is not a problem for viewers like Adobe Acrobat. The advantage to this method is that a multiple page conversion can contain images scanned at different sizes. This allows, for example, a converted PDF file to contain both U.S. letter and legal size pages, as well as differing European sizes (A1, A2, etc.) or even a combination of the two.

The screen output can be redirected to a file adding the DOS syntax ">filename" to the end of the command line. This can be used to redirect output to a log file. The program returns an error code of 1 when a fatal error occurs, used in batch programs to test the success of the program.

The initialization file and the use of profiles is described in the "DaVince Tools" Converters page. In addition to the default profile, the following sample profiles are defined in the tiff2pdf.ini file that ships with the program:
 
Profile Name Description
quick Best for compression speed, no bookmarks or thumbnails.
quickbookmark Best for compression speed, with bookmarks.
archive Best for optimal file size, no bookmarks or thumbnails.
bookmark Best for optimal file size, with bookmarks.
thumbnail Best for optimal file size with bookmarks and thumbnails.

 

Common Profile Settings

Refer to the "DaVince Tools" Converters page for a description of the common profile settings.

Converter Specific Settings

The following table describes tiff2pdf settings that are unique to this converter (options are case insensitive):
 
Option Data Type Description
Archive Bool When true, compress image data in an optimal manner. When archive option is set to true, converted page indicator is a plus sign ("+"). When archive option is set to false, converted page indicator is a period ("."). Archive mode is automatically turned on for image formats that are not supported natively in PDF (PackBits and CCITT Group 3 with unsupported Group 3 options are examples). The default is false.
DamagedRowCount Number This parameter is used when a TIFF file was received from a Group 3 Facsimili device and contains transmission errors. Setting this parameter to a positive number will allow the PDF reader to accept files with damaged rows up to this value. A value of "1" or "2" may be sufficient for most users. This parameter is only used with Group 3 files. Group 4 files are not affected. This option is not used when "archive" is set to true. By default, this value is "0" (no damaged rows allowed).
DefaultDPI Number (in DPI) Default resolution to use if resolution tag is not present. The program will assume 300 DPI if this option not present.
MaxImageSize
Number (in MB) Maximum image size (in megabytes) in the PDF file. Images larger than this size will be split into 2 or more smaller images not to exceed this value. The default settings is 20 MB.
ThumbnailTagThreshold *
-1, 0 or number in DPI
This option overrides the TIFF thumbnail tag. This is typically used when the TIFF file has the wrong setting for the thumbnail tag. TIFF images flagged as thumbnails are not converted to PDF.  A value of -1 indicates the program should strictly follow the thumbnail tag setting (the default). A value of 0 indicates to ignore the thumbnail tag completely and convert all images to PDF. A number greater than zero indicates the threshold, in DPI, to use to indicate if the image is a thumbnail. For example, if the threshold is set to 400, a 320x200 image would be considered a thumbnail and not be converted to PDF, whereas a 640x480 image would not be considered a thumbnail and will be converted to PDF.
Transparency Bool When true, make image background transparent, useful with other programs that create watermarks. When false, make image background opaque. If using Acrobat Capture for OCR conversion with the resulting PDF file, this must be set to false. The default value is false.
Thumbnail Bool Create thumbnail images. Note that this will increase processing time, even when the "Archive" option is set to false. The default is false.

* New in 3.0


Problem TIFF Files:

Not all TIFF files can be converted with this application. One should verify the correctness of the conversion by viewing the PDF file with a PDF viewer. Listed below are reasons why a TIFF file may not be converted: Bit 2 is 1 if fill bits have been added as necessary before EOL codes such that EOL always ends on a byte boundary, thus ensuring an EOL-sequence of 1 byte preceded by a zero nibble: xxxx-0000 0000-0001.

New Features / Changes:

A list of new features and changes, along with a version history, can be found in the release notes.

Additional Information:

Any DaVince Tool product that creates a PDF must create an intermediate file prior to writing the PDF file. The filename of this intermediate file begins with "tmps" and appears in the directory pointed to by the environment variable "TMP". If this environment does not exist, then the temporary file is written in the current directory. The intermediate file exists only during the execution of the program.

About DaVince Tools:

Visit the DaVince Tools web site at http://www.davince.com for the latest version of this software and the latest documentation. DaVince Tools is shareware and software registration is urged if you find these programs useful. You can register the software on-line at http://www.davince.com.

DaVince Tools was written in C++ using the DaVince Class Library, written by the same author as this program. The DaVince Class Library is a C++ library for developing PDF and TIFF applications. Contact the author at info@davince.com for more information on the availability of the class library.