beautypg.com

Dialogic 6.2 User Manual

Page 86

background image

Developing a Fax Application

November 2009

86

/* A call to BfvFaxStripParams must be done */

/* here for combination with previous G3 */

/* data (from TIFF file)*/

BT_ZERO(args_strip);

args_strip.fmt = DATA_G3;

args_strip.resolution = RES_200H_100V;

args_strip.width = WIDTH_A4;

BfvFaxStripParams(lp,&args_strip);

BT_ZERO(args_fax);

args_fax.fname = "g3_file";

args_fax.fmt = DATA_G3;

BfvFaxSendFile(lp, &args_fax);

BfvFaxEndOfDocument(lp, &args_fax);

The previous example set the page resolution and width to fixed,

predetermined values. A slight variation permits you to use the

resolution and width values stored in the TIFF page for both the

page and the data strip within the page. The TIFF routines retain

these values until the data strip is sent.

/* set up call prior */

BT_ZERO(args_tiff);

args_tiff.fname = "tiff_file";

args_tiff.fmode = "r";

tp = BfvTiffOpen(&args_tiff);

BT_ZERO(args_fax);

args_fax.s_tp = tp;

BfvFaxBeginSendTiff(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);

/* 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);

/* A call to BfvFaxStripParams must be done */

/* here for combination with previous G3 */

/* data (from TIFF file)*/