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 https://github.com/zflat/label_gen-free_ride.git
cd label_gen-free-ride
Run the setup task
rake setup
- Configure database settings
- Edit the config/database.rb file with correct parameters
Updating an existing database
rake db:upgrade
New database only: Run the database migrate task
rake db:migrate
Use label stock from http://www.onlinelabels.com/Products/OL875LP.htm
Run the utility from the comand line:
bundle exec script/app
Command:
bundle exec script/app current_max_number
- See the example For when 10 pages are generated
Example command:
bundle exec script/app gen_pages 10
- 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
Command:
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
- 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
- Once a label has been printed for a number, that label should never be printed again