Class Form_Api


  • public final class Form_Api
    extends Object
    The type Form api.
    • Constructor Detail

      • Form_Api

        public Form_Api()
    • Method Detail

      • getFields

        public static List<FormField> getFields​(InternalPdfDocument internalPdfDocument)
        Get a collection of the user-editable form fields within a PDF document
        Parameters:
        internalPdfDocument - the internal pdf document
        Returns:
        the fields
      • renameField

        public static String renameField​(InternalPdfDocument internalPdfDocument,
                                         String currentFieldName,
                                         String newFieldName)
        Rename a FormField
        Parameters:
        internalPdfDocument - the internal pdf document
        currentFieldName - current fully qualified field name
        newFieldName - new partial field name Please use a fully qualified field name for CurrentFieldName, and a partial field name for NewFieldName
        Returns:
        newFieldName;
      • setFieldValue

        public static void setFieldValue​(InternalPdfDocument internalPdfDocument,
                                         int annotationIndex,
                                         String value)
        Set the value of a FormField
        Parameters:
        internalPdfDocument - the internal pdf document
        annotationIndex - fully qualified field annotationIndex
        value - new value
      • setTextFieldFont

        public static void setTextFieldFont​(InternalPdfDocument internalPdfDocument,
                                            String textFieldName,
                                            FontTypes font,
                                            int fontSize)
        Deprecated.
        This method is deprecated and no longer has any effect. Sets text field font.
        Parameters:
        internalPdfDocument - the internal pdf document
        textFieldName - the text field name
        font - the font
        fontSize - the font size
      • flattenPdfFrom

        public static void flattenPdfFrom​(InternalPdfDocument internalPdfDocument)
        Flattens a document (make the fields non-editable).
        Parameters:
        internalPdfDocument - the internal pdf document
      • flattenPdfFrom

        public static void flattenPdfFrom​(InternalPdfDocument internalPdfDocument,
                                          List<Integer> pageIndexes)
        Flattens a document (make the fields non-editable).
        Parameters:
        internalPdfDocument - the internal pdf document
        pageIndexes - page indexes to flatten (defaults to all pages)
      • setFormFieldIsReadOnly

        public static void setFormFieldIsReadOnly​(InternalPdfDocument internalPdfDocument,
                                                  int annotationIndex,
                                                  boolean isReadOnly)
        Sets text field font.
        Parameters:
        internalPdfDocument - the internal pdf document
        annotationIndex - the form field annotation Index
        isReadOnly - the read only value