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] sendfax fails to send *.ps files generated by postscript printer driver



On Tuesday 04 Sep 2007, Aaron Phoenix wrote:
> Hi,
>
> I've set up hylafax-4.3.2 under FreeBSD 5.4-RELEASE + Samba, with an
> external serial modem. It works well in receiving faxes, but fails to
> send *.ps files from the Windows XP client - WHFC. These *.ps files are
> generated by printer HP LaserJet 5/5M PostScript.
>
> My debug steps:
>
> 1) print attachment "test.eml" to file "test.ps" via printer under
> Windows XP.
>
> 2) copy "test.eml" and "test.ps" to the FreeBSD box.
>
> 3) run `sendfax -n -d 8172 test.eml`, OK, the fax machine got the
> facsimile.
>
> 4) run `sendfax -n -d 8172 test.ps`, got error message - "Can not
> determine file type".
>
> 5) run `ps2ps test.ps test.ps2` and got "test.ps2".
>
> 6) run `sendfax -n -d 8172 test.ps2`, OK.
>
> I didn't modify "/usr/local/lib/fax/typerules".
>
> Who can tell the reason, and how to fix it? Any advices are appreciated.
>
> - Aaron


Looking at the files, "test.ps" appears to have had some crap shoved onto the 
beginning -- possibly by the client software, who knows?

Try arranging it so that your Windows-generated PostScript files get piped 
through this little Perl script -- it's a simple filter that strips off 
anything before a line beginning with a percent sign.  Every 
application-generated PostScript file should start with a comment such 
as "%!PS-Adobe-3.0", which indicates the PostScript level to which the file 
conforms.  No harm will be done to files without any extraneous bytes on the 
beginning.

#!/usr/bin/perl -w
my $seen_percent = 0;
while ($_ = <>) {
    $seen_percent |= /^\s*%/;
    print if $seen_percent;
};
exit;

(The above code is hereby released to the Public Domain -- AJS.)

-- 
AJS
(insert figure one before at sign if replying off-list)


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions