com.itextpdf.text.pdf
Class FdfReader

java.lang.Object
  extended by com.itextpdf.text.pdf.PdfReader
      extended by com.itextpdf.text.pdf.FdfReader
All Implemented Interfaces:
PdfViewerPreferences

public class FdfReader
extends PdfReader

Reads an FDF form and makes the fields available

Author:
Paulo Soares

Nested Class Summary
 
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfReader
PdfReader.PageRefs
 
Field Summary
(package private)  PdfName encoding
           
(package private)  HashMap<String,PdfDictionary> fields
           
(package private)  String fileSpec
           
 
Fields inherited from class com.itextpdf.text.pdf.PdfReader
acroForm, acroFormParsed, catalog, certificate, certificateKey, certificateKeyProvider, consolidateNamedDestinations, decrypt, encrypted, endobj, endstream, eofPos, freeXref, lastXref, newXrefType, objStmMark, objStmToOffset, pageInhCandidates, pageRefs, password, pdfVersion, pValue, rebuilt, remoteToLocalNamedDestinations, rootPages, rValue, sharedStreams, strings, tampered, tokens, trailer, xref
 
Constructor Summary
FdfReader(byte[] pdfIn)
          Reads an FDF form.
FdfReader(InputStream is)
          Reads an FDF form.
FdfReader(String filename)
          Reads an FDF form.
FdfReader(URL url)
          Reads an FDF form.
 
Method Summary
 byte[] getAttachedFile(String name)
          Gets a byte[] containing a file that is embedded in the FDF.
 PdfDictionary getField(String name)
          Gets the field dictionary.
 HashMap<String,PdfDictionary> getFields()
          Gets all the fields.
 String getFieldValue(String name)
          Gets the field value or null if the field does not exist or has no value defined.
 String getFileSpec()
          Gets the PDF file specification contained in the FDF.
protected  void kidNode(PdfDictionary merged, String name)
           
protected  void readFields()
           
protected  void readPdf()
           
 
Methods inherited from class com.itextpdf.text.pdf.PdfReader
addPdfObject, addViewerPreference, ASCII85Decode, ASCIIHexDecode, close, computeUserPassword, consolidateNamedDestinations, createFakeFontSubsets, decodePredictor, dumpPerc, duplicatePdfDictionary, duplicatePdfObject, eliminateSharedStreams, equalsn, existsName, FlateDecode, FlateDecode, getAcroFields, getAcroForm, getBoxSize, getCatalog, getCertificationLevel, getCropBox, getCryptoMode, getCryptoRef, getDecrypt, getEofPos, getFileLength, getFontName, getInfo, getJavaScript, getJavaScript, getLastXref, getLinks, getMetadata, getNamedDestination, getNamedDestination, getNamedDestinationFromNames, getNamedDestinationFromNames, getNamedDestinationFromStrings, getNormalizedRectangle, getNumberOfPages, getPageContent, getPageContent, getPageN, getPageNRelease, getPageOrigRef, getPageRotation, getPageRotation, getPageSize, getPageSize, getPageSizeWithRotation, getPageSizeWithRotation, getPdfObject, getPdfObject, getPdfObject, getPdfObjectRelease, getPdfObjectRelease, getPdfObjectRelease, getPdfReaderInstance, getPdfVersion, getPermissions, getSafeFile, getSimpleViewerPreferences, getStreamBytes, getStreamBytes, getStreamBytesRaw, getStreamBytesRaw, getSubsetPrefix, getTrailer, getXrefSize, is128Key, isAppendable, isEncrypted, isHybridXref, isMetadataEncrypted, isNewXrefType, isOpenedWithFullPermissions, isRebuilt, isTampered, killIndirect, killXref, LZWDecode, makeRemoteNamedDestinationsLocal, readArray, readDictionary, readDocObj, readDocObjPartial, readObjStm, readOneObjStm, readPages, readPdfPartial, readPRObject, readSingleObject, readXref, readXrefSection, readXRefStream, rebuildXref, releaseLastXrefPartial, releaseLastXrefPartial, releasePage, removeAnnotations, removeFields, removeUnusedNode, removeUnusedObjects, removeUsageRights, resetLastXrefPartial, resetReleasePage, selectPages, selectPages, setAppendable, setPageContent, setPageContent, setTampered, setViewerPreferences, setViewerPreferences, shuffleSubsetNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fields

HashMap<String,PdfDictionary> fields

fileSpec

String fileSpec

encoding

PdfName encoding
Constructor Detail

FdfReader

public FdfReader(String filename)
          throws IOException
Reads an FDF form.

Parameters:
filename - the file name of the form
Throws:
IOException - on error

FdfReader

public FdfReader(byte[] pdfIn)
          throws IOException
Reads an FDF form.

Parameters:
pdfIn - the byte array with the form
Throws:
IOException - on error

FdfReader

public FdfReader(URL url)
          throws IOException
Reads an FDF form.

Parameters:
url - the URL of the document
Throws:
IOException - on error

FdfReader

public FdfReader(InputStream is)
          throws IOException
Reads an FDF form.

Parameters:
is - the InputStream containing the document. The stream is read to the end but is not closed
Throws:
IOException - on error
Method Detail

readPdf

protected void readPdf()
                throws IOException
Overrides:
readPdf in class PdfReader
Throws:
IOException

kidNode

protected void kidNode(PdfDictionary merged,
                       String name)

readFields

protected void readFields()

getFields

public HashMap<String,PdfDictionary> getFields()
Gets all the fields. The map is keyed by the fully qualified field name and the value is a merged PdfDictionary with the field content.

Returns:
all the fields

getField

public PdfDictionary getField(String name)
Gets the field dictionary.

Parameters:
name - the fully qualified field name
Returns:
the field dictionary

getAttachedFile

public byte[] getAttachedFile(String name)
                       throws IOException
Gets a byte[] containing a file that is embedded in the FDF.

Parameters:
name - the fully qualified field name
Returns:
the bytes of the file
Throws:
IOException
Since:
5.0.1

getFieldValue

public String getFieldValue(String name)
Gets the field value or null if the field does not exist or has no value defined.

Parameters:
name - the fully qualified field name
Returns:
the field value or null

getFileSpec

public String getFileSpec()
Gets the PDF file specification contained in the FDF.

Returns:
the PDF file specification contained in the FDF

Hosted by Hostbasket