|Do you know where your variables are?|
Faxes in your browserby Willard B. Trophy (Hermit)
|on Oct 21, 2002 at 00:29 UTC||Need Help??|
I don't have space for a fax machine, and if I did, I could guarantee it would have no paper or be broken or something just when I need it.
Companies like eFax.com (free for certain US & UK locations) and Protus Fax (commercial, Canada & US) provide virtual fax numbers which forward the fax page images on to you by e-mail. Unfortunately, these tend to be sent as TIFFs, which somehow the web missed out on supporting, despite them being the lingua franca of the prepress world. (It's something to do with the TIFF file format being a hideous knot that they're not supported. I work in prepress, I have to grok them. Bleah.).
Most PDF readers include full TIFF support, and integrate reasonably well with browsers. I'll leave the actual interfacing of the converted PDF to the reader, but the code follows. You'll need to install pdflib, which installs its not-very-Perlish support module in the right place.
And that's it. It just works. Yeah, you can do this with tiff2ps and gs's ps2pdf, but that's a lot of software overhead.
This also works with any TIFF I've ever met. I've met some odd TIFF flavours in my time.
If you need to archive the faxes, a useful trick is to convert them to G4 fax with tiffcp -c g4 -r5000 in.tif out.tif beforehand. This will make the resultant PDF much smaller. Of course, if you really want the files to be tiny, investigate DjVu, but that's not a Perl thing, so I'll be quiet now …
Update, July 11th 2003: The free version of PDFlib is now called PDFlib Lite, and it has a rather odd licence. I guess this use would be covered under their "royalty free" terms. Ideally, I'd like to shift this code to work under the more open PDF::API2 module.