Input and output

tiff2afp can process either standard input or multiple files specified on the command line. If no input file is specified, stdin is assumed. Standard input is cached to a file (see the -wrkdir option) and then processed. Only a single TIFF file should be submitted using stdin. If multiple TIFF files are concatenated using standard input, all except the first one are ignored.

If an input file is specified on the command line, it can be either a TIFF file, a directory, or a file list (-f and @ prefixes). Multiple input file specifications are allowed. The transform processes each file in the order in which it was specified on the command line. If the -z option is specified, a list of file names to be processed is also submitted using standard input. The files on the list are processed as if the list were given using the -f option on the same place on the command line as -z.

If the file name points to a directory, tiff2afp processes every file in that directory. The files are processed in the order they would be shown using the ls -a command. Directory search is not recursive, that is, the subdirectories are not searched.

If the file name is preceded by the -f option or the at sign (@), tiff2afp assumes that the file contains the list of TIFF files to be processed. Each of the files in the list is processed in the order it was listed.

If a TIFF file has the extension .tif, .tiff, .TIF, or .TIFF, this extension need not be given explicitly. tiff2afp first tries to open the file as specified, and if unsuccessful, tries to append the extensions .tif.tiff, .TIF, and .TIFF in turn.

For example, suppose that:

  • The directory tFiles contains the files file1.tif, file2.tif, file3.tif, and file4.tif and nothing else.
  • The file flist in the current directory contains the two file names tFiles/file2.tif and tFiles/file3.tif. The names listed in the file list can have their extensions omitted.
  • The file flist2 contains the file name tFiles/file4. Again, the names listed in the file list can have their extensions omitted.

To process files file1.tif, file2.tif, file3.tif, and file4.tif, any of these invocations of tiff2afp would work:

tiff2afp tFiles/file1.tif tFiles/file2.tif tFiles/file3.tif
tFiles/file4.tif
tiff2afp tFiles/file1 tFiles/file2 tFiles/file3 tFiles/file4
tiff2afp tFiles/file*.tif
tiff2afp tFiles
tiff2afp tFiles/file1 -fflist tFiles/file4
tiff2afp tFiles/file1 -f flist tFiles/file4
tiff2afp tFiles/file1 -f flist -f flist2
tiff2afp tFiles/file1 @flist @flist2

Note: With InfoPrint Manager for Windows, you can enter separators in path names as backward slashes or forward slashes.

The file list files allow the display text to be added for each file. A display text is any text starting with the pound character (#) and extending to the end of the line. The display text should follow the file name, and can extend over several lines, up to 2048 characters long. The initial # character on each line is discarded. If a display text is present for a file name, that text is displayed in the status and error messages instead of the file name. This is useful if the tiff2afp is invoked using temporary files whose names are meaningless to the user. Any display text before the first file name is treated as comment and discarded. Display text is allowed also if you use the -z option to submit the file list via standard input.

TIFF files can contain multiple images. The tiff2afp transform can process and output all the images in the file, both full and reduced resolutions, subject to the values given in the -choice and -p options. Transparency maps are ignored. If the page numbers are available in the TIFF data, the pages are sorted on output. The pages are not sorted across file boundaries.

The output file name can be either specified explicitly using the -o option or derived from the input file name. If multiple input files have been specified, the default output file is standard output. If a single input file is given and the output file is not specified explicitly, the transform strips the .tif or .tiff extension from the input file name (if one is present) and appends the .afp extension for AFP output or the .ps extension for PostScript output to get the output file name.

To disable automatic output file name generation and force the default output stream to be the standard output in all cases, set the environment variable TIFF2AFP_o to - or stdout, or, alternatively, put the line o=- or o=stdout into the configuration file and invoke that configuration file using the -C option or the TIFF2AFP_C environment variable.

For example, all these commands:

tiff2afp myfile
tiff2afp myfile.tif
tiff2afp myfile -o myfile.afp
have myfile.afp as the output file. There is no requirement for the explicitly specified input and output files to have .tif and .afp extensions. To process TIFF file foo.bar into an AFP file foo.bar2, invoke the transform using:
tiff2afp foo.bar -o foo.bar2

The output data stream is MODCA-P or PostScript Level 2. MODCA-P data can be encoded as IM1 or IOCA Function Sets (FS) 10, 11, 42, or 45. IM1 images are bi-level and uncompressed. Function Set 42 is tiled, while Function Sets 10 and 11 are not. All IOCA function sets can contain bi-level image data. In addition, Function Set 11 can also contain 4- and 8-bit grayscale, as well as 24-bit (8 bits per plane) YCbCr color. In addition to bi-level images, Function Set 42 can also contain 4-bit (1 bit per plane) CMYK data. The InfoPrint Color 100 AFP printer fully implements IOCA FS42. Function Set 45 is a superset of FS42 and supports 32-bit (8 bits per plane) CMYK images, as well as transparency masks and different relative resolutions. FS45 is implemented in the InfoPrint Color 130 Plus printer.

While FS45 and FS42 can contain an image divided into a number of tiles, the transform currently outputs the image in a single tile. The IOCA output image data can be either uncompressed or compressed using one of several algorithms (see the -cmp option). The default compression algorithm for bi-level image data is ITU-TSS T.6 Group 4, while the compression algorithm for grayscale and YCbCr defaults to no compression. CMYK images in FS42 are carried in the planar (banded) format, and each band is compressed separately as a bi-level image.

The default compression for FS45 output is JPEG, which is downsampled by a factor of two. Use -cmp lzw to obtain LZW-uncompressed, unsubsampled output.

Note: LZW compression should be used only for linework images and not for continuous tone images.

PostScript Level 2 images can be uncompressed or ITU-T T.6 Group 4 bi-level, uncompressed 8-bit grayscale or uncompressed 24-bit RGB color. By default, the transform leaves scaling and halftoning to the printer (that is, color TIFF images are output as 24-bit RGB color images).