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] pdf2ps, faxmail, sendfax, sendmail



I've got pdf attachments converting to ps from faxmail working. 
Thanks to everyone who helped - particulary Ben (Hammer), Goldfish
(Chris Manness) and Aaron Newsome's post
(http://www.hylafax.org/archive/1998-10/msg00120.php).  Works for me,
but your mileage may vary.

I'm posting because there doesn't seem to be a very clear posting on
how to get this going (at least using faxmail - thanks for the
suggestion to roll my own faxmail, Lee, but I don't have the chops)
and it's really helpful to be able to have faxmail convert and fax
pdfs.  Neither the perl or bash scripts are my work and I relinquish
all credit to whom made them (I think it was Chris).

Here's my setup:

1) /etc/hylafax/hyla.conf

added the following line:
MIMEConverters: /usr/local/faxscripts/

2) pasted the filter.pl script at /usr/local/faxscripts

<cut and paste me into /usr/local/faxscripts/filter.pl>

#!/usr/bin/perl
# Read from the standard input
@text=<STDIN>;
$size=@text;

# Count the number of "showpage"
$count=0;
for($i=0;$i<=$size;$i++){if($text[$i] =~ /showpage/){$count++;}}

# Discard the last line that contain "showpage"
$num=1;
for($i=0;$i<=$size;$i++){
        if($text[$i] =~ /showpage/){
                if($num!=$count){$num++;}
                else{$text[$i]=~s/showpage//g;}
        }

                print $text[$i];
}

3) Create /usr/local/faxscripts/application/pdf

<cut and paste me into /usr/local/faxscripts/application/pdf>

#!/bin/bash
/bin/echo " "
/bin/echo "showpage"
/usr/bin/gs -q -sPAPERSIZE=a4 -dBATCH -dNOPAUSE -r600x800
-sDEVICE=pswrite -sOutputFile=- $1 | /usr/local/faxscripts/filter.pl

4) Restart hylafax and test.

If my mailer mangles this message, my apologies.

Make sure gs is where it should be.  Aaron's post has it in
/usr/local/bin/gs - check your distribution.  Also, the resolution may
be totally off in ghostscript.  It prints out great, but perhaps
there's a better choice for resolution then 600x800.

Thanks all,
Robert


  

On 4/14/05, Lee Howard <faxguy@xxxxxxxxxxxxxxxx> wrote:
> Robert McIntosh wrote:
> 
> >I'd like to send faxes via e-mail and receive them via e-mail.  E-mail
> >without attachments goes to fax no problem.  The big hurdle right now
> >is getting either sendfax or faxmail to decode outbound pdf
> >attachments and also incoming faxes sent to a specified address.
> >
> >
> 
> You say "sendfax or faxmail" but really you just mean "faxmail" because
> sendfax can handle PDF natively just fine.
> 
> The best thing that you could do for yourself is to follow the faxmail
> instructions, as you have, but write your own version of faxmail in your
> favorite programming language (shell, php, perl, python, whatever).
> Assuming that you have uudecode available to you doing writing a faxmail
> replacement will amount to under 100 lines of code, a few hours of
> work... and in the end you have something more versatile and more
> understandable than faxmail can be.
> 
> Lee.
> 
>

____________________ 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