(Page 3 of 18 in this chapter)


nfxCheckTIFF

Description

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 CTA context 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 the array of NFX_CHECK_STATUS structures.

page_array Pointer to an array of NFX_CHECK_STATUS structures. The count of entries in the array equals the value for tracked_pages. The NFX_CHECK_STATUS structure is defined as follows:

typedef struct 
{
 DWORD size;     /* size of this structure           */
 DWORD resolution;     /* NFX_RESOLUTION_HIGH, NFX_RESOLUTION_LOW,           */
      /* or NFX_RESOLUTION_SUPER_HIGH           */
 DWORD encoding;     /* NFX_ENCODE_1D, NFX_ENCODE_2D, or           */
      /* NFX_ENCODE_MMR           */
 DWORD pagewidth;     /* NFX_PAGE_WIDTH_A4 or NFX_PAGE_WIDTH_B4 or           */
      /* NFX_PAGE_WIDTH_A3           */
 DWORD lines;      /* number of lines on the 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 the number of pages in the document is greater than the value of tracked_pages, the additional page 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. Use this array to examine the page attributes to find any 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.

Note: NaturalFax can transmit a file with bad lines, but it cannot transmit a file with different attributes on different pages.

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: 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 3 of 18 in this chapter)


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