Rabels Library
Rabels is a ruby library that provides the ability to create a PDF file of mailing labels. The Rabels::Address and Rabels::LabelSpecification classes are populated by the user and passed into the create_labels method as parameters. Rabels requires the pdf-writer library to actually generate the PDF.
WARNING
Rabels is a dead project. You should use pdf-labels instead. It’s much better, as it comes pre-configured with a bunch of label types, and its API lets you put anything you want on the label (not just an address).
Usage
# Create an address that Rabels can use
address = Rabels::Address.new(
:addressee => 'Mr. & Mrs. John and Jane Doe and Family',
:address_line_1 => '12345 Mockingbird Lane',
:city => 'Chicago',
:state => 'IL',
:zip => '60606')
# Dump 10 of these addresses into an Array
addresses = []
10.times { addresses << address }
# Create some specifications for the labels, specifying sizes in inches
label_spec = Rabels::LabelSpecification.new(
:page_margin_top => 0.5,
:page_margin_bottom => 0.5,
:page_margin_left => 0.15625,
:page_margin_right => 0.15625,
:label_width => 2.625,
:label_height => 1,
:label_font => 'Times-Roman',
:label_font_size => 10,
:label_font_color => Color::RGB::Black,
:label_justification => :center)
# Create the PDF
Rabels.create_labels(addresses, label_spec, 'test.pdf')
# Create a new PDF, using the pre-configured specs for the
# Avery 8660 label
Rabels.create_labels(addresses,
Rabels::get_preconfigured_label_specifications['AVERY_8660'],
'test2.pdf')
Download
GitHub
Most Popular Posts
Tags
.NET
android
apple
bugzilla
C#
career development
charts
code coverage
concurrency
continued education
couchdb
couchdb case study
couchrest
design
dsl
exceptions
funny
git
GitHub
Gnome Do
groovy
hardware
interviews
java
javaee
javaone2008
macbook
non-tech news
nosql
open source
orbitz
personal projects
polyglot persistence
productivity
rails
rails3
ruby
Software
Standup Timer
testing
textme
TravelAgent
ubuntu
weather
windycitydb
Archives
Blogroll
Industury News
Other Links
My GitHub Feed
- jwood pushed to master at centro/capssh
- jwood created tag v0.0.8 at centro/capssh
- jwood pushed to master at centro/capssh
- jwood pushed to master at centro/surface
- jwood pushed to master at centro/surface
- jwood pushed to master at centro/capssh
- jwood created tag v0.0.7 at centro/capssh
- jwood pushed to master at centro/capssh
- jwood pushed to master at centro/surface
- jwood created tag v0.0.6 at centro/capssh





