
Description | Cautions | Example | Source Code | Errors | See Also
Name: |
int fx_sendtiff(faxname, firstpg, pgcount, phdcont) | |
Inputs: |
char * faxname |
pointer to name of TIFF/F file to send |
|
unsigned long firstpg |
first page to send (0 = first page in file) |
|
unsigned long pgcount |
number of consecutive pages to send (-1 = send all remaining pages in file) |
|
unsigned short phdcont |
Phase D continuation value |
Returns: |
0 if success | |
|
-1 if failure | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
send fax | |
Mode: |
synchronous | |
|
||
The fx_sendtiff( ) function allows an application to send pages of a single TIFF/F file at the width and resolution set in the TIFF/F.
This function is a convenience function and is resident in faxconv.c. The fx_sendtiff( ) function calls fx_sendfax( ) as illustrated in the source code for fx_sendtiff( ). For detailed information on Phase D continuation values, status information and file error handling that apply to fx_sendtiff( ), see the fx_sendfax( ) function reference.
See Appendix A for a list of TIFF/F tags and values.
The encoding scheme used in transmitting fax data varies by product; for more information, see Section 2.4. Key Product Features on page . The preferred encoding scheme for transmission is determined by the value set in the FC_TXCODING parameter in fx_setparm( ).
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
int voxhandle; /* Voice channel device handle. */
int devhandle; /* Fax channel device handle. */
/*
* Open the channel using dx_open( ) to obtain the Dialogic
* VOICE device handle in voxhandle.
* Open the channel using fx_open( ) to obtain the FAX channel
* device handle in devhandle.
*/
/*
* Take channel offhook using dx_sethook( ) and perform outbound
* dial using dx_dial( ).
*/
.
.
/*
* Set the fax state of the channel to DF_TX using
* fx_initstat( ).
*/
.
.
/*
* Send 2 pages starting at page number 4, disconnect when
* finished.
*/
if (fx_sendtiff("document.tif",4L,2L,DFC_EOP) == -1) {
/* Process error. */
printf("Error - %s (error code %d)\n",
ATDV_ERRMSGP(devhandle), ATDV_LASTERR(devhandle));
if (ATDV_LASTERR(devhandle) == EDX_SYSTEM) {
/* Perform system error processing */
}
printf("Phase E status: %ld\n", ATFX_ESTAT(devhandle));
/* Application specific error handling. */
.
.
}
Source Code for fx_sendtiff( )
/*
* NOTE: devhandle is a global variable of type int. Prior to
* calling fx_sendtiff( ), the channel is opened using
* fx_open( ) to obtain the Dialogic FAX channel device handle in
* devhandle.
*/
DF_IOTT iott;
int fx_sendtiff(faxname,firstpg,pgcount,phdcont)
char * faxname;
unsigned long firstpg;
unsigned long pgcount;
unsigned short phdcont
{
int erc;
/* Open the file as read-only. */
if ((iott.io_fhandle = dx_fileopen(faxname,O_RDONLY|O_BINARY,0)) == -1) {
return(-1);
}
/*
* Set up the DF_IOTT structure as the default and then
* change the necessary fields.
*/
fx_setiott(&iott,iott.io_fhandle,DF_TIFF,phdcont);
iott.io_type |= IO_EOT;
iott.io_firstpg = firstpg;
iott.io_pgcount = pgcount;
erc = fx_sendfax(devhandle,&iott, EV_SYNC)
dx_fileclose(iott.io_fhandle);
return(erc);
}
See Appendix D for a list of error codes that may be returned for this function.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation