• Stars
    star
    171
  • Rank 220,989 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 14 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

port of PDF fdfgen library for filling in PDF forms to Python

fdfgen

Build Status

Python port of the PHP forge_fdf library by Sid Steward

PDF forms work with FDF data. I ported a PHP FDF library to Python a while back when I had to do this and released it as fdfgen. I use that to generate an fdf file with the data for the form, then use pdftk to push the fdf into a PDF form and generate the output.

QUICK INSTALL

pip install fdfgen

HOW IT WORKS

  1. You (or a designer) design the form.pdf in Acrobat.

  2. Mark the form fields and take note of the field names. This can be done either through Acrobat or by installing pdftk and entering the command line

     pdftk [pdf name] dump_data_fields
    
  3. Let's say your form has fields "name" and "telephone".

    Use fdfgen to create a FDF file:

     #!/usr/bin/env python
     from fdfgen import forge_fdf
     
     fields = [('name', 'John Smith'), ('telephone', '555-1234')]
     fdf = forge_fdf("",fields,[],[],[])
     
     with open("data.fdf", "wb") as fdf_file:
         fdf_file.write(fdf)
    
  4. Then you run pdftk to merge and flatten:

    pdftk form.pdf fill_form data.fdf output output.pdf flatten
    

    and a filled out, flattened (meaning that there are no longer editable form fields) pdf will be in output.pdf.

CHANGELOG

  • 0.16.1 -- 2017-11-21 -- Fix TypeError in python 3.6 by Tom Grundy (@caver456)
  • 0.16.0 -- 2017-02-22 -- Allow for different values for each checkbox by [email protected]
  • 0.15.0 -- 2016-09-23 -- Encode field names as UTF-16 fix by Andreas Pelme [email protected]
  • 0.14.0 -- 2016-08-09 -- Adobe FDF Compatibility added by Cooper Stimson (@6C1)
  • 0.13.0 -- 2016-04-22 -- python 3 bugfix from Julien Enselme [email protected]
  • 0.12.1 -- 2015-11-01 -- handle alternative checkbox values fix from Bil Bas https://github.com/Spooner
  • 0.12.0 -- 2015-07-29 -- python 3 bugfixes
  • 0.11.0 -- 2013-12-07 -- python 3 port from Evan Fredericksen
  • 0.10.2 -- 2013-06-16 -- minor code refactor and added command line options from Robert Stewart https://github.com/rwjs
  • 0.10.1 -- 2013-04-22 -- unbalanced paren bugfix from Brandon Rhodes [email protected]
  • 0.10.0 -- 2012-06-14 -- support checkbox fields and parenthesis in strings from Guangcong Luo [email protected]
  • 0.9.2 -- 2011-01-12 -- merged unicode fix from Sébastien Fievet [email protected]

RUNNING TESTS:

  • Create a virtual environment
  • tox is required to run the tests. You can install the correct version with pip install -r requirements-tests.txt
  • Run tox to run tests for all Python versions.
  • To run a specific test and specific Python versions, you may use tox -e py27 -- tests/test_encoding.py

More Repositories

1

mediathread

Django application for multimedia annotations facilitating collaboration on video and image analysis. Developed at the Columbia University Center for Teaching and Learning.
JavaScript
82
star
2

astro-simulations

Astronomy Simulations and Animations
JavaScript
67
star
3

django-munin

django application for simple munin integration
Python
57
star
4

django-lti-provider

django-lti-provider adds LTI functionality for the Django web framework. This work began as a port of MIT's LTI Flask Sample, which demonstrates a sample LTI provider for the Flask Framework based on the Python LTI library, PyLTI.
Python
46
star
5

django-smoketest

smoke test framework for Django
Python
31
star
6

xmeml

XML parser for Final Cut Pro <xmeml> files with clipping API to make new sequences out of others
Python
20
star
7

ccnmtldjango

CCNMTL's custom Paste Template for django apps
HTML
18
star
8

django-pagetree

CMS guts. Hierarchical tree of pages that are in turn made up of blocks.
Python
15
star
9

rolf

porting rollo to django
Python
14
star
10

footprints

Footprints is a project to develop a database that tracks individual books through time and space to uncover patterns of trade and learning throughout the Jewish communities of Europe, Asia and the Americas during the modern period.
JavaScript
13
star
11

django-contact-us

