#!/bin/csh -f # # Rotates a PostScript figure by -90 degrees around the center of A4 # paper sheet. # # M. Yokoyama # if ($#argv == 0) then set inputpsname = 'stdin' else set inputpsname = ($argv) endif echo '%\!PS-Adobe-2.0' echo '%%Creator: psrotate (by Masahiko Yokoyama)' echo '%%CreationDate: ' `date` echo '%%Title: Rotated figure' echo '%%Pages: 1' echo '%%PageOrder: Ascend' echo '%%BoundingBox: 0 0 595 842' echo '%%EndComments' echo '%%EndProlog' echo '%%Page: 1 1' echo ' ' echo '<< /showpage {} >> begin' echo 'gsave' echo '298 421 translate' echo '-90 rotate' echo '1.0 1.0 scale' echo '-298 -421 translate' echo ' ' echo '%' echo '%------ Beginning of the inserted figure.' echo '%%BeginDocument: (' $inputpsname ')' awk '{if (substr($0,1,1)\!="%") print $0}' $argv echo '%%EndDocument' echo '%------ End of the inserted figure.' echo '%' echo ' ' echo 'grestore' echo 'end' echo 'showpage' echo '%%Trailer' echo '%%EOF' exit 0