[gs-devel] ps->ljet4/pdf: bounding box issue

Giulio Orsero giulioo at pobox.com
Mon Jun 14 05:48:35 PDT 2004

8.14 win or linux.

I receive faxes using HylaFAX which produces a tiff file.
To print the tiff file I do:

tiff2ps -a file.tif | \
        gs -q -sDEVICE=ljet4 -dNOPAUSE -dSAFER=true -sPAPERSIZE=a4 \
            -dFIXEDMEDIA -sOutputFile=- - | \
        lpr -l  -P printer

I've got a problem with tiff files which contains page-chopped pages (say
you use A4 format, the sender cut short the page if the remaining is all
blank, so you have tiff files containing pages which are not long as an a4
sheet, but shorter).

When tiff2ps converts tiff to ps it correctly put a bounding box which let
you know that the height of the page is not "complete", ie:

%%Creator: tiff2ps
%%BoundingBox: 0 0 610 211
100 dict begin
609.882324 210.857147 scale
%ImageData: 1728 574 1 1 0 1 2 "image"
/scanLine 216 string def
1728 574 1
[1728 0 0 -574 0 574]
{currentfile scanLine readhexstring pop} bind

Using bbox device produces the following output:
$ gs -dBATCH -dNOPAUSE -q -sDEVICE=bbox file.ps
%%BoundingBox: 0 0 610 211
%%HiResBoundingBox: 0.000000 0.000000 609.882310 210.857126

If I look at the ps file using ghostview I see the data in the bottom of the
page with the bounding box just around the data.

I would expect that when converting to other formats like pdf or ljet4 the
data should start at the top of the page since bounding box says that data
starts at 211 vertical pt; instead both in pdf and ljet4 I get the first 3/4
of the page as blank and the data is in the remaining 1/4 at the end.

Is there a way to force gs to start where the bounding box start?

Or maybe the problem is with tiff2ps and I should ask on their list?


giulioo at pobox.com

More information about the gs-devel mailing list