Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

automatically generated forms

2005-01-25
2013-05-02
  • Kyle Davenport
    Kyle Davenport
    2005-01-25

    I've used Open Tax Solver a couple years now.   I haven't minded (so much) having to fill in the form afterwards, but it always seemed like there should be a programatic solution. 

    Now I'm using the Adobe Acrobat Reader 7.0 Beta, and it allows imports from a "form data file".  The format can be tab-delimited text, xml, fdf, or xfdf.   Looks like we can finally generate the form automatically!

    I can send form examples,etc. to help.

     
    • Kyle Davenport
      Kyle Davenport
      2005-01-25

      yes, I mean on linux.

       
      • Robert Heller
        Robert Heller
        2005-01-25

        Where does one get AdobeAcrobat Beta 7.0 for Linux?  All that *seems* to be available for Linux is Acrobat Reader 5.0.10...

         
        • You can apply to get the beta from:
          https://adobe.centercode.com/callout/default.html?callid=\{4EE7B13E-2D84-4AF6-A27B-E8FD6C94A42F}
          It isn't perfect, but it is a decent (GTK) application.  Big improvement over 5, though not big enough to switch me off of xpdf.

           
        • Aston Roberts
          Aston Roberts
          2005-03-29

          Well Adobe finally released the Linux version of Adobe 7.0.
          You can get it from:
             ftp://ftp.adobe.com/pub/adobe/reader/unix/7x/7.0/enu/

          --Aston

           
    • Kyle Davenport
      Kyle Davenport
      2005-01-25

    • Kyle Davenport
      Kyle Davenport
      2005-01-25

      yes, they closed the beta program.  that's why I asked if there were any files I could provide, since I have the beta.

       
    • Aston Roberts
      Aston Roberts
      2005-01-26

      Good discussions!

      I would interested in seeing a PDF file, both before and after filling something (uniquely identifiable) into one of the fields.
      This could be very helpful in generating automatic forms.

      Thanks,
      Aston

       
    • Aston Roberts
      Aston Roberts
      2005-02-22

      A while back, Joel Young sent in a java program using the gpl
      itext pdf library to edit the f1040 and other form pdfs.  (I include it
      below.)  I have been looking for a way to seamlessly integrate it
      within OTS.  I have not been successful in running it.  Seems to
      require knowing the field-names somehow.  Also requires
      installing a java compiler, etc.. Its here for anyone to use,
      or suggest a way to do it from a binary, etc..
      Aston
      ---- Included File ---
      From: "Joel Young" <jdy@cs.brown.edu>

      Quick java program to edit the f1040 and other form pdfs. 
      It is used:
          java Edit_PDF_Form in.pdf out.pdf tag_file
      where tag_file is simple a set of pdf_tag, value pairs.
      The code and a sample tag file are below.
      Enjoy!
      Joel
      ---Edit_PDF_Form.java-----
      // Joel Young <jdy@cs.brown.edu>
      // License: GPL V2 blah blah
      import com.lowagie.text.pdf.PdfReader;
      import com.lowagie.text.pdf.PRAcroForm;
      import com.lowagie.text.pdf.PdfStamper;
      import com.lowagie.text.pdf.AcroFields;
      import com.lowagie.text.DocumentException;

      import java.util.Iterator;
      import java.io.IOException;
      import java.io.FileOutputStream;
      import java.io.*;

      import java.util.HashMap;

      public class Edit_PDF_Form {

        public static void main(String[] args) throws IOException,
      DocumentException {

          PdfReader reader = new PdfReader(args[0]);
          PdfStamper stamp = new PdfStamper(reader, new
      FileOutputStream(args[1]));
          AcroFields form = stamp.getAcroFields();

          HashMap  a = new HashMap();

          try {
            BufferedReader in = new BufferedReader(new FileReader(args[2]));
            String key;
            String value;
            while ((((key = in.readLine()) != null) && ((value =
      in.readLine()) != null))) {
              a.put(key,value);
            }
          } catch (IOException e) {
          }

          for(Iterator i = reader.getAcroForm().getFields().iterator();
      i.hasNext();) {

            PRAcroForm.FieldInformation field = (PRAcroForm.FieldInformation)
      i.next();

            field.getInfo();

            if (a.containsKey(field.getName())) {
              form.setField(field.getName(),(String)a.get(field.getName()));
            }
          }

          stamp.close();
        }
      }
      ---END--------------------

      ------SAMPLE TAG FILE-----
      f1-4
      First Name
      f1-5
      Last Name
      f1-6
      First Name
      f1-7
      Last Name
      f1-8
      Home Address
      f1-9
      Apt Number
      f1-11
      SSN
      f1-12
      SN
      f1-13
      SSSN
      f1-10
      CITY
      f1-14
      SSN
      f1-15
      SN
      f1-16
      SSSN
      ---END--------------------

       
    • Aston Roberts
      Aston Roberts
      2005-02-25

      Forwarding followup from Joel Young:

      There is a very closely related code that extracts the tag
      names.  Edit* applies a tag file to a pdf.  Read* extracts tags
      and values from an edited .pdf file (say the output of Edit* or of
      acroread pro).  Tags* extracts the tags and some indicators of
      valid values.
      Enjoy
      Joel

         <PDF.zip>

      (I can forward the file to anyone else interested.)
      --Aston

       
    • Joe R
      Joe R
      2008-03-05

      Here's another idea related to forms.

      I convert the data for the form into an fdf file, and then use pdftk (it's in Debian) to merge the fdf file into the pdf form. I've got a writeup on my website - www.myown1.com - with details including sample code in C and an example using f1040. It's not specifically set up for OTS yet, but could be adapted for it.
      Then I just print the filled-in form using xpdf.
      Joe R