Guest User

Untitled

a guest
May 3rd, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. %!PS-Adobe-3.0
  2. % %%BoundingBox: 0 0 595 842
  3. /inch {72 mul} def
  4. /cm {2.54 div inch} def
  5.  
  6. /grid { % stack: grid-size, width, height
  7. /h exch def
  8. /w exch def
  9. /s exch def
  10. /width w h lt {w} {h} ifelse def
  11. /height w h lt {h} {w} ifelse def
  12. /size s cm def
  13. /minor 10 def
  14. /msize size minor div def
  15. gsave
  16. % a4
  17. /offx 595 width size mul sub 2 div def
  18. /offy 842 height size mul sub 2 div def
  19. offx offy translate
  20. 0 -30 moveto
  21. 24 scalefont
  22. setfont
  23. height 2 string cvs show
  24. (x) show
  25. width 2 string cvs show
  26. ( \() show
  27. s 10 string cvs show
  28. (cm\)) show
  29. 1 setlinewidth
  30.  
  31. 0 0 moveto
  32.  
  33. 0.6 setgray
  34.  
  35. 0 1 height minor mul
  36. {
  37. /counter exch def
  38. /y counter msize mul def
  39. counter minor mod 0 ne {
  40. newpath
  41. 0 y moveto
  42. width size mul y lineto
  43. closepath
  44. stroke
  45. } if
  46. } for
  47.  
  48. 0 1 width minor mul
  49. {
  50. /counter exch def
  51. /x counter msize mul def
  52. counter minor mod 0 ne {
  53. newpath
  54. x 0 moveto
  55. x height size mul lineto
  56. closepath
  57. stroke
  58. } if
  59. } for
  60.  
  61. 0 setgray
  62.  
  63. 0 1 height
  64. {
  65. /counter exch def
  66. /y counter size mul def
  67. newpath
  68. 0 y moveto
  69. width size mul y lineto
  70. closepath
  71. stroke
  72. } for
  73.  
  74. 0 1 width
  75. {
  76. /counter exch def
  77. /x counter size mul def
  78. newpath
  79. x 0 moveto
  80. x height size mul lineto
  81. closepath
  82. stroke
  83. } for
  84. grestore
  85. } def
  86.  
  87. /Helvetica findfont
  88. 1 8 4 grid % grid size in cm, width and height (will always print in portrait)
  89. showpage
Advertisement
Add Comment
Please, Sign In to add comment