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] How to perform mail-merge for a postscript document to fax?



Hi.



El Jueves, 5 de Febrero de 2009, CheeYang Chau escribió:
> > We use something similar using a modified version of sambafax
> >
> > we combine our document with the list of names and fax numbers in any
> > application like openoffice
> >
> > then our modified version of sambafax use two tags to mark the beginning
> > and end of each fax and to specify the destination

>
> Sounds interesting. Please send me the script.  Thank you.

Well, in order to avoid sending to each one, i will put this on the list.

these are the scripts

sambafax  

to replace the original cups backend called sambafax (as the original one, put 
in /usr/lib/cups/backend and setup a samba printer that uses this backend)

you could also rename it and test it alongside the original sambafax

also need pdftk installed

how should the document like ?

the document could contain several faxes of different lenghts for several 
destinations.

the script looks for these tags

to mark the begin of a fax 

BeginHylaFax # DestinationNº # Comment #


to mark the end of a fax

EndHylaFax 


example


BeginHylaFax # +34999888777 # This is the comment for the test fax  #


this is a text fax 

EndHylaFax 

The tags could be anywhere in the page. The script only control begin page and 
end page, so inserting several begins and ends in one page will result in only 
a fax to the first begin number. A recommended setup is to put the Begin tag 
at the header of the fax and the end tag at the foot of the fax or at the end 
of the body (of tha last page). 

also, the script will not hide this tags, so the trick is to writhe them in 
WHITE colour to not be shown in the final document

you can make faxes any longer.

I advise that this script puts a high load in the server, and could take 
several minutes to process the document (you will see it in the printer qeue 
until it finish the process)

We have an Old Presario 6500 512 MB Ram and 2 Pentium Pro 200 Mhz procesors as 
fax server and it is able to process documents with 300 destinations in a few 
minutes. when we have to fax to 4000 numbers we print to the fax in several 
runs (pages 1 to 300, then 301 to 600, etc)


Other example could be

page 1 header
BeginHylaFax # 1111111111 # fax 1 # 

body

page 2

body

EndHylaFax

page 3 header

BeginHylaFax # 222222222 # fax 2 # 

body

EndHylaFax

this will result in 2 faxes one of 2 pages and another of 1 page


the other 2 scripts are small utilities to manage faxmailings with less 
headache :)

reenvia_faxes.sh (as his name tells ;-) will resend the failed faxes again

place it in /usr/local/bin

How to use

login in the server as the user who has send the mailing (easier log ins as 
root and su - the user)

then use reenvia_faxes.sh

the system will search for all faxes in status F of this user, then resend 
them and delete the originals (to not resend again)


elimina_faxes_enviados.sh (also as his name tells) will purge the faxes in 
state D to clean up the user queue faxmailing

installation and usage, the same than above.

PS: I know that the first one could be enhanced with more parameters, and by 
not doing dual pstopdf each time. I had to do this because our pdf2ascii is 
not good enough, it is inserting some spaces in the middle of the tags, I 
think that with pdftoascii it works fine

If someone with more awk or sed knowledge enhances this script (the tag 
parsing) please, send me a copy ;-)

 
Also it will be nice if someone could put this scripts in the hylafax page, so 
I avoid sending them to people each time ;-)


Greetings


-- 
Un Saludo.

Carlos Lorenzo Matés.

clmates AT mundo-r.com

Attachment: sambafax
Description: application/shellscript

Attachment: elimina_faxes_enviados.sh
Description: application/shellscript

Attachment: reenvia_faxes.sh
Description: application/shellscript

Attachment: signature.asc
Description: This is a digitally signed message part.




Project hosted by iFAX Solutions