https://github.com/tdooner/pdf-tax-form-filler
Experimental proof of concept to fill PDF forms -- tax forms and others
https://github.com/tdooner/pdf-tax-form-filler
Last synced: 3 months ago
JSON representation
Experimental proof of concept to fill PDF forms -- tax forms and others
- Host: GitHub
- URL: https://github.com/tdooner/pdf-tax-form-filler
- Owner: tdooner
- Created: 2016-04-09T20:36:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-07T05:17:01.000Z (about 8 years ago)
- Last Synced: 2025-01-15T00:29:22.819Z (5 months ago)
- Language: Ruby
- Size: 563 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PDF Tax Form Filler
==================
This is part my attempt to write tax preparation software for April 2017. This
repo contains the lower level of the abstraction -- the PDF form filling
library.Installation
---------------
1. Install ruby, then bundler (`gem install bundler`)
2. bundle installUsage
---------------
Currently everything is hardcoded. Render the proof of concept:```
ruby form.rb
```Methodology
---------------
Unfortunately, tax forms in various jurisdictions vary too wildly to use
automated field detection. Furthermore, the landscape of PDF form filling
libraries is limited at best, with even leading tools like `pdftk` not
supporting fine-grained rendering options. Almost certainly, we will run into
forms that look terrible when filled with `pdftk fill_form`.This approach is different. Instead of trying to use the existing form fields,
we simply composite two PDFs atop each other. Since this is a simple operation
(combining the objects), it is well-supported by various libraries.The top PDF contains the form field values, and is rendered by Prawn. The bottom
PDF is the government-provided form. Then, we use a PDF watermark library
(the `combine_pdf` gem) to composite the form fills on top of the
government-provided form. Pdftk can do this too with the `background` command,
but for now the pure-ruby solution is easier to install and manage.