codeforamerica / pdfhook

A Python web application for converting PDF forms into PDF-filling APIs
https://pdfhook.herokuapp.com
MIT License
46 stars 24 forks source link

Alternatives to PDFTk #20

Open joffemd opened 8 years ago

joffemd commented 8 years ago

There may be additional or easier to use functionality in PDFBox and Poppler.

Apache PDFBox: http://pdfbox.apache.org/

Poppler: https://people.freedesktop.org/~ajohnson/docs/poppler-glib/PopplerFormField.html (this is the specific page discussing form functionality)

bengolder commented 8 years ago

It looks like pdftk adds CLI functionality by wrapping an open source Java library called iText. The author of iText mentions this in a comment on a StackOverflow question, and it was also revealed in some error messages I received while testing with pdftk (lowagie is the last name of the author of iText, Bruno Lowagie).

Here are the iText API docs. And an example addressing fdf & xfdf forms.

In my more recent tests, I've run into some trouble with Unicode handling in pdftk. It seems that if pdftk has limits on functionality that are troublesome to us, we may want to consider interfacing more directly with iText or using an alternative.

bengolder commented 8 years ago

Mcpdf fixes PDFtk's unicode issues, so you can write Łódź into your forms. Mcpdf aims to become a drop-in replacement for PDFtk.

stvnrlly commented 8 years ago

The stapler PDF tool doesn't yet support form-filling, but has it on the roadmap.

bengolder commented 8 years ago

Just tried mcpdf and unfortunately it does not have sufficient commands to be useful to the project.

bengolder commented 8 years ago

I noticed a few python libraries that might be able to work as substitutes.

bengolder commented 8 years ago

@rogerawad is interested trying to write an iText wrapper, and this looks like a viable approach, as iText has lots of great examples. Moving that attempt to https://github.com/codeforamerica/pdfhook/issues/64

danielleitcs commented 6 years ago

Users on IT Central Station interested in alternatives to solutions like PDFTk also read reviews for Windward. This user in particular writes in his review that with this tool, "PDF and Word reports are so easy to create. We can develop any report at least five times faster." You can read the rest of his review here.

bengolder commented 6 years ago

@danielleitcs thanks for the suggestion, but there's some criteria I should clarify. Viable alternatives would: