groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] suggestion for grops


From: Ted Harding
Subject: RE: [Groff] suggestion for grops
Date: Fri, 07 Jan 2000 23:32:59 -0000 (GMT)

On 07-Jan-00 Dr. Robert Herrmann wrote:
> 
> Much effort has been directed toward creating html files.
> 
> -----
> 
> At scientific meetings, poster presentations are made using
> large format printers, e.g, in the US one has a presentation space
> of 4' x 8' ( roughly 1 meter x 2 meters ). Widebed plotters
> are available with a widht of 36" (0.91 meters).
> 
> I have just used the groff .PSPIC command to create a large
> format output from individual groff pages. To do this I mustnow
> manually create the %%BoundingBox xl yl xh yh  entry in the PostScript
> file.
> 
> Would it be possible to have a flag -EPS for grops 
> so that the bounding box is provided?  For my uses, this can 
> from the medium used, e.g., Letter or Letter with -L flag.
> At the troff end, I must define the proper  controls for groff page
> management: 
>       .ll 70.0i
>       .pl 40.0i
> The -EPS flag would have meaning for Encapsulated PostScript only if
> a single page is printed:  groff -ms -o1 -P"-EPS -L"
> 
> The feature would also be useful if a groff tutorial is created
> in which the output of groff processing is also included

Granted, grops does not insert a %%BoundingBox line; i.e. it
produces PostScript, not EPS.

By the way, the BoundingBox for a whole document is the BB
which is just large enough to include the BB which is appropriate
to each page. It "encloses all marks painted on all pages of
a document".

However, getting grops to determine a BoundingBox from either
the troff output or the constructed PS code would involve a
lot of work on grops; in particular, detemining the BoundingBox
of what is defined by PostScript code is almost impossible
without running the code through a PS interpreter (which
is what ghostscript does under the control of "ps2epsi.ps",
for instance). It would be easier to do this in troff (e.g.
to extend "groff_out" to include a command which would tell
grops what the BB was: at least troff has direct access to
the dimensions of the marks on the page -- grops does not).

If you know beforehand what the BoundingBox dimensions will
be, you could run the file through a simple 'awk' script on
the lines of


/%%EndComments/{print "%%BoundingBox llx lly urx ury\n"};
{print $0}


This will put the line in a conforming place, and leave the rest
of the file untouched.

Another method, which you will need if you do not know beforhand
what the BB dimensions will be, is to use 'ps2epsi' in the ghostscript
package (or some other utility with the same effect); this will
recreate the file with a BB line in it, along with a lot of comments
which define "preview" bitmap data. The latter should be ignored by the
normal interpreter, but they do enlarge the file; if you hack the PS code
in 'ps2epsi.ps' you can eliminate this stuff (maybe call the new file
'ps2eps'?).

By the way -- 'ps2epsi' uses the ghostscript font metrics which
may not necessarily match those of the printer: since the BB is
a clipping path, you can end up with tiny bits clipped off the
bottoms of the descenders of characters on the last line; maybe
also to the left or right.

There are two possible cures for this. One is a further hack to
'ps2epsi.ps' which adds a safety margin to the BBox; the other
is to cause groff to place very small marks just outside the
printed area (e.g. at the four corners). 'ps2spei' will "see"
these and include them in the BBox.

> ----- 
> 
> I am willing to contribute some 'groff gems' to a moderated
> depository, e.g., printing business cards on perforated stock, and
> version -1.0 of the poster shell script.

That would be great!

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 07-Jan-00                                       Time: 23:32:59
------------------------------ XFMail ------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]