pri = (u_short) -1;
usrpri = FAX_DEFPRIORITY;
pagewidth = pagelength = resolution = 0;
- npages = totpages = skippages = 0;
+ npages = totpages = skippages = coverpages = 0;
ntries = ndials = 0;
minbr = BR_2400;
desiredbr = BR_33600;
{ "npages", &FaxRequest::npages },
{ "totpages", &FaxRequest::totpages },
{ "skippages", &FaxRequest::skippages },
+ { "coverpages", &FaxRequest::coverpages },
{ "ntries", &FaxRequest::ntries },
{ "ndials", &FaxRequest::ndials },
{ "totdials", &FaxRequest::totdials },
case H_DONEOP: doneop = tag; break;
case H_RETURNED: status = (FaxSendStatus) atoi(tag); break;
case H_MINBR: minbr = atoi(tag); break;
+ case H_COVERPAGES: coverpages = atoi(tag); break;
case H_STATUS:
/*
u_short totpages; // total cummulative pages in documents
u_short skippages; // skipped pages in documents
u_short npages; // total pages sent/received
+ u_short coverpages; // number of cover pages 1st
u_short ntries; // # tries to send current page
u_short ndials; // # consecutive failed tries to call dest
u_short totdials; // total # calls to dest
req.skippages = 0;
bool firstpage = true;
bool skiplast = false;
+ bool coverdoc = false;
for (u_int i = 0;;) {
if (!tif || TIFFLastDirectory(tif)) {
/*
return (true);
}
const FaxItem& fitem = req.items[i];
+
+ if (fitem.item.find(0, "/cover") < fitem.item.length())
+ coverdoc = true;
+ else
+ coverdoc = false;
+
tif = TIFFOpen(fitem.item, "r");
if (tif == NULL) {
result = Status(314, "Can not open document file %s", (const char*)fitem.item);
next = params;
setupParams(tif, next, info);
- u_int p = req.totpages;
+ if (coverdoc)
+ req.coverpages++;
+
+ u_int p = req.totpages - req.coverpages;
if (!firstpage) {
/*
if (skiplast) { // skip previous page
req.skippages++;
req.pagehandling.append('X');
- if (range.contains(p))
+ if (coverdoc || range.contains(p))
{
req.pagehandling.replace('#', c);
skiplast = false;
req.pagehandling.append(c);
}
} else {
- if (! range.contains(p))
+ if (! (coverdoc || range.contains(p)) )
skiplast = true;
firstpage = false;
}
hash("subaddr");
hash("passwd");
hash("state");
+ hash("coverpages");
hash("npages");
hash("totpages");
hash("skippages");
remote machine is also displayed.
.TP 12
.BI \-Z " range"
-Specify that only certain pages of the fax should actually
-be transmitted. The range is in a comma-seperated list of ranges in the
-form of A[-B][,....]. The range is specified agains the resulting document to be
-faxed, so if you have more than one document, and cover pages, make sure to account
-for them in the range specification.
+Specify that only certain pages of the fax should actually be transmitted. The
+range is in a comma-seperated list of ranges in the form of A[-B][,....]. The
+range is specified agains the resulting document to be faxed, excluding any
+cover pages. So if you have more than one document, make sure to account for
+them, and exclude the cover pages in the range specification. Cover pages will
+always be faxed, so a fax with a coverpage and 2 5 page documents with a range
+specified of of 1,3,10 will fax the cover page, and pages 1, 3, and 10 of the
+combined documents (page 1 and 3 from the first document, and page 5 of the
+second document).
.SH "CONFIGURATION PARAMETERS"
.I sendfax
reads configuration information from the files