Multivalent API

multivalent.std.adaptor.pdf
Class Forms

java.lang.Object
  extended by multivalent.std.adaptor.pdf.Forms

public class Forms
extends java.lang.Object

Manipulate interactive forms: export, import. Forms can be extracted from FDF or PDF, modified, and written to a new FDF or PDF.

Keys of the Map are fully qualified export field names (concatenated TM dictionary keys), Values are form V settings.

Version:
$Revision: 1.5 $ $Date: 2004/05/24 00:09:42 $

Method Summary
static java.util.Map<java.lang.String,java.lang.Object> export(PDFReader pdfr)
           
static java.util.Map<java.lang.String,java.lang.Object> exportDefaults(PDFReader pdfr)
          Returns a Map of the FDF's or PDF's interactive form data, or an empty Map if there is no form (there is at most one form, with fields on possibly many pages).
static void flatten(PDFWriter pdfw)
          Flattens forms by fusing appearance onto pages.
static void merge(java.util.Map<java.lang.String,java.lang.Object> map, PDFWriter pdfw)
          Merge the values of a map into a new FDF/PDF's form.
static void set(java.util.Map<java.lang.String,java.lang.Object> map, PDFWriter pdfw)
          Set the values of a map as a new FDF/PDF's form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

export

public static java.util.Map<java.lang.String,java.lang.Object> export(PDFReader pdfr)
                                                               throws java.io.IOException
Throws:
java.io.IOException

exportDefaults

public static java.util.Map<java.lang.String,java.lang.Object> exportDefaults(PDFReader pdfr)
                                                                       throws java.io.IOException
Returns a Map of the FDF's or PDF's interactive form data, or an empty Map if there is no form (there is at most one form, with fields on possibly many pages).

Throws:
java.io.IOException

set

public static void set(java.util.Map<java.lang.String,java.lang.Object> map,
                       PDFWriter pdfw)
                throws java.io.IOException
Set the values of a map as a new FDF/PDF's form. If a key is not specified in the passed form, it is set to null.

Throws:
java.io.IOException

merge

public static void merge(java.util.Map<java.lang.String,java.lang.Object> map,
                         PDFWriter pdfw)
                  throws java.io.IOException
Merge the values of a map into a new FDF/PDF's form. If a key is not specified in the passed form, it is set retains its existing value.

Throws:
java.io.IOException

flatten

public static void flatten(PDFWriter pdfw)
                    throws java.io.IOException
Flattens forms by fusing appearance onto pages. This makes forms uneditable because in fact there is no form as a distinct entity, just its appearance as lines and text. Incidentally reduces file size. If changed values, first merge or set, then flatten. Recommended PDFWriter.refcntRemove() throw out objects no longer used.

Throws:
java.io.IOException

Multivalent API