simple, reusable contact us form for django
Python
8
star
12

django-pageblocks

reusable CMS components (to be used with django-pagetree)
Python
8
star
13

graffle2svg

convert .graffle files to .svg (by timwintle) [this is a clone]
Python
7
star
14

django-quizblock

Quiz block for PageTree
Python
6
star
15

django-lti-provider-example

Example Django application using the django-lti-provider library
Python
6
star
16

hound

Alert off graphite metrics
Go
6
star
17

TinyMCE-Citation-plugin

TinyMCE plugin to support media citations by out-of-wysiwyg javascript or drags into wysiwyg area.
JavaScript
5
star
18

djangohelpers

a collection of useful middleware, template tags, etc
Python
5
star
19

SherdJS

Javascript framework to enable annotating of diverse media from diverse sources. developed at the Columbia Center for New Media Teaching and Learning (CCNMTL)
JavaScript
5
star
20

apache2-cas-docker

docker container with apache2 and mod_auth_cas
Shell
4
star
21

digital-literacy

https://ccnmtl.github.io/digital-literacy/
HTML
4
star
22

moodle-mp4filter

A simple Moodle filter that processes mp4 files and outputs some video player embed code
PHP
4
star
23

djangowind

django auth integration with CU's WIND authentication system (related to but slightly different from CAS)
Python
4
star
24

react-range-step-input

An <input type=range> that steps up and down on click
JavaScript
4
star
25

econplayground.js

aka EconPractice - Environment for authoring and interacting with economics concepts
JavaScript
4
star
26

dmt

django port of our PMT
Python
4
star
27

meaningfulconsent

Meaningful Consent is a self-paced educational module using the django-pagetree architecture.
JavaScript
3
star
28

capsim

public health capstone simulation
Less
3
star
29

ctldjango

Django project template
HTML
3
star
30

blackrock_fetcher

data fetcher and processor for Blackrock forest
Python
3
star
31

angeldust

python library to talk to podcast producer via kino HTTP API
Python
3
star
32

django_courseaffils

Django infrastructure to make a "Group space" that we call a Course
Python
3
star
33

elgg-default-group-notifications

PHP
3
star
34

postfix-docker

postfix docker container
Shell
3
star
35

openid-wind-bridge

implementation of an OpenID 2.0 bridge to Wind, the Columbia University single-signon mechanism
PHP
3
star
36

ipython-notebook

Python
3
star
37

npo

JavaScript
3
star
38

logiclearner

Logic Learner is an online learning tool that helps computer science, engineering, and mathematics students improve their fluency and problem solving process in writing proofs for propositional logic.
TypeScript
3
star
39

elgg-first-time-events

The first_time_events plugin provides event triggers for "first time" actions.
PHP
3
star
40

vital

VITAL is a web based video clipping, annotation, and multimedia essay composition tool.
Java
3
star
41

econplayground

aka EconPractice - Environment for authoring and interacting with economics concepts
JavaScript
3
star
42

mvsim

JavaScript
2
star
43

dagon

simple commandline tool to make LDAP queries against CU's LDAP directory
Go
2
star
44

tfmodules

reusable terraform modules
HCL
2
star
45

pmt

CCNMTL's Project Management Tool
JavaScript
2
star
46

elgg-first-login-redirector

First Login Redirector allows site administrators to configure a custom URL which new users will be sent to after they first log into your Elgg system.
PHP
2
star
47

ccnmtlsettings

our common django settings
Python
2
star
48

brownfield_django

conversion of old TurboGears brownfield site to Django
HTML
2
star
49

diglit-dh-badge

https://ccnmtl.github.io/diglit-dh-badge/
JavaScript
2
star
50

elgg-new-profile-redirector

Configure custom location to send users after they first edit their profiles
PHP
2
star
51

smart_sa

Multimedia Social Support Intervention: Adherence to HIV Care in South Africa
JavaScript
2
star
52

django-fridgeblock

refrigerator magnet game converted to a pageblock
Python
2
star
53

juxtapose

Video Juxtaposition Tool
JavaScript
2
star
54

TinyMCE-EditorWindow-plugin

creates a lighter interface for in-context editing. When supported tags (e.g. anchor tags) surround the cursor, then a little window appears below that line with relevant info and direct access to e.g. a hyperlink
JavaScript
2
star
55

locustempus

Locus Tempus is a powerful application designed to facilitate map-based learning activities across disciplines. Locus Tempus features tools for authoring maps, inviting collaborators, and analyzing data spatially and temporally.
Python
2
star
56

writlarge

Writ Large: Discover the Hidden Histories of New York City’s Teaching and Learning Communities
JavaScript
2
star
57

tobaccocessation

Tobacco Cessation is an educational website that provides students in the Columbia College of Dental Medicine with multimedia learning modules on strategies designed to assist clinicians in delivering and supporting effective treatments for tobacco use and dependence. The site offers a framework for self-study lessons and activities, including immediate-response quizzes, treatment activities, four virtual patients, and demonstrative videos, which students are assigned to review before attending a required tobacco cessation seminar. After students complete the online modules independently and learn the material by working through the online scenarios, they are then asked to role-play potential encounters during the seminar and reflect on their experience.
Python
2
star
58

forest

our serialized content system
Python
1
star
59

ctlmezzanine

A custom Mezzanine template for CTL
Python
1
star
60

ccnmtl-git-homedir

Git tools for setting up ~git for use as a local repo used for deployment
Shell
1
star
61

mergedd

A utility to merge the latest pull request on a branch
Python
1
star
62

docker

utility dockerfiles
Makefile
1
star
63

diglit-acrl-badge

https://ccnmtl.github.io/diglit-acrl-badge/
HTML
1
star
64

uelc

Python
1
star
65

pass

sunsetted
JavaScript
1
star
66

hellenic-streets

Hellenic, or Greek Streets
JavaScript
1
star
67

ssnmhugo

Social Support Network Mapping (SSNM) RFP on Hugo platform
HTML
1
star
68

mediathread-collect

Common code for the Chrome, Safari, and Firefox extensions for Mediathread
JavaScript
1
star
69

biblio-drupal

local branch for biblio module. see http://drupal.org/project/biblio
PHP
1
star
70

mailchimp-subscriber

This repository is no longer actively maintained.
Python
1
star
71

django-stagingcontext

staging environment context processor
Python
1
star
72

nepi

The ICAP Nursing e-learning platform is designed to support nursing and midwifery education and training.
Python
1
star
73

teachdentistryhugo

CSS
1
star
74

carr

JavaScript
1
star
75

tasty

folksonomic tagging microapp
Python
1
star
76

turbogears_pip_bootstrapper

A bootstrap-process skeleton for installing TG projects with pip and virtualenv
Python
1
star
77

twister

chained random number generation as a web service
Python
1
star
78

worth3

WORTH: an offline HTML5 app
HTML
1
star
79

3demos

Drew Youngren's 3D Calculus Visualizations
Svelte
1
star
80

diabeaters

sunsetted
HTML
1
star
81

nginx-cas-docker

nginx with CAS support in a docker container
Makefile
1
star
82

case-consortium

Hugo site for Case Consortium
JavaScript
1
star
83

phtc

Python
1
star
84

django-pagetree-epub

epub export for pagetree
Python
1
star
85

epistolae-hugo

HTML
1
star
86

marginalia-lib-mirror

A git mirror of the marginalia javascript annotation project
JavaScript
1
star
87

compiled

ALERT: This is OLD COMPILED. New version is compiled3. Don't use this.
JavaScript
1
star
88

flgstatic

hugo version of film language glossary
CSS
1
star
89

wings

sunsetted
JavaScript
1
star
90

php52-docker

A php 5.2 container for preserving some ancient lamp apps
1
star
91

graphite-probe-linux

probe system info for graphite
Python
1
star
92

mediathread-chrome

Chrome extension for importing assets to Mediathread
JavaScript
1
star
93

polarexplorer

JavaScript
1
star
94

mediathread-safari

Safari extension for importing assets to Mediathread
JavaScript
1
star
95

TinyMCE-clone

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB
JavaScript
1
star
96

lanretam-wagtail

Lanretam is a web-based case study developed by AMDD and CTL at Columbia University
SCSS
1
star
97

participants-widget

Wordpress Participants plugin/widget, to display posts and comments
PHP
1
star
98

ccdb

Code that runs https://calculator.law.columbia.edu/
HTML
1
star
99

worth2

E-WORTH (Women On the Road To Health)
JavaScript
1
star
100

eureka

Eureka - A guidebook for using improvisation in the ear training classroom
CSS
1
star