Sunday, August 1, 2010

Creating .tif images for Digium's fax for asterisk

In order to really leverage Digium's fax for asterisk and free fax for asterisk add-ons, one needs to be able to programatically convert a pdf file into a .tiff file that is compatible with ffa. After much searching, asking jeeves, dogpiling and altavistaing, I was able to dig up this ghostscript command that is able to make a ffa-compatible .tiff file out of a pdf from the command line:
# gs —q —dNOPAUSE —dBATCH —sDEVICE=tiffg4 —sPAPERSIZE=letter —sOutputFile=<DESTINATIONFILENAME.tif> <SOURCEPDF.pdf>

You may not even actually realize that your .tif is incompatible with ffa based on the debug offered by the add-on at the Asterisk console. The only error it throws is that it's unable to queue the .tif file. Apparently this is asteriskese for 'incompatible file type or resolution'. You can change the options above to create a different type of tiff or use:
# tiffinfo <TIFFNAME.tif>

to reverse engineer a .tif file that Asterisk generates internally using the ReceiveFax() dialplan command. Either way you should be able to get Asterisk faxing pretty quickly with ghostscript.

0 comments:

Post a Comment