[comp.graphics] Horizontal format with pic or Postscript?

josh@pbhye.UUCP (Joshua Stein) (06/09/87)

I am working on a Sun workstation using the IDE package for software design and have run into a little problem. A data flow diagram that is visually ok on the
screen becomes compressed when printed on a laser printer. The diagram is wide
and I am at a loss as to how to tell either pic (if this possible) or Postscript(the two available graphics packages) how to rotate the diagram and print it
horizontally (actually the laser printer would take care of the printing if I
could just get the generated bit map correct). Also, if anyone who knows some-
thing of how to scale drawings in those packages I would certainly appreciate
some advice.

Much of the above is probably copyrighted so please apply the usual disclaimers
at this point.
-- 
							   __
Joshua Stein	Pacific Bell		"Neat Stuff!!"	 / --) koo koo ka choo
YADD(Yet Another Disclaimer Disclaimer)		        /\ ) )
(415) 823-2411 uucp:{ihnp4,dual}!ptsfa!ptsfb!josh      |   \/ rn].

jsa@tut.UUCP (06/11/87)

in article <1642@pbhye.UUCP>, josh@pbhye.UUCP (Joshua Stein) says:
> Xref: tut comp.graphics:533 comp.unix.wizards:1834
> 
>screen becomes compressed when printed on a laser printer. The diagram is wide
> and I am at a loss as to how to tell either pic (if this possible) or
>Postscript(the two available graphics packages) how to rotate the diagram and 
> print it horizontally (actually the laser printer would take care of the
> printing if I could just get the generated bit map correct).
> 

I had a kind a similar problem when trying to get large tables (run through
tbl and then ditroff ) to landscape -format to our APPLE (postscript)
laserwriter.

What I did was to take ditroff's postscript output to a file and then
modify the postscript file to be printed horizontally.

Here's the script and the lines to be added and the manual page.

--------------- /usr/local/2land ----------------------
#! /bin/sh
for i
do
  cp $i $i~
  ed $i <<'LOPPU' >/dev/null 2>&1
  /initmatrix/2
  . r /usr/local/.2land.rot
  w
  q
LOPPU
done
--------------- /usr/local/.2land.rot -------------------
0 11.5 72 mul translate
270 rotate
--------------- /usr/man/manl/2land.l -------------------
.TH 2LAND 1L 6/3/87
.SH NAME
2land, convert postscript -files to landscape format for laser writer.
.SH SYNOPSIS
.IR 2land
file [file...]

.SH DESCRIPTION
The
.IR 2land
program converts postscript files to landscape format for APPLE laser writer.
.PP
This program is mostly useful is you wish to print out tables which
require rather a wide paper. The reason to make this program was
that there was absolutely 
.IR no
way to print a file in landscape format after having run it through
.IR ditroff (1).
.PP
What the program actually does is that it finds the place in a
postscript file immediately after first 2 initmatrix -commands,
which is the way ditroff initializes the scaling. Then using
.IR ed (1)
it puts there commands to relocate the place of the origin
and to rotate the printing direction by 270 degrees.
.PP
This program actually modifies your postscript file, but it does
leave you the original one as well.
The name of the original file is extended like emacs does
(adding a '~' to the end of the name).
.PP
Remember, that in landscape -format page length is about 6.5 inches
and line length is about 11.5 inches. DO NOT FORGET TO TELL THAT
TO DITROFF !!

.SH "AUTHORS"
jsa@tut.fi

.SH FILES
.IR/usr/local/2land
- the command itself
.br
.IR /usr/local/.2land.rot
- this has the information to be added

.SH "SEE ALSO"
.IR lwf (1)
- which handles normal text perfectly.

.SH BUGS
This is
.IR NOT
a filter, because sed can't cope with multiple line searches.
-----------------------------------

I hope this is of some help.
-- 
          Jari Salo              Tampere University of Technology 
UUCP:     jsa@tut.UUCP           Computer Systems Laboratory
Internet: jsa@tut.fi             PO box 527
Tel:      358-(9)31-162590       SF-33101 Tampere, Finland

john@xanth.UUCP (06/17/87)

In <1459@korppi.tut.fi>, Jari Salo <jsa@tut.fi> gives a method for
printing in landscape mode from ditroff on a postscript printer.
Unfortunately, he must be using some ditroff->postscript software
other than TranScript.  That inspired me to do something similar for
TranScript.  Enclosed are context diffs to psroff.sh to allow you to
use a -L flag and get landscape mode.  Don't forget to set .pl 8.5i
and .ll 11.0i (or less for margins/page offset).  I got some wonderful
results with two-column modes....

*** /tmp/,RCSt1024446	Wed Jun 17 15:16:56 1987
--- psroff.sh	Wed Jun 17 14:41:13 1987
***************
*** 11,16 ****
--- 11,18 ----
  
  ditroff=ditroff
  psdit=psdit
+ land=cat
+ land1=-
  nospool= dopt= fil= spool= dit=
  printer=-P${PRINTER-PostScript}
  while test $# != 0
***************
*** 22,27 ****
--- 24,30 ----
  	-P*)	printer=$1 ;;
  	-C)	spool="$spool $1 $2" ; shift ;;
  	-J)	spool="$spool $1 $2" ; jobname=$2 ; shift ;;
+ 	-L)	land=sed ; land1="/^\/xi /s/0 72 11 mul translate/90 rotate/" ;;
  	-)	fil="$fil $1" ;;
  	-*)	dopt="$dopt $1" ;;
  	*)	fil="$fil $1" ; jobname=${jobname-$1} ;;
***************
*** 38,44 ****
  dit="$ditroff -Tpsc -t $dopt $fil "
  
  if test "$nospool" = "1" ; then
! 	$dit | $psdit
  else
! 	$dit | $psdit | $spool
  fi
--- 41,47 ----
  dit="$ditroff -Tpsc -t $dopt $fil "
  
  if test "$nospool" = "1" ; then
! 	$dit | $psdit | $land "$land1"
  else
! 	$dit | $psdit | $land "$land1" | $spool
  fi
-- 
John Owens		Old Dominion University - Norfolk, Virginia, USA
john@ODU.EDU		old arpa: john%odu.edu@RELAY.CS.NET
+1 804 440 4529		old uucp: {seismo,harvard,sun,hoptoad}!xanth!john