Skip to content

Instantly share code, notes, and snippets.

@henrik
Created February 16, 2012 16:47
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save henrik/1846377 to your computer and use it in GitHub Desktop.
Save henrik/1846377 to your computer and use it in GitHub Desktop.
Rotate and center text with Prawn as a watermark, e.g. for "[PAID]" on an invoice.
create_stamp("stamp") do
fill_color "cc0000"
text_box "[PAID]",
:size => 2.cm,
:width => bounds.width,
:height => bounds.height,
:align => :center,
:valign => :center,
:at => [0, bounds.height],
:rotate => 45,
:rotate_around => :center
end
stamp("stamp")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment