Sometimes I have to send a FAX (as some recipients are about 20 years behind the times). Sometimes the document looks excellent on the screen, but what comes out the other end looks terrible. So I'm trying to come up with a way to produce the best quality FAX from a vector PDF (which is searchable with images and text). Part of the goal is to preview the fax in advance, so there are no surprises.
I start by converting the vector PDF to a raster (bitmap) postscript document:
Code:
pdf2ps document.pdf document.ps
I do that because ImageMagick does not handle vector PDFs well (while Ghostscript does handle it).
Then I use ImageMagick to display a FAX-converted representation:
Code:
convert document.ps -monochrome -threshold 80% -despeckle -resize "150x100%" -density 200 -format fax miff:- | display -
-monochrome -threshold 80% makes it a bi-level image.
-despeckle removes noisey dots if there were any colored backgrounds.
-resize "150x100%" compensates for the fact that the width of a FAX pixel is 1.5 times its height (this switch is absent on the actual file creation).
-density 200 FAXes are only 200 dpi. ImageMagick is not always smart about inferring parameters, so I do this to force ImageMagick to do the FAX format to spec.
In the end, I'm ending up with a very crappy image even though I started with a very high quality PDF. It was expected to look bad, but not as bad as what I'm ending up with. It's barely legible.
How can these steps above be improved?