- java.lang.Object
-
- com.itextpdf.text.pdf.PdfReader
-
- 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 (psoares@consiste.pt)
-
-
Field Summary
-
Fields inherited from class com.itextpdf.text.pdf.PdfReader
acroForm, acroFormParsed, catalog, certificate, certificateKey, certificateKeyProvider, consolidateNamedDestinations, decrypt, encrypted, eofPos, freeXref, lastXref, newXrefType, objStmMark, objStmToOffset, pageRefs, password, pdfVersion, pValue, rebuilt, remoteToLocalNamedDestinations, rValue, sharedStreams, strings, tampered, tokens, trailer, xref
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfDictionarygetField(java.lang.String name)Gets the field dictionary.java.util.HashMapgetFields()Gets all the fields.java.lang.StringgetFieldValue(java.lang.String name)Gets the field value ornullif the field does not exist or has no value defined.java.lang.StringgetFileSpec()Gets the PDF file specification contained in the FDF.protected voidkidNode(PdfDictionary merged, java.lang.String name)protected voidreadFields()protected voidreadPdf()-
Methods inherited from class com.itextpdf.text.pdf.PdfReader
addPdfObject, addViewerPreference, ASCII85Decode, ASCIIHexDecode, close, computeUserPassword, consolidateNamedDestinations, createFakeFontSubsets, decodePredictor, dumpPerc, duplicatePdfDictionary, duplicatePdfObject, eliminateSharedStreams, FlateDecode, FlateDecode, getAcroFields, getAcroForm, getBoxSize, getCatalog, getCertificationLevel, getCropBox, getCryptoMode, getEofPos, getFileLength, getInfo, getJavaScript, getJavaScript, getLastXref, getLinks, getMetadata, getNamedDestination, getNamedDestination, getNamedDestinationFromNames, getNamedDestinationFromNames, getNamedDestinationFromStrings, getNormalizedRectangle, getNumberOfPages, getPageContent, getPageContent, getPageN, getPageNRelease, getPageOrigRef, getPageRotation, getPageSize, getPageSize, getPageSizeWithRotation, getPageSizeWithRotation, getPdfObject, getPdfObject, getPdfObject, getPdfObjectRelease, getPdfObjectRelease, getPdfObjectRelease, getPdfReaderInstance, getPdfVersion, getPermissions, getSafeFile, getSimpleViewerPreferences, getStreamBytes, getStreamBytes, getStreamBytesRaw, getStreamBytesRaw, 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, shuffleSubsetNames
-
-
-
-
Constructor Detail
-
FdfReader
public FdfReader(java.lang.String filename) throws java.io.IOExceptionReads an FDF form.- Parameters:
filename- the file name of the form- Throws:
java.io.IOException- on error
-
FdfReader
public FdfReader(byte[] pdfIn) throws java.io.IOExceptionReads an FDF form.- Parameters:
pdfIn- the byte array with the form- Throws:
java.io.IOException- on error
-
FdfReader
public FdfReader(java.net.URL url) throws java.io.IOExceptionReads an FDF form.- Parameters:
url- the URL of the document- Throws:
java.io.IOException- on error
-
FdfReader
public FdfReader(java.io.InputStream is) throws java.io.IOExceptionReads an FDF form.- Parameters:
is- theInputStreamcontaining the document. The stream is read to the end but is not closed- Throws:
java.io.IOException- on error
-
-
Method Detail
-
readPdf
protected void readPdf() throws java.io.IOException
-
kidNode
protected void kidNode(PdfDictionary merged, java.lang.String name)
-
readFields
protected void readFields()
-
getFields
public java.util.HashMap getFields()
Gets all the fields. The map is keyed by the fully qualified field name and the value is a mergedPdfDictionarywith the field content.- Returns:
- all the fields
-
getField
public PdfDictionary getField(java.lang.String name)
Gets the field dictionary.- Parameters:
name- the fully qualified field name- Returns:
- the field dictionary
-
getFieldValue
public java.lang.String getFieldValue(java.lang.String name)
Gets the field value ornullif 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 java.lang.String getFileSpec()
Gets the PDF file specification contained in the FDF.- Returns:
- the PDF file specification contained in the FDF
-
-