HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Coverpage reports double number of pages for WHFC 1.0.8 faxing a 'ps' file created by a2ps

KAbrahamsen@wrightgroup.com wrote:
> I was doing some testing with this ascii text file converting it to
> postscript via 'a2ps'. When I fax this postscript file directly with WHFC
> 1.0.8 using the yellow 'Send A Fax' button, the fax is sent properly but the
> Cover Page reports 8 pages rather than only the 4 which exist. When I have
> faxed postscript files created with other tools, using the yellow 'Send A
> Fax' button method, the number of pages is always reported correctly. In
> general, how does WHFC determine the number of pages for the fax? This may
> be due to the modifications I made to the cover page, so if I know *how* the
> cover page count is determined, I can review my coverpage accordingly and/or
> determine what's wrong with the 'a2ps' file converter.
> showpage


whfc uses the following code fragment to specify the number of
pages :

while (fgets(buffer, sizeof(buffer) - 1, fp) != NULL) {
  if (!strncmp(buffer, "%%Page:", 7)) {
    if (sscanf(buffer, "%%%%Pages: %u", &n) == 1) {
      npagecom = n;
      TRACE("Page = %d\n",n);
it counts either all lines which have a %%Page: or try to get a number
from the %%Pages: tag

In your document you have first a %%Pages: 4 and later for every page
a %%Page, so whfc starts with the npagecom variable preset to 4 and then
count up for every page.  

Seems to be a undocumented feature of WHFC ;-)

Ulrich Eckhardt                         Tr@nscom  
http://www.uli-eckhardt.de              http://www.transcom.de
                                        Lagerstraße 11-15 A8
                                        64807 Dieburg Germany

____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null

Project hosted by iFAX Solutions