Package com.itextpdf.text.pdf
Class FdfReader
- 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.itextpdf.text.pdf.PdfReader
PdfReader.PageRefs
-
-
Field Summary
Fields Modifier and Type Field Description protected static Counter
COUNTER
(package private) PdfName
encoding
(package private) java.util.HashMap<java.lang.String,PdfDictionary>
fields
(package private) java.lang.String
fileSpec
-
Fields inherited from class com.itextpdf.text.pdf.PdfReader
acroForm, acroFormParsed, catalog, certificate, certificateKey, certificateKeyProvider, consolidateNamedDestinations, debugmode, decrypt, encrypted, endobj, endstream, eofPos, externalDecryptionProcess, freeXref, lastXref, memoryLimitsAwareHandler, newXrefType, objStmMark, objStmToOffset, pageInhCandidates, pageRefs, password, pdfVersion, pValue, rebuilt, remoteToLocalNamedDestinations, rootPages, rValue, sharedStreams, strings, tampered, tokens, trailer, unethicalreading, xref, xrefObj
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getAttachedFile(java.lang.String name)
Gets a byte[] containing a file that is embedded in the FDF.protected Counter
getCounter()
PdfDictionary
getField(java.lang.String name)
Gets the field dictionary.java.util.HashMap<java.lang.String,PdfDictionary>
getFields()
Gets all the fields.java.lang.String
getFieldValue(java.lang.String name)
Gets the field value ornull
if the field does not exist or has no value defined.java.lang.String
getFileSpec()
Gets the PDF file specification contained in the FDF.protected void
kidNode(PdfDictionary merged, java.lang.String name)
protected void
readFields()
protected void
readPdf()
Parses the entire PDF-
Methods inherited from class com.itextpdf.text.pdf.PdfReader
addPdfObject, addViewerPreference, ASCII85Decode, ASCII85Decode, ASCIIHexDecode, ASCIIHexDecode, close, computeUserPassword, consolidateNamedDestinations, createFakeFontSubsets, decodeBytes, decodeBytes, decodePredictor, dumpPerc, duplicatePdfDictionary, duplicatePdfObject, eliminateSharedStreams, equalsn, existsName, FlateDecode, FlateDecode, FlateDecode, getAcroFields, getAcroForm, getBoxSize, getCatalog, getCertificationLevel, getCropBox, getCryptoMode, getCryptoRef, getDecrypt, getEofPos, getFileLength, getFontName, getInfo, getJavaScript, getJavaScript, getLastXref, getLinks, getMemoryLimitsAwareHandler, getMetadata, getNamedDestination, getNamedDestination, getNamedDestinationFromNames, getNamedDestinationFromNames, getNamedDestinationFromStrings, getNormalizedRectangle, getNumberOfPages, getPageContent, getPageContent, getPageContent, getPageN, getPageNRelease, getPageOrigRef, getPageResources, getPageResources, getPageRotation, getPageRotation, getPageSize, getPageSize, getPageSizeWithRotation, getPageSizeWithRotation, getPdfObject, getPdfObject, getPdfObject, getPdfObjectRelease, getPdfObjectRelease, getPdfObjectRelease, getPdfReaderInstance, getPdfVersion, getPermissions, getSafeFile, getSimpleViewerPreferences, getStreamBytes, getStreamBytes, getStreamBytesRaw, getStreamBytesRaw, getSubsetPrefix, getTrailer, getXrefSize, hasUsageRights, is128Key, isAppendable, isEncrypted, isHybridXref, isMetadataEncrypted, isNewXrefType, isOpenedWithFullPermissions, isRebuilt, isTagged, isTampered, killIndirect, killXref, LZWDecode, 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, selectPages, setAppendable, setPageContent, setPageContent, setPageContent, setTampered, setViewerPreferences, setViewerPreferences, shuffleSubsetNames
-
-
-
-
Field Detail
-
fields
java.util.HashMap<java.lang.String,PdfDictionary> fields
-
fileSpec
java.lang.String fileSpec
-
encoding
PdfName encoding
-
COUNTER
protected static Counter COUNTER
-
-
Constructor Detail
-
FdfReader
public FdfReader(java.lang.String filename) throws java.io.IOException
Reads 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.IOException
Reads 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.IOException
Reads 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.IOException
Reads an FDF form.- Parameters:
is
- theInputStream
containing the document. The stream is read to the end but is not closed- Throws:
java.io.IOException
- on error
-
-
Method Detail
-
getCounter
protected Counter getCounter()
- Overrides:
getCounter
in classPdfReader
-
readPdf
protected void readPdf() throws java.io.IOException
Description copied from class:PdfReader
Parses the entire PDF
-
kidNode
protected void kidNode(PdfDictionary merged, java.lang.String name)
-
readFields
protected void readFields()
-
getFields
public java.util.HashMap<java.lang.String,PdfDictionary> getFields()
Gets all the fields. The map is keyed by the fully qualified field name and the value is a mergedPdfDictionary
with 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
-
getAttachedFile
public byte[] getAttachedFile(java.lang.String name) throws java.io.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:
java.io.IOException
- Since:
- 5.0.1
-
getFieldValue
public java.lang.String getFieldValue(java.lang.String name)
Gets the field value ornull
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 java.lang.String getFileSpec()
Gets the PDF file specification contained in the FDF.- Returns:
- the PDF file specification contained in the FDF
-
-