<commit_before>= check_writer

A ruby gem to help generate checks in PDF format.

It generates PDF checks that look something 
like this[https://github.com/rylwin/check_writer/raw/master/spec/assets/test-0.12.0.pdf].
Print that PDF on check stock and you've got yourself a real check.

== Project Status

A version of this code has been used in a production application for a couple of years 
and we are finally getting around to extracting the check writing code. As we go through this 
process, there may be significant changes to the API. You've been warned.

Currently the only check stock format that is supported is the 1/3 bottom check. 
You can get some check stock at 
Amazon[http://www.amazon.com/gp/product/B002HIV1KQ/ref=as_li_qf_sp_asn_il_tl?ie=UTF8&tag=checkwriter-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=B002HIV1KQ],
amongst other places.

== GnuMICR

check_writer uses GnuMICR (http://www.sandeen.net/GnuMICR) to print the MICR numbers at the 
bottom of the check. Please read the notes on the GnuMICR site. We have not 
had any issues using this font (2+ years now), but that is no guarantee.

== Example

  @check = CheckWriter::Check.new(
    :number => '12345',                               # the check number
    :date => Date.yesterday,                          # Default: today

    :payee_name => '<NAME>',
    :payee_address => ['Line 1', 'City, State, Zip'], # Array of as many lines as desired

    :payor_name => 'Payor Name',
    :payor_address => ['Line 1', 'City, State, Zip'],

    :bank_name => 'Bank of America',
    :bank_address => ['Line 1', 'City, State, Zip'],
    :bank_fraction => '12-9876/1234',

    :routing_number => '1234567689',
    :account_number => '123456789',

    :amount => '1003.23',
    :memo => 'Memo: Void after 60 days'
  )   

  check.to_pdf # returns PDF file data

If you set the +with_stubs+ option to +true+ you'll get a bit of formatting
and information displayed in the top and middle check stub. 
Here's an example[https://github.com/rylwin/check_writer/raw/master/spec/assets/test-0.12.0.pdf].

Instead of just returning a PDF, you can access the Prawn PDF writer object 
(Prawn::Document), which you can use to further customize the check or even 
include multiple checks on the same PDF:

  pdf = check1.to_prawn
  pdf.start_new_page # this is a prawn method
  pdf = check2.to_prawn(pdf)<commit_msg>Fix incorrect link in README<commit_after>= check_writer

A ruby gem to help generate checks in PDF format.

It generates PDF checks that look something 
like this[https://github.com/rylwin/check_writer/raw/master/spec/assets/test-0.12.0.pdf].
Print that PDF on check stock and you've got yourself a real check.

== Project Status

A version of this code has been used in a production application for a couple of years 
and we are finally getting around to extracting the check writing code. As we go through this 
process, there may be significant changes to the API. You've been warned.

Currently the only check stock format that is supported is the 1/3 bottom check. 
You can get some check stock at 
Amazon[http://www.amazon.com/gp/product/B002HIV1KQ/ref=as_li_qf_sp_asn_il_tl?ie=UTF8&tag=checkwriter-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=B002HIV1KQ],
amongst other places.

== GnuMICR

check_writer uses GnuMICR (http://www.sandeen.net/GnuMICR) to print the MICR numbers at the 
bottom of the check. Please read the notes on the GnuMICR site. We have not 
had any issues using this font (2+ years now), but that is no guarantee.

== Example

  @check = CheckWriter::Check.new(
    :number => '12345',                               # the check number
    :date => Date.yesterday,                          # Default: today

    :payee_name => '<NAME>',
    :payee_address => ['Line 1', 'City, State, Zip'], # Array of as many lines as desired

    :payor_name => 'Payor Name',
    :payor_address => ['Line 1', 'City, State, Zip'],

    :bank_name => 'Bank of America',
    :bank_address => ['Line 1', 'City, State, Zip'],
    :bank_fraction => '12-9876/1234',

    :routing_number => '1234567689',
    :account_number => '123456789',

    :amount => '1003.23',
    :memo => 'Memo: Void after 60 days'
  )   

  check.to_pdf # returns PDF file data

If you set the +with_stubs+ option to +true+ you'll get a bit of formatting
and information displayed in the top and middle check stub. 
Here's an example[http://github.com/rylwin/check_writer/blob/master/spec/assets/with_stubs-0.12.0.pdf?raw=true].

Instead of just returning a PDF, you can access the Prawn PDF writer object 
(Prawn::Document), which you can use to further customize the check or even 
include multiple checks on the same PDF:

  pdf = check1.to_prawn
  pdf.start_new_page # this is a prawn method
  pdf = check2.to_prawn(pdf)
{'fraction_non_alphanumeric': 0.09883236030025021, 'fraction_numerical': 0.03252710592160134, 'mean_word_length': 3.5729265967588177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 3, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3158685', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1489, 'n_words': 569}