Yuras / pdf-toolbox

A collection of tools for processing PDF files in Haskell
181 stars 25 forks source link

Simple API for generating FDF files #12

Open alexanderkjeldaas opened 9 years ago

alexanderkjeldaas commented 9 years ago

As I understand it, a FDF file is a very simple PDF file with one object containing key/value pairs.

I'm really after populating PDF forms, where generating FDF files is one aspect.

Yuras commented 9 years ago

Hmm... That is the first time I hear about FDF.

Do you have examples of FDF files? Any ideas how the API should look like?

(NOTE: described in PDF Reference, section 12.7.7.2)

alexanderkjeldaas commented 9 years ago

It's the end of the year, and I needed to file some paperwork. PDF forms use FDF.

I used pdftk to create FDF files from official filing documents. Forms - the tax authority in Sweden has lots of them!

http://www.skatteverket.se/funktioner/sok/sok.4.64a656d113f4c7597011b3.html?query=form&searchTab=0

Yuras commented 9 years ago

@alexanderkjeldaas I downloaded few PDF files from your URL, and they have PDF forms. But I have no idea what to do with them. How to produce FDF file from PDF form? How FDF files are used? What software can be used to read them? What "simple API" you means? Sorry so so many questions, but I really have no idea what FDF file are for.

alexanderkjeldaas commented 9 years ago

I think the following link describes it pretty well.

http://www.myown1.com/linux/pdf_formfill.shtml

Yuras commented 9 years ago

@alexanderkjeldaas Thank you, now it makes more sense.

Will simple "writeFDF :: Handle -> HashMap Text (Object ()) -> IO ()" function work for you? It requires handle to write to and a map from field name to PDF object.