Class FdfReader
- java.lang.Object
-
- com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfReader
-
- com.gitlab.pdftk_java.com.lowagie.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.gitlab.pdftk_java.com.lowagie.text.pdf.PdfReader
PdfReader.PageRefs
-
-
Field Summary
Fields Modifier and Type Field Description (package private) PdfName
encoding
(package private) java.util.HashMap
fields
(package private) java.lang.String
fileSpec
-
Fields inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfReader
acroForm, acroFormParsed, catalog, consolidateNamedDestinations, decrypt, encrypted, endobj, endstream, eofPos, freeXref, lastXref, newXrefType, objStmMark, objStmToOffset, ownerPasswordUsed, pageInhCandidates, pageRefs, password, pdfVersion, pValue, rebuilt, remoteToLocalNamedDestinations, rootPages, rValue, sharedStreams, strings, tampered, tokens, trailer, vpints, vpnames, xref
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
decodeString(PdfString vs)
PdfDictionary
getField(java.lang.String name)
Gets the field dictionary.java.lang.String[]
getFieldMultiValue(java.lang.String name)
java.lang.String
getFieldRichValue(java.lang.String name)
java.util.HashMap
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
readFileSpecification(PdfDictionary fdf)
protected void
readPdf()
-
Methods inherited from class com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfReader
addPdfObject, addViewerPreference, ASCII85Decode, ASCIIHexDecode, close, computeUserPassword, consolidateNamedDestinations, createFakeFontSubsets, decodePredictor, dumpPerc, duplicatePdfDictionary, duplicatePdfObject, eliminateSharedStreams, equalsn, existsName, FlateDecode, FlateDecode, getAcroFields, getAcroForm, getBoxSize, getBoxSize, getBoxSize, getCatalog, getCropBox, getCropBox, getCryptoMode, getCryptoRef, getDecrypt, getEofPos, getFileLength, getFontName, getInfo, getJavaScript, getJavaScript, getLastXref, 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, getPRIndirectReference, 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
-
-
-
-
Field Detail
-
fields
java.util.HashMap fields
-
fileSpec
java.lang.String fileSpec
-
encoding
PdfName encoding
-
-
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
-
readPdf
protected void readPdf() throws java.io.IOException
-
kidNode
protected void kidNode(PdfDictionary merged, java.lang.String name)
-
readFileSpecification
protected void readFileSpecification(PdfDictionary fdf)
-
readFields
protected void readFields() throws java.io.IOException
- Throws:
java.io.IOException
-
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 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
-
decodeString
private java.lang.String decodeString(PdfString vs)
-
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
-
getFieldRichValue
public java.lang.String getFieldRichValue(java.lang.String name)
-
getFieldMultiValue
public java.lang.String[] getFieldMultiValue(java.lang.String name)
-
getFileSpec
public java.lang.String getFileSpec()
Gets the PDF file specification contained in the FDF.- Returns:
- the PDF file specification contained in the FDF
-
-