[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] groff postscript output rotated 90 degrees in for a 4 x 2.5
From: |
Ted Harding |
Subject: |
Re: [Groff] groff postscript output rotated 90 degrees in for a 4 x 2.5 inch label? |
Date: |
Mon, 09 Jun 2014 10:53:20 +0100 (BST) |
Using the option "-P-l", as Clarke suggests, is the simplest (and very
straightforward) way to get a document printed entirely in landscape
format (though of course you need to be careful about the page-size
metrics, depending on the formatting).
It is, however, possible to rotate parts of a page (keeping the pager
as a whole unrotated) if you are using PostScript output. For this
you need to define some PostScript code to be inserted using
"\X'ps: exec ... ". Here is a toy example (though using non-toy
definitions ... ):
.ds rotate "\X'ps: exec gsave currentpoint 2 copy translate \
\\$1 rotate neg exch neg exch translate'
.ds restore "\X'ps: exec grestore'
\Z'\D'p 1i 0i 0i 1i -1i 0 0 -1i''\
\*[rotate -45]\
\Z'\D'p 1i 0i 0i 1i -1i 0 0 -1i''\
\Z'\0\0\0Hello'\
\*[restore]\
\0\0\0Hello
The above defines two PostScript command strings \*[rotate]
and \*[restore]. \*[rotate] takes an argument which is the angle
of clockwise rotation about the current point in degrees clockwise,
so that "*[rotate -45]" rotates 45 degrees anticlockwise.
Then it draws a 1-inch-square box atarting at its top left-hand
corner, returning to the starting point; then it sets up a 45-degree
anticlockwise rotation (about the starting-point) and draws it again,
this time with "Hello" on its upper edge; then it invokes \*[restore]
which restores things to their pre-\*[rotate] state and again puts
"Hello" on the top edge of the first box (just to prove that the
restoration has worked).
Best wishes to all,
Ted.
On 09-Jun-2014 00:55:58 Clarke Echols wrote:
> I use:
>
> groff -t -P-l <filename>
>
> to print a groff file containing tables in "landscape" format so it
> appears 90-degrees from normal "portrait" orientation.
>
> I produce a document in two "columns", right- and left-hand pages
> side-by-side on an 8-1/2-inch by 11-inch paper. Works fine for me.
>
> Clarke
>
>
> On 06/08/2014 06:01 PM, Mike Bianchi wrote:
>> I just don't seem able to get this right.
>>
>> I want to create a Postscript file with the text turned 90 degrees from
>> horizontal.
>>
>>
>> I define
>> .ll 4.0i
>> .pl 2.5i
>> .po 0
>> I format a simple label that looks just fine in Letter sized
>> displays.
>>
>> I want to
>> crop the Postscript to 4 x 2.5 inches
>> rotate it 90 degrees
>> Look at it with gv(1) and then send it to my Dymo label printer.
>>
>> I have the label printer working, so I think this should work:
>>
>> tmpfile=/tmp/xxx
>> groff file >${tmpfile}
>> psnup -w4in -h2.5in -l ${tmpfile} >${tmpfile}2
>> gv ${tmpfile}2
>>
>>
>> If I make the 3rd line
>>
>> psnup -l ${tmpfile} >${tmpfile}2
>>
>> and I get the label, but not rotated.
>>
>> I've also tried using
>>
>> pstops '0L' ${tmpfile} >${tmpfile}2
>>
>> but again, no output.
>>
>> Oddly
>>
>> pstops '0V' ${tmpfile} >${tmpfile}2
>>
>> produces the expected vertical reflection.
>>
>>
>> Any suggestions?
>>
>> Is there a way to do the rotation _within_ groff?
>>
>> (I know about the pic "aligned" hack,
>> but that seems to be useful only for simple unformatted text.
>> I would need to rotate an entire groff diversion.)
>>
>>
>> --
>> Mike Bianchi
>> Foveal Systems
>>
>> 973 822-2085
>>
>> address@hidden
>> http://www.AutoAuditorium.com
>> http://www.FovealMounts.com
>>
>>
>
-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 09-Jun-2014 Time: 10:53:17
This message was sent by XFMail
-------------------------------------------------