Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@blaines
Created September 6, 2009 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blaines/181679 to your computer and use it in GitHub Desktop.
Save blaines/181679 to your computer and use it in GitHub Desktop.
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