Skip to content

Instantly share code, notes, and snippets.

@jordanbyron
Created December 12, 2009 23:18
Show Gist options
  • Save jordanbyron/255141 to your computer and use it in GitHub Desktop.
Save jordanbyron/255141 to your computer and use it in GitHub Desktop.
Prawn::Document.generate 'labels.pdf' do
data = ["Label 1", "Label 2", "Label 3"]
# This will setup the documents margins according to the specified type
# then loop through the provided data
#
labels data, :type => "Avery5160" do |label|
text label.data
end
# Simpler version of the above which outputs the same result
labels data, :type => "Avery5160"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment