(Page 6 of 19 in this chapter)


nfxConvertFileDirect

Description

This function performs file format conversion on TIFF-F files.

Prototype

DWORD nfxConvertFileDirect (CTAHD ctahd,
char *input_file,
char *output_file,
NFX_CONVERT_PARMS *ptr_convert_parms,
DWORD *ptr_converted_pages)

ctahd Handle returned by ctaCreateContext

input_file Name of an existing file to be converted

output_file Name of file to be created to
receive the conversion output

ptr_convert_parms Pointer to a structure of parameters which identifies the expected input format and selection options for the output format. The NFX_CONVERT_PARMS structure is defined as follows:

typedef struct
{
DWORD size; /* size of this structure */
DWORD type; /* NFX_TIFF_F */
DWORD resolution; /* NFX_RESOLUTION_HIGH */
/* NFX_RESOLUTION_LOW */
/* NFX_RESOLUTION_SUPER_HIGH */
DWORD encoding; /* NFX_ENCODE_1D or NFX_ENCODE_2D */
DWORD pagewidth; /* NFX_PAGE_WIDTH_A4 */
/* NFX_PAGE_WIDTH_B4 */
/* NFX_PAGE_WIDTH_A3 */
DWORD badlineaction; /* NFX_BAD_LINE_ACTION_DROP */
/* NFX_BAD_LINE_ACTION_REPT */
/* NFX_BAD_LINE_ACTION_TICK */
} NFX_CONVERT_PARMS;
ptr_converted_pages Pointer to a location to receive a count of the number of pages converted

Return Values

Events

Details

This function may be used to modify the encoding, resolution, and page width of the input file to match the attributes specified in the NFX_CONVERT_PARMS structure. This function also removes bad lines (as specified by the badlineaction parameter) from a TIFF-F file. nfxConvertFileDirect can accept an input file that has different attributes on different pages and produce an output file that has the same attributes on all pages.

nfxConvertFileDirect operates only on TIFF-F files. Output files are always in TIFF-F format, and always have the same attributes on all pages.

This function is synchronous and consumes significant processor execution time. Pending events in this thread may be delayed by many seconds until this function completes. Note that errors occurring during the conversion process are indicated in the function return value. The number of pages converted successfully is given in ptr_converted_pages.

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 format conversion, 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

nfxCheckTIFF



(Page 6 of 19 in this chapter)


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