Skip to content
Utility for generating and recording bike number labels. Recording the numbers ensures unique numbers are generated.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Label Generation Utility for Free Ride

Utility for generating bike number labels.

After labels are printed, they are confirmed to ensure those numbers are not generated again for the next printing.


git clone
cd label_gen-free-ride

Run the setup task

rake setup
  • Configure database settings
    • Edit the config/database.rb file with correct parameters

Database setup

Updating an existing database

rake db:upgrade

New database only: Run the database migrate task

rake db:migrate


Use label stock from

Run the utility from the comand line:

bundle exec script/app

Basic workflow

Verify that the highest number confirmed is correct


bundle exec script/app current_max_number

Generate a PDF of the next pages of labels

  • See the example For when 10 pages are generated

Example command:

bundle exec script/app gen_pages 10

Print the PDF on label stock

  • Use manual feed for the label stock
    • Remove paper from other trays to force input from manual feed
    • Feed a single sheet at a time to prevent multiples from being grabbed
  • Print one-sided
  • Do not let the PDF viewer or printer driver scale the output
    • Send the PDF data to the printer directly
    • Convert to post-script if necessary to prevent scaling


lpr -Pprinter -o media=Upper -o sides=one-sided labels.pdf
  • Troubleshoot any printing problems
    • Re-print specific pages from the PDF if necessary

Get a list of printer options:

lpoptions -p printer -l

Command to extract specific pages:

gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=22 -dLastPage=36 -sOutputFile=outfile_p22-p36.pdf 100p-inputfile.pdf

Confirm the highest number that was printed

  • Update the database to keep track
  • See the example for when the max number printed was 1529:

Example command:

bundle exec script/app confirm_printed 1529

Delete the PDF after printing is confirmed

  • Once a label has been printed for a number, that label should never be printed again
You can’t perform that action at this time.