(Page 5 of 19 in this chapter)


nfxCheckTIFF

Description

This function verifies that the specified file is in TIFF-F format, and analyzes the attributes of the TIFF-F file.

Prototype

DWORD nfxCheckTIFF (CTAHD ctahd,
char *input_file_name,
DWORD *number_of_pages,
DWORD tracked_pages,
NFX_CHECK_STATUS *page_array)

ctahd Handle returned by ctaCreateContext

input_file_name Name of file to check for TIFF-F format

number_of_pages Pointer to the location that receives the number of pages in the input file

tracked_pages Number of pages to be reported in NFX_CHECK_STATUS structures

page_array Pointer to an array of NFX_CHECK_STATUS structures; the structure is defined as follows:

typedef struct
{
DWORD size; /* size of this structure */
DWORD resolution ; /* NFX_RESOLUTION_HIGH */
/* NFX_RESOLUTION_LOW */
/* NFX_RESOLUTION_SUPER_HIGH */
DWORD encoding; /* NFX_ENCODE_1D */
/* NFX_ENCODE_2D */
DWORD pagewidth; /* NFX_PAGE_WIDTH_A4 */
/* NFX_PAGE_WIDTH_B4 */
/* NFX_PAGE_WIDTH_A3 */
DWORD lines; /* Total number of lines on page */
DWORD badlines; /* Number of bad lines on the page */
} NFX_CHECK_STATUS;

Return Values

Events

Details

NaturalFax can transmit only files in TIFF-F format. nfxCheckTIFF reads and analyzes a specified file, and stores the attributes of each page in a separate NFX_CHECK_STATUS structure in a returned array of NFX_CHECK_STATUS structures. The function fills in one structure per page until there are no more structures. If no pointer to page_array has been passed to nfxCheckTIFF, the information is not stored. If there are more pages in the document than there are structures in the array, the additional information is not stored, but is still used to determine the return value for the function.

When nfxCheckTIFF returns NFXERR_CHECK_BAD_LINES, or NFXERR_CHECK_DIFF_ATTRIB, it indicates a problem in the TIFF-F file, but still produces a valid NFX_CHECK_STATUS structure array. This array can be used to examine the page attributes to find out if there are bad lines. The application can call nfxConvertFileDirect to remove the bad lines, or to force all the pages of the document to use the same attributes.

If a file contains both bad lines and different attributes on different pages, nfxCheckTIFF returns NFXERR_CHECK_DIFF_ATTRIB. Keep in mind that a file with bad lines can be transmitted by NaturalFax, but a file with different attributes on different pages cannot be transmitted by NaturalFax.

When nfxCheckTIFF encounters a problem before it fills the array, it returns an error code other than NFXERR_CHECK_BAD_LINES, or NFXERR_CHECK_DIFF_ATTRIB. In these cases, the information returned in the NFX_CHECK_STATUS structures may be incomplete.

Note: Keep in mind that you must continue processing events during an active fax session. Make sure that file I/O intensive operations, such as TIFF-F format verification, do not interfere with the handling of events and cause the fax session to time out. Events should be processed within three seconds.

See Also

nfxConvertFileDirect



(Page 5 of 19 in this chapter)


tech_support@nmss.com
Copyright © 1997, Natural MicroSystems, Inc. All rights reserved.