   \newsavebox{\swbox} \newlength{\spht} \newlength{\spwd}
   \newenvironment{sideways}{\savebox{\swbox}\bgroup}{\egroup%
   \spwd=\dp\swbox\advance\spwd by \ht\swbox\spht=\wd\swbox%
   \rule{0pt}{\spht}%
   \special{pstext="gsave (\the\ht\swbox) ram"}%
   \dp\swbox=0pt\wd\swbox=0pt\ht\swbox=0pt%
   \usebox{\swbox}%
   \special{pstext="grestore"}%
   \rule{\spwd}{0pt}%
   }

\special{pstext="/ram { dup length 2 sub 0 exch getinterval cvr 72 div Resolution mul currentpoint currentpoint translate -90 rotate 3 -1 roll sub neg exch neg exch translate } def"}
