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 void 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
      • setFieldValue

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

        public static void setTextFieldFont​(InternalPdfDocument internalPdfDocument,
                                            String textFieldName,
                                            FontTypes font,
                                            int fontSize)
        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,
                                          Iterable<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)