Dialogic 6.2 Manuale Utente

Pagina di 441
Developing a Fax Application
November 2009
85
The second method uses the normal TIFF sending functions to 
transmit a TIFF file that is preceded or succeeded by other G3 or 
ASCII files that are transmitted with either the 
noninfopkt-formatted raw data fax functions or the TIFF file fax 
functions.
To use the second method successfully, the user must pay attention 
to the combine argument of the BfvFaxNextPageTiff function (see 
the function description in Volume 4, Fax Processing, Bfv API 
Reference Manual for detailed information). When the combine 
argument is 1, the page information for the TIFF G3 data is sent to 
the channel without beginning a new page (do not call the 
BfvFaxStripParams function to do this).
For example, a program to send a page composed of ASCII combined 
with G3 from a TIFF file that is combined with G3 from a raw file 
could look like this:
/* Set up call prior */
/* Begin fax transmission, normal resolution, */ 
 
/* normal width */
BT_ZERO(args_fax);
 
args_fax.resolution = RES_200H_100V;
 
args_fax.width = WIDTH_A4;
 
BfvFaxBeginSendRaw(lp, &args_fax);
 
BfvFaxGetRemoteInfo(lp, &args_fax);
 
BfvFaxWaitForTraining(lp, &args_fax);
 
BT_ZERO(args_fax);
 
args_fax.fname = "ascii_file";
 
args_fax.fmt = DATA_ASCII;
 
BfvFaxSendFile(lp, &args_fax);
 
BT_ZERO(args_tiff);
 
args_tiff.fname = "tiff_file";
 
args_tiff.fmode = "r";
tp = BfvTiffOpen(&args_tiff);
 
/* No BfvFaxStripParams call is needed here, */ 
 
/* due to a combine value of 1 */ 
BT_ZERO(args_fax);
 
args_fax.s_tp = tp;
 
args_fax.combine = 1;
 
BfvFaxNextPageTiff(lp,&args_fax);
 
BT_ZERO(args_fax);
 
args_fax.s_tp = tp;
 
BfvFaxSendPageTiff(lp,&args_fax);
 
BT_ZERO(args_tiff);
 
args_tiff.tp = tp;
 
BfvTiffClose(&args_tiff);