ghostscript: rasterize for fax (tiff/g3)

0

I need a suitable command to convert pdf to tiff/g3 for use with hylafax/c2faxsend. The PDF is produced from a libreoffice plugin, but has relatively small fonts embedded.

My current command is

pdf2ps "$infile" - \
| pstops '1:0@0.95(1.05cm,1.485cm)' \
| gs -q -sDEVICE=tiffg3 -r"${resh}x${resv}" -sOutputFile="$outfile" \
   -dBATCH -dNOPAUSE -c \
  "<< /Install { { "$thresh" gt { 1 } { 0 } ifelse } settransfer } >> setpagedevice" -f -

I have infile and outfile set correctly, tried thresh=0.5 up to thresh=0.99 (no differences there), and tried different resolutions, like 204x98, 204x100dpi. However the fonts are (a little unexpectedly) only readable when starting from resolutions such as 300dpi: Often, the letters are rendered as disconnected entities or whole streaks are removed. For example, an E might end up as something like [

Without being able to easily post an image, what could I do to avoid those problems other than increasing the resolution? (c2faxsend converts the input to be 204x100 or so, and I don't think this can be influenced).

In short, I'm looking for a rasterisation command that is optimized for fonts readability at "normal" fax resolutions.

Jo So

Posted 2013-03-25T14:10:33.537

Reputation: 233

Answers

0

I have now found that the rasterizer of ghostscript simply did not work for me, maybe because of font issues. And convert, another solution which you find quite frequently as answer for this kind of problem on the web, really shouldn't be used for anything but rastergraphics. The PDF functionality seems to be a farce.

I've ended up using pdftoppm to do the rasterizing stage and convert to convert to tiff which gave me a good result.

Jo So

Posted 2013-03-25T14:10:33.537

Reputation: 233