Class PdfCollectionField
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.collection.PdfCollectionField
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A possible type of collection field.static final int
A possible type of collection field.static final int
A possible type of collection field.static final int
A possible type of collection field.static final int
A possible type of collection field.static final int
A possible type of collection field.static final int
A possible type of collection field.protected int
static final int
A possible type of collection field. -
Constructor Summary
ModifierConstructorDescriptionprotected
PdfCollectionField
(PdfDictionary pdfObject) PdfCollectionField
(String name, int subType) Creates a PdfCollectionField. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the state of the editable of the field.getOrder()
Retrieves the order of the field name.Converts string to appropriate pdf value.Retrieves the initial visibility of the field.protected boolean
Defines if the object behind this wrapper must be an indirect object in the resultant document.setEditable
(boolean editable) Indication if the field value should be editable in the viewer.setOrder
(int order) The relative order of the field name.setVisibility
(boolean visible) Sets the initial visibility of the field.Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Field Details
-
TEXT
public static final int TEXTA possible type of collection field.- See Also:
-
DATE
public static final int DATEA possible type of collection field.- See Also:
-
NUMBER
public static final int NUMBERA possible type of collection field.- See Also:
-
FILENAME
public static final int FILENAMEA possible type of collection field.- See Also:
-
DESC
public static final int DESCA possible type of collection field.- See Also:
-
MODDATE
public static final int MODDATEA possible type of collection field.- See Also:
-
CREATIONDATE
public static final int CREATIONDATEA possible type of collection field.- See Also:
-
SIZE
public static final int SIZEA possible type of collection field.- See Also:
-
subType
protected int subType
-
-
Constructor Details
-
PdfCollectionField
-
PdfCollectionField
Creates a PdfCollectionField.- Parameters:
-
name
- the field name -
subType
- the field subtype
-
-
Method Details
-
setOrder
The relative order of the field name. Fields are sorted in ascending order.- Parameters:
-
order
- a number indicating the order of the field - Returns:
- this instance to support fluent interface
-
getOrder
Retrieves the order of the field name.- Returns:
-
the
PDF number
showing the order of the field name
-
setVisibility
Sets the initial visibility of the field.- Parameters:
-
visible
- is a state of visibility - Returns:
- this instance to support fluent interface
-
getVisibility
Retrieves the initial visibility of the field.- Returns:
-
the initial visibility of the field as
PDF boolean
value
-
setEditable
Indication if the field value should be editable in the viewer.- Parameters:
-
editable
- is a state of editable - Returns:
- this instance to support fluent interface
-
getEditable
Retrieves the state of the editable of the field.- Returns:
-
true if filed is editable and false otherwise. Returned value is presented as
pdf boolean
.
-
getValue
Converts string to appropriate pdf value.- Parameters:
-
value
- is a plain string representation of the value - Returns:
-
resulting
PDF object
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Description copied from class:PdfObjectWrapper
Defines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
-
isWrappedObjectMustBeIndirect
in classPdfObjectWrapper<PdfDictionary>
- Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-