Created
December 12, 2009 23:18
-
-
Save jordanbyron/255141 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
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