Class PdfCollectionField

java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.collection.PdfCollectionField

public class PdfCollectionField extends PdfObjectWrapper<PdfDictionary>
  • Field Details

    • TEXT

      public static final int TEXT
      A possible type of collection field.
      See Also:
    • DATE

      public static final int DATE
      A possible type of collection field.
      See Also:
    • NUMBER

      public static final int NUMBER
      A possible type of collection field.
      See Also:
    • FILENAME

      public static final int FILENAME
      A possible type of collection field.
      See Also:
    • DESC

      public static final int DESC
      A possible type of collection field.
      See Also:
    • MODDATE

      public static final int MODDATE
      A possible type of collection field.
      See Also:
    • CREATIONDATE

      public static final int CREATIONDATE
      A possible type of collection field.
      See Also:
    • SIZE

      public static final int SIZE
      A possible type of collection field.
      See Also:
    • subType

      protected int subType
  • Constructor Details

    • PdfCollectionField

      protected PdfCollectionField (PdfDictionary pdfObject)
    • PdfCollectionField

      public PdfCollectionField (String name, int subType)
      Creates a PdfCollectionField.
      Parameters:
      name - the field name
      subType - the field subtype
  • Method Details

    • 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 (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 class PdfObjectWrapper<PdfDictionary>
      Returns:
      true if in the resultant document the object behind the wrapper must be indirect, otherwise false.