Class PdfCollectionField
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.collection.PdfCollectionField
-
public class PdfCollectionField extends PdfObjectWrapper<PdfDictionary>
-
-
Field Summary
Fields Modifier and Type Field Description static int
CREATIONDATE
A possible type of collection field.static int
DATE
A possible type of collection field.static int
DESC
A possible type of collection field.static int
FILENAME
A possible type of collection field.static int
MODDATE
A possible type of collection field.static int
NUMBER
A possible type of collection field.static int
SIZE
A possible type of collection field.protected int
subType
static int
TEXT
A possible type of collection field.
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdfCollectionField(PdfDictionary pdfObject)
PdfCollectionField(java.lang.String name, int subType)
Creates a PdfCollectionField.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfBoolean
getEditable()
Retrieves the state of the editable of the field.PdfNumber
getOrder()
Retrieves the order of the field name.PdfObject
getValue(java.lang.String value)
Converts string to appropriate pdf value.PdfBoolean
getVisibility()
Retrieves the initial visibility of the field.protected boolean
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.PdfCollectionField
setEditable(boolean editable)
Indication if the field value should be editable in the viewer.PdfCollectionField
setOrder(int order)
The relative order of the field name.PdfCollectionField
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 Detail
-
TEXT
public static final int TEXT
A possible type of collection field.- See Also:
- Constant Field Values
-
DATE
public static final int DATE
A possible type of collection field.- See Also:
- Constant Field Values
-
NUMBER
public static final int NUMBER
A possible type of collection field.- See Also:
- Constant Field Values
-
FILENAME
public static final int FILENAME
A possible type of collection field.- See Also:
- Constant Field Values
-
DESC
public static final int DESC
A possible type of collection field.- See Also:
- Constant Field Values
-
MODDATE
public static final int MODDATE
A possible type of collection field.- See Also:
- Constant Field Values
-
CREATIONDATE
public static final int CREATIONDATE
A possible type of collection field.- See Also:
- Constant Field Values
-
SIZE
public static final int SIZE
A possible type of collection field.- See Also:
- Constant Field Values
-
subType
protected int subType
-
-
Constructor Detail
-
PdfCollectionField
protected PdfCollectionField(PdfDictionary pdfObject)
-
PdfCollectionField
public PdfCollectionField(java.lang.String name, int subType)
Creates a PdfCollectionField.- Parameters:
name
- the field namesubType
- the field subtype
-
-
Method Detail
-
setOrder
public PdfCollectionField setOrder(int order)
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
public PdfNumber getOrder()
Retrieves the order of the field name.- Returns:
- the
PDF number
showing the order of the field name
-
setVisibility
public PdfCollectionField setVisibility(boolean visible)
Sets the initial visibility of the field.- Parameters:
visible
- is a state of visibility- Returns:
- this instance to support fluent interface
-
getVisibility
public PdfBoolean getVisibility()
Retrieves the initial visibility of the field.- Returns:
- the initial visibility of the field as
PDF boolean
value
-
setEditable
public PdfCollectionField setEditable(boolean editable)
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
public PdfBoolean 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
public PdfObject getValue(java.lang.String value)
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.
-
-