Discussion:
[9fans] troff paper size
(too old to reply)
Yoshi Rokuko
2012-03-16 11:38:16 UTC
Permalink
OK this is really troff / ps related, but I think the right
people sit around in this place - and I'm talking about
plan9 troff ;-)

There was this thing on the list:
http://9fans.net/archive/2008/07/639

but I'm still not sure. If I choose a certain paper size,
lets say DIN A0, how do I generate a postscript that has
this size? DIN A0 is defined in mm, so I say:

.pl 118.9c
.ll 84.1c

large font:

.ps 144
Hello, world!

If I generate a postscript with just these 4 lines, will it
print out correctly on an A0 printer? If I have more text
then this 'Hello, world!' will the text cover the whole
paper and just the paper?
And how come that this postscript is displayed wrongly on
different postscript viewers (like gv on lunix)? There are
postscript files in A0 that are correctly displayed - gv is
even telling me that these files are A0.

Something must be missing? Some definition of paper size?

Thanks and best regards, Yoshi

PS
By displayed wrongly I mean that the text is cut off at the
right side and on the top ...
Richard Miller
2012-03-16 21:49:59 UTC
Permalink
The postscript file generated from troff output by aux/tr2post doesn't
dictate the paper size. The postscript prologue (copied from
/sys/lib/postscript/prologues/dpost.ps) includes a routine
/pagedimensions which finds the actual page boundaries (clippath) from
the runtime environment (ie the postscript interpreter), and tries to
centre the printed material on the page. The paper size is selected
when you display or print the postscript file, for example using the
'-sPAPERSIZE=' command option for ghostscript or sending the file to a
real A0 postscript printer [must be a big beast].

In the case of page(1) with the '-b' option, and possibly other
postscript display programs, the size of the "paper" can be set by
including a BoundingBox definition at the beginning of your postscript
file as described in the 9fans item you referred to. For A0, this
would be

%%BoundingBox: 0 0 2384 3370

In your simple example of raw troff using '.ps 144', you should also
set '.vs 144' so the text won't be cut off at the top.
Yoshi Rokuko
2012-03-17 12:09:59 UTC
Permalink
OK, thanks a lot! Now I know more. However I still think
it's odd that postscripts don't include the paper size for
which they are designed - I think it makes a difference
whether a document is written for legal, letter, DIN A4 or
DIN B4 etc. ...

Regards, Yoshi
Richard Miller
2012-03-17 21:17:24 UTC
Permalink
Post by Yoshi Rokuko
it's odd that postscripts don't include the paper size for
which they are designed
Postscript files can specify paper size (using %% comments),
but postscript files generated by tr2post don't.

Continue reading on narkive:
Loading...