
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
= 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 using magnetic ink and you've got yourself a real check.
Note: This project is being written/maintained using Ruby 1.9.3. Other versions of Ruby have not been tested.
== 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 => 'John Smith',
: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/with_stubs-0.12.0.pdf].
It is also possible to include additional data in the stubs in the form of a table. If +with_stubs+ is true, then passing a 2D array to +stub_table_data+ will generate a table within each stub. To pass options to Prawn's #table method, set +stub_table_options+ with a hash of options. You can also use +stub_table_lambda+ to provide a block that is sent to the #table method. Example here[https://github.com/rylwin/check_writer/raw/master/spec/assets/with_stub_table_data-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) pdf.render # returns the PDF data for a PDF w/ two checks on two pages
== Signatures
Signatures can be included on the checks by setting the +:signature_image_file+ option, which should reference a JPG or PNG image. The recommended dimensions for a signature image are 175px x 40px.
If you need a second signature line on the check, +:second_signature_line+ to true.
== Void and Blank Checks
There are times where you may want to print a check that is clearly marked as a void check. Setting +void+ to a truish value will place "void" in place of the amount, check number, and the signature line.
If you want the PDF to include everything except the lower one-third of the page (the actual check part), set +blank+ to a truish value.
== Contributing to check_writer
== Copyright
Font: The GnuMICR font is distributed under GPL, but please note the additional comments from the font creator in the GnuMICR README[https://github.com/rylwin/check_writer/tree/master/vendor/GnuMICR-0.30].
Copyright (c) 2012 Ryan Winograd. See LICENSE.txt for further details.
FAQs
Unknown package
We found that check_writer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.