FFAscii2Tiff
convert a TXT file to several TIFF files

Prototype

Put the following prototype in the prototypes section of the application program header file:

int  ( __stdcall *pfnFFAscii2Tiff )( HWND, char*, int, char*, char*, int, char*, char*, char* );

Purpose

The purpose of this routine is to create a set of TIFF files out of a text file. You can see the images on the PC screen as the TIFF files are being created. A set of ready to use TIFF files are generated on the hard disk.

Description and use

Some old applications generate ASCII text files. To integrate these documents into an optical document storage and retrieval system you should convert them ingo TIFF files. This is a consistent way to deal with different kind of documents, according to the opinion of my friend Maurizio that asked me for this kind of routine.

Usually the text file is a printer output, which contains control characters. These characters are recognized by this routine.

There is nothing special using this routine, see the example below.

Specification

The output image in the generated TIFF files is a 1664 by 2336 pixels, black & white. Top and left borders: 15 mm. Bottom and right borders: 10 mm. Number of rows per page: 97. Control characters processed: carriage return, line feed, form feed and end of file.

Parameters
  • handle to the window of the calling program
  • pointer to the path and filename of the text file to convert
  • file name starting number e.g. if you set 5 the result files will be named 00000005.TIF, 00000006.TIF, 00000007.TIF and so forth until there are no more lines to print (at 97 lines per page)
  • pointer to the path of the destination directory (an ASCIIZ string, TIFF files will be created there)
  • pointer to the comment (an ASCIIZ string that will be written into the ImageDescription tag of the output TIFF files)
  • starting page number page numbering will be printed top right of the image (pass 0 to avoid page numbering)
  • pointer to the first line in the page header (an ASCIIZ string)
  • pointer to the second line in the page header (an ASCIIZ string)
  • pointer to the third line in the page header (an ASCIIZ string)

Return value

The function returns an integer: the number of TIFF files that have been created in the destination directory.

Application example

See also
No reference material.

Notes