|
Print2File is a small application to provide an easy interface in Windows for creating Adobe PDF and Images for faxing to a Asterisk PBX Server. Once the software is install you only need to print a document to a standard windows printer.
A port called “RPTN:” should be installed on your system which uses the RedMon “Redirected Port”. (N can be any number like RPT1:)
Print2File can use any PostScript printer driver to operate. It should automatically install the “HP LaserJet 5/5M PostScript” printer driver and printer called “PrintToFile” This is a common printer driver and should be included with most newer operating systems (Windows 2000 or better)
Download Version 1.0.13
Windows Installation Package - Click Here - 2.6 MB (Includes PrintToFax and Source)
Required Windows Software
- Required Asterisk Software
- You must install the above software packages Print2File to work.
Contents
Installation
Be sure that you are logged in as an administrator on your machine! Once you install the Print2File package you will need to run the Print2File.exe (either by shortcut or from the installation location) The following setup menu will be shown.

If you have an Asterisk PBX setup you can configure Print2File to transfer the fax job to the server via FTP. I created a user called AstFax with a home directory of /home/astfax. Two files will be transferred to the server. Fax.Call and PXXX.Tif. You can write a simple cron script to transfer these files to the appropriate locations on the server for Asterisk to recognize. You can use a simple script like the follow
#!/bin/sh
#Check for Files count=0 for file in `/usr/bin/find /home/astfax -iname *.call` do if [ -f "$file" ] then count=`expr $count + 1` echo File: "$file" /bin/mv -f "$file" /var/spool/asterisk/outgoing fi done
for file in `/usr/bin/find /home/astfax -iname *.tif` do if [ -f "$file" ] then count=`expr $count + 1` echo File: "$file" /bin/mv -f "$file" /var/spool/asterisk/fax fi done
if [ $count != 0 ] then echo Copied "$count" Files
/bin/chown -R asterisk:asterisk /var/spool/asterisk/outgoing/*
/bin/chown -R asterisk:asterisk /var/spool/asterisk/fax/* fi
The fax.call file must be transferred to /var/spool/asterisk/outgoing and the TIF should be put in the same location you specify on the “Spool Location” on the Print2File setup. A good place is /var/spool/asterisk/outgoing
The trunk is the what is to be used for the outgoing call. Such as “Zap/g0”
The extension and context is what is to be used for the outgoing call. The default extensions provided with Asterisk Management Portal. The context and extension looks something like the follow.
[ext-fax] exten => s,1,Answer exten => s,2,Goto(in_fax,1) exten => in_fax,1,GotoIf($[${FAX_RX} = system]?2:analog_fax,1) exten => in_fax,2,Macro(faxreceive) exten => in_fax,3,NoOp(Return From Fax) exten => in_fax,4,system(tiff2ps -2eaz -w 8.5 -h 11 ${FAXFILE} | ps2pdf - ${FAXFILE}.pdf) exten => in_fax,5,NoOp(Return From Tiff) exten => in_fax,6,system(mime-construct --to ${EMAILADDR} --subject "Fax from ${CALLERIDNUM} ${CALLERIDNAME}" --attachment ${FAXFILE}.pdf --type application/pdf --file ${FAXFILE}.pdf) exten => in_fax,7,NoOp(Return From Mime) ;exten => in_fax,8,system(rm ${FAXFILE} ${FAXFILE}.pdf) exten => in_fax,9,Hangup exten => analog_fax,1,GotoIf($[${FAX_RX} = disabled]?3:2) ;if fax is disabled, just hang up exten => analog_fax,2,Dial(${FAX_RX},20,d) exten => analog_fax,3,Hangup exten => out_fax,1,txfax(${TXFAX_NAME}|caller) exten => out_fax,2,Hangup exten => h,1,Hangup()
The maximum retries and wait time applies if the fax fails. You can set maximum retries to 0 to disable.
TroubleShooting
You may get an error during the generation of the TIF/PDF. This is probably due to settings in the Device Settings of the Printer. Go to the properties of the printer (Default name is “PrintToFile”) and the “Device Settings” tab.

- Set the “Send CTRL-D After Each Job” to NO.
- Set the “Wait Timeout” to 1
|