home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 September / PCWK996.iso / sharewar / 95 / narzedzi / ambra / ambr32a1.exe / FILE / ARCHIVE.Z / ACROBAT / VIEWER32.EXE / PSPROCSET / 12 < prev    next >
Text File  |  1996-02-22  |  1KB  |  39 lines

  1. %%BeginFile: pdfasc.prc
  2. %%Copyright: Copyright 1992-1993 Adobe Systems Incorporated. All Rights Reserved.
  3. % Autoscale  operator
  4. % llx lly urx ury shrink? AS - 
  5. %     llx lly urx ury is the bounding box for the page
  6. %     shrink? if true indicates that pages larger than the imageable area
  7. %         can be scaled down.
  8. %    always center the contents on the page if bigger than the img. area
  9. /AS {
  10.     /shrink? xdd
  11.     /Pury xdd
  12.     /Purx xdd
  13.     /Plly xdd
  14.     /Pllx xdd
  15.     % Get BBox of device.
  16.     gsave newpath clippath pathbbox newpath grestore
  17.     /Dury xdd
  18.     /Durx xdd
  19.     /Dlly xdd
  20.     /Dllx xdd
  21.  
  22.     % Calculate the scaling factors
  23.     Durx Dllx sub Dury Dlly sub
  24.     Pury Plly sub div  exch Purx Pllx sub div
  25.     2 copy gt { exch } if pop dup
  26.  
  27.     % Does it fit?
  28.     1.0 le { 
  29.         % Offset to the center of the imageable area
  30.         Durx Dllx add 2 div Dury Dlly add 2 div translate
  31.         % Scale appropriately if necessary
  32.         shrink? { dup scale } { pop } ifelse
  33.         % Offset to center of picture.
  34.         Purx Pllx add -2 div Pury Plly add -2 div translate
  35.     } { pop } ifelse
  36. } bd
  37.  
  38. %%EndFile
  39.