Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Multivalent API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## multivalent.std.adaptor.pdf
Class Forms

    java.lang.Object
      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.

- The contents of the form can be `read`, from a PDF or FDF file, or `read defaults values` from a PDF. Keys may already be known, or all keys can be iterated with `Map#iterator()`.
- New form values can be set with `Map.put(Object,Object)`. Data can come from FDF or XML or directly from a database or computed or elsewhere. Note that new form fields cannot be created simply by adding a new key to the Map.
- A new PDF can be created with `PDFWriter`, new or overwrite. The contents of the form can `replace` or `merged` with existing PDF. before `writing`.
- If want to make form read-only, can `flatten(PDFWriter)`.

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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Multivalent API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD