landscap.ps 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. %!
  2. % landscap.ps
  3. %
  4. % This file can be prepended to most PostScript pages to force
  5. % rotation to "landscape" mode.
  6. %
  7. % There are (at least) four possible ways to reasonably position a
  8. % page after rotation. Any of the four old corners (llx,lly e.g.)
  9. % can be moved to match the corresonding new corner.
  10. % By uncommmenting the appropriate line below (i.e., remove the
  11. % leading '%'), any such positioning can be chosen for positive or
  12. % negative rotation. The comments at the end of each "rotate" line
  13. % indicate the ORIGINAL corner to be aligned. For example, as given
  14. % below, the lower left hand corner is aligned. When viewed, this
  15. % corner will have moved to the urx,lly corner.
  16. %
  17. % originally by James E. Burns, 3/8/93, burns@nova.bellcore.com
  18. % $Id: landscap.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
  19. %
  20. gsave clippath pathbbox grestore
  21. 4 dict begin
  22. /ury exch def /urx exch def /lly exch def /llx exch def
  23. %90 rotate llx neg ury neg translate % llx,ury
  24. 90 rotate llx neg llx urx sub lly sub translate % llx,lly
  25. %90 rotate ury lly sub urx sub ury neg translate % urx,ury
  26. %90 rotate ury lly sub urx sub llx urx sub lly sub translate % urx,lly
  27. %-90 rotate urx neg lly neg translate % urx,lly
  28. %-90 rotate urx neg urx llx sub ury sub translate % urx,ury
  29. %-90 rotate llx lly add ury sub urx llx sub ury sub translate % llx,ury
  30. %-90 rotate llx lly add ury sub lly neg translate % llx,lly
  31. end