[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] Using Printer "Jogging" with groff
From: |
Ted Harding |
Subject: |
RE: [Groff] Using Printer "Jogging" with groff |
Date: |
Fri, 08 Dec 2006 17:11:53 -0000 (GMT) |
On 06-Dec-06 Deri James wrote:
> Hello,
>
> I have been trying to get printer "jogging" to work from
> within groff. The print bureau have told me I just need
> to insert this code on the page which I need "jogged":-
>
> %%BeginFeature: *Jog
> << /Jog 3 >> setpagedevice
> %%EndFeature
>
> so I set up two macros:-
>
> .de Jogger3
> ps: exec
> %%BeginFeature: *Jog
> << /Jog 3 >> setpagedevice
> %%EndFeature
> ..
> .de Jogger0
> ps: exec
> %%BeginFeature: *Jog
> << /Jog 0 >> setpagedevice
> %%EndFeature
> ..
>
>
> which I use by:-
>
> \Y[Jogger3]
>
> and
>
> \Y[Jogger0]
>
> as appropriate.
>
> This seems to produce Postscript output like this:-
>
> %%Page: 1 1
> %%BeginPageSetup
> BP
> %%EndPageSetup
> 1.05 34.8 EBEGIN
> %%BeginFeature: *Jog
> << /Jog 3 >> setpagedevice
> %%EndFeature
> EEND
>
> The print bureau tell me that when they print this document,
> although it jogs correctly, each line on the page with "jog"
> commands embedded comes out reversed. (i.e. text printed
> right to left - and in the wrong orientation - this was a
> landscape A4 document.)
I had a thought about this, but have no experience with
"jogging", so thought it better to wait and see if someone
else would come up with the real solution!
Werner has just pointed out the Prologue and "BP" issue,
which gives a good lead-in to my "suggestion" (which is
no more than that).
I loked up "setpagedevice" in the PostScript Language Reference
Manual, and there is one paragraph which may contain the
seeds of the truth.
"*setpagedevice* reinitializes everything in the graphics
state, including parameters not affected by *initgraphics*.
Device-dependent rendering parameters, such as halftone,
transfer functions, flatness and color rendering, are
reset to builtin default values or to ones provided in
the *install* procedure of the page device dictionary."
This suggested to me that the "jog" code was undoing, in
particular, the groff transformation in which the vertical
coordinate is inverted (so that text in landscape would
be printed right to left) and the rotation transformation
for pages formatted in landscape.
One place, therefore, where it may be appropriate to place
"jog" code might be in the Prologue itself, before any page
setup routines are defined. But that may well interfere
with the desired usage of "jog" -- and that's where my
inexperience leaves me ignorant!
Another possibility which occurred to me is the wrap any
instance of the "jog" code within the PostScript commands
"gsave" and "grestore".
"*gsave* pushes a copy of the current graphics state
on the graphics state stack. All elements of the graphics
state are saved. .... "
"*grestore* resets the current graphics state from the
one on the top of the graphics state stack, restoring
the graphics state which was in effect at the time of
the matching *gsave*. This operator provides a simple
way to undo complicated transformations and other graphics
state modifications without having to re-establish
all graphics state parameters individually."
[and, I guess, "reinitializing everything in the graphics
state" is a fairly complicated modification!]
So *maybe*
.de Jogger3
ps: exec
%%BeginFeature: *Jog
gsave
<< /Jog 3 >> setpagedevice
grestore
%%EndFeature
..
.de Jogger0
ps: exec
%%BeginFeature: *Jog
gsave
<< /Jog 0 >> setpagedevice
grestore
%%EndFeature
..
might work. But then again it might not!
Unfortunately, a lot of the description in the Language
Reference Manual of how *setpagedevice* works refers to
aspects which I have no experience of, and therefore do
not really understand.
Any one out there who really knows how this "Jog" business
works in practice?
Best wishes,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 08-Dec-06 Time: 10:33:00
------------------------------ XFMail ------------------------------
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 08-Dec-06 Time: 17:11:47
------------------------------ XFMail ------------------------------