diafygi / pdfformfiller

Insert text into existing pdfs. Usefull for filling out pdf forms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PdfFormFiller

Build Status Coverage Status Documentation Status

This is a python library that lets you easily insert text into a pdf. It is super useful when you need to prefill an existing pdf template (for example, a grant application form) with your own data.

pip install pdfformfiller

Documentation

https://pdfformfiller.readthedocs.org/

Basic Example

from pdfformfiller import PdfFormFiller
filler = PdfFormFiller("myform.pdf")
filler.add_text(text, pagenum, (x1, y1), (x2, y2))
filler.write(outfile)

Development

To setup a development environment, you need to clone the repo and install dependencies.

git clone https://github.com/diafygi/pdfformfiller.git
cd pdfformfiller
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

# run tests
python test.py

If you want to generate a coverage report or build the documentation, you will need to install the developer dependencies.

sudo apt-get install poppler-utils
pip install -r dev_requirements.txt

# to get code coverage
coverage run --omit="venv/*" test.py
coverage report

# to build the docs
cd docs
make html

About

Insert text into existing pdfs. Usefull for filling out pdf forms.

License:GNU General Public License v3.0


Languages

Language:Python 100.0%