Created
July 31, 2009 18:42
-
-
Save amoeba/159366 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prawn' | |
Prawn::Document.generate('crop-marks.pdf') do | |
spacing = 12 | |
margin = 100 | |
canvas do | |
# topleft corner | |
stroke_line [bounds.left + spacing, bounds.top - margin], | |
[bounds.left + margin - spacing, bounds.top - margin] | |
stroke_line [bounds.left + margin, bounds.top - spacing], | |
[bounds.left + margin, bounds.top - margin + spacing] | |
# topright corner | |
stroke_line [bounds.right - spacing, bounds.top - margin], | |
[bounds.right - margin + spacing, bounds.top - margin] | |
stroke_line [bounds.right - margin, bounds.top - spacing], | |
[bounds.right - margin, bounds.top - margin + spacing] | |
# bottomleft corner | |
stroke_line [bounds.left + spacing, bounds.bottom + margin], | |
[bounds.left + margin - spacing, bounds.bottom + margin] | |
stroke_line [bounds.left + margin, bounds.bottom + spacing], | |
[bounds.left + margin, bounds.bottom + margin - spacing] | |
# bottomright corner | |
stroke_line [bounds.right + spacing, bounds.bottom + margin], | |
[bounds.right - margin + spacing, bounds.bottom + margin] | |
stroke_line [bounds.right - margin, bounds.bottom + spacing], | |
[bounds.right - margin, bounds.bottom + margin - spacing] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bottom right corner should be:
bottomright corner