Skip to content

Instantly share code, notes, and snippets.

@blaines

blaines/gist:181679

Created Sep 6, 2009
Embed
What would you like to do?
module Prawn
class Document
#module CropMarks
def draw_crop_marks(spacing, margin, lineweight)
#crop mark line thickness
line_width(lineweight)
#spacing = 2.125
#margin = 9
#Draw crop marks
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
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment