com.aspose.pdf.facades

Interface IFormEditor

  • All Known Implementing Classes:
    FormEditor, FormEditorWeb


    public interface IFormEditor

    Class for editing forms (adding/deleting field etc)

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      boolean addField(int fieldType, String fieldName, int pageNum, float llx, float lly, float urx, float ury)
      Add field of specified type to the form.
      boolean addField(int fieldType, String fieldName, String initValue, int pageNum, float llx, float lly, float urx, float ury)
      Add field of specified type to the form.
      void addListItem(String fieldName, String itemName)
      Adds new item to the list box.
      void addListItem(String fieldName, String[] exportName)
      Add a new item with Export value to the existing list box field, only for AcroForm combo box field.
      void addSubmitBtn(String fieldName, int page, String label, String url, float llx, float lly, float urx, float ury)
      Add submit button on the form.
      void close()
      Closes object
      void copyInnerField(String fieldName, String newFieldName, int pageNum)
      Copies an existing field to the same position in specified page number.
      void copyInnerField(String fieldName, String newFieldName, int pageNum, float abscissa, float ordinate)
      Copies an existing field to a new position specified by both page number and ordinates.
      void copyOuterField(String srcFileName, String fieldName)
      Copies an existing field from one PDF document to another document with original page number and ordinates.
      void copyOuterField(String srcFileName, String fieldName, int pageNum)
      Copies an existing field from one PDF document to another document with specified page number and original ordinates.
      void copyOuterField(String srcFileName, String fieldName, int pageNum, float abscissa, float ordinate)
      Copies an existing field from one PDF document to another document with specified page number and ordinates.
      void decorateField()
      Changes visual attributes of all fields in the PDF document.
      void decorateField(int fieldType)
      Changes visual attributes of all fields with the specified field type.
      void decorateField(String fieldName)
      Changes visual attributes of the specified field.
      void delListItem(String fieldName, String itemName)
      Delete item from the list field.
      void dispose()
      Closes object
      String getAttachmentName()
      Gets name of attachment when result of operation is stored into HttpResponse objects as attachment.
      int getContentDisposition()
      Gets how content will be stored when result of operation is stored into HttpResponse object.
      String getDestFileName()
      Gets destination file name.
      OutputStream getDestStream()
      Gets destination stream.
      IDocument getDocument()
      Gets the document FormEditor is working on.
      String[][] getExportItems()
      Gets options for combo box with export values.
      FormFieldFacade getFacade()
      Gets visual attributes of the field.
      String[] getItems()
      Returns item array
      double getRadioButtonItemSize()
      Gets or sets size of radio button item size (when new radio button field is added).
      float getRadioGap()
      Get the member to record the gap between two neighboring radio buttons in pixels,default is 50.
      boolean getRadioHoriz()
      Get the flag to indicate whether the radios are arranged horizontally or vertically, default value is true.
      SaveOptions getSaveOptions()
      Gets save options when result is stored as HttpResponse.
      String getSrcFileName()
      Gets name of source file.
      InputStream getSrcStream()
      Gets source stream.
      int getSubmitFlag()
      Get the submit button's submission flags
      boolean moveField(String fieldName, float llx, float lly, float urx, float ury)
      Set new position of field.
      void removeField(String fieldName)
      Remove field from the form.
      void removeFieldAction(String fieldName)
      Remove submit action of the field.
      void renameField(String fieldName, String newFieldName)
      Change name of the field.
      void resetFacade()
      Reset all visual attributes to empty value.
      void resetInnerFacade()
      Reset all visual attributes of inner facade to empty value.
      void save()
      Saves changes into destination file.
      void setAttachmentName(String value)
      Sets name of attachment when result of operation is stored into HttpResponse objects as attachment.
      void setContentDisposition(int value)
      Sets how content will be stored when result of operation is stored into HttpResponse object.
      void setConvertTo(int value)
      Sets PdfFormat PDF file format.
      void setDestFileName(String value)
      Sets destination file name.
      void setDestStream(OutputStream value)
      Sets destination stream.
      void setExportItems(String[][] value)
      Sets options for combo box with export values.
      void setFacade(FormFieldFacade value)
      Sets visual attributes of the field.
      boolean setFieldAlignment(String fieldName, int alignment)
      Set the alignment style of a text field.
      boolean setFieldAlignmentV(String fieldName, int alignment)
      Set the vertical alignment style of a text field.
      boolean setFieldAppearance(String fieldName, int flags)
      Set field flags
      boolean setFieldAttribute(String fieldName, int flag)
      Set attributes of field.
      boolean setFieldCombNumber(String fieldName, int combNumber)
      Sets number of combs for a regular single-line text field (the field is automatically divided into as many equally spaced positions, or combs, as the value of combNumber parameter).
      boolean setFieldLimit(String fieldName, int fieldLimit)
      Sets maximum character count of the text field.
      boolean setFieldScript(String fieldName, String script)
      Set JavaScript for a PushButton field.
      void setItems(String[] value)
      Sets items which will be added to newly created list box or combo box.
      void setRadioButtonItemSize(double value)
      Gets or sets size of radio button item size (when new radio button field is added).
      void setRadioGap(float value)
      Set the member to record the gap between two neighboring radio buttons in pixels,default is 50.
      void setRadioHoriz(boolean value)
      Set the flag to indicate whether the radios are arranged horizontally or vertically, default value is true.
      void setSaveOptions(SaveOptions value)
      Sets save options when result is stored as HttpResponse.
      void setSrcFileName(String value)
      Sets name of source file.
      void setSrcStream(InputStream value)
      Sets source stream.
      void setSubmitFlag(int value)
      Set the submit button's submission flags
      boolean setSubmitFlag(String fieldName, int submitFormFlag)
      Set submit flag of submit button.
      boolean setSubmitUrl(String fieldName, String url)
      Sets URL of the button.
      boolean single2Multiple(String fieldName)
      Change a single-lined text field to a multiple-lined one.
    • Method Detail

      • getSrcFileName

        String getSrcFileName()

        Gets name of source file.

        Returns:
        string value
      • setSrcFileName

        void setSrcFileName(String value)

        Sets name of source file.


         
         
         FormEditor editor = new FormEditor();
         editor.setSrcFileName("InputFile.pdf");
         
        Parameters:
        value - string value
      • getDestFileName

        String getDestFileName()

        Gets destination file name.

        Returns:
        string value
      • setDestFileName

        void setDestFileName(String value)

        Sets destination file name.


         
         
         FormEditor editor = new FormEditor();
         editor.setDestFileName("OutFile.pdf");
         
        Parameters:
        value - String object
      • getSrcStream

        InputStream getSrcStream()

        Gets source stream.

        Returns:
        InputStream object
      • setSrcStream

        void setSrcStream(InputStream value)

        Sets source stream.


         
         
         FormEditor editor = new FormEditor();
         editor.setSrcStream(new FileInputStream("InFile.pdf"));
         
        Parameters:
        value - InputStream object
      • setConvertTo

        void setConvertTo(int value)

        Sets PdfFormat PDF file format. Result file will be saved in specified file format. If this property is not specified then file will be save in default PDF format without conversion.

        Parameters:
        value - PdfFormat element
        See Also:
        PdfFormat
      • getDestStream

        OutputStream getDestStream()

        Gets destination stream.


         
         
         FormEditor editor = new FormEditor();
         editor.setDestStream(new FileInputStream("OutFile.pdf"));
         
        Returns:
        OutputStream object
      • setDestStream

        void setDestStream(OutputStream value)

        Sets destination stream.


         
         
         FormEditor editor = new FormEditor();
         editor.setDestStream(new FileInputStream("OutFile.pdf"));
         
        Parameters:
        value - OutputStream object
      • getItems

        String[] getItems()
        Returns item array
        Returns:
        String[] object
      • setItems

        void setItems(String[] value)

        Sets items which will be added to newly created list box or combo box.


         
         
         formEditor = new com.aspose.pdf.facadesFormEditor("input.pdf", "output.pdf");
         formEditor.setItems(new String[]
         { "AAA", "BBB", "CCC" });
         formEditor.addField(FieldType.ListBox, "AddedListBoxField", "BBB", 1, 10, 30, 110, 130);
         formEditor.save();
         
        Parameters:
        value - String[] object
      • getExportItems

        String[][] getExportItems()

        Gets options for combo box with export values.

        Returns:
        String[][] object
      • setExportItems

        void setExportItems(String[][] value)

        Sets options for combo box with export values.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "PdfForm_Updated.pdf"));
         formEditor.setExportItems ( new String[][] 
         { 
             new String[] { "1", "Firs" }, 
             new String[] { "2", "Second" }, 
             new String[] { "3", "Third" } 
         });
         formEditor.addField(FieldType.ListBox, "AddedListBoxField", "Second", 1, 10, 30, 110, 130);
         formEditor.save();
         
        Parameters:
        value - String[][] object
      • getFacade

        FormFieldFacade getFacade()

        Gets visual attributes of the field.

        Returns:
        FormFieldFacade object
      • setFacade

        void setFacade(FormFieldFacade value)

        Sets visual attributes of the field.


         
         
         FormEditor fe = new FormEditor("PdfForm.pdf", "PdfForm_DecorateField_text.pdf");
         fe.setFacade(new FormFieldFacade());
         fe.getFacade().setBackgroundColor(Color.red);
         fe.getFacade().setTextColor(Color.blue);
         fe.getFacade().setBorderColor(Color.green);
         fe.getFacade().setAlignment(FormFieldFacade.AlignCenter);
         fe.setDecorateField("textField");
         fe.save();
         
        Parameters:
        value - FormFieldFacade object
      • getRadioGap

        float getRadioGap()

        Get the member to record the gap between two neighboring radio buttons in pixels,default is 50.

        Returns:
        float value
      • setRadioGap

        void setRadioGap(float value)

        Set the member to record the gap between two neighboring radio buttons in pixels,default is 50.


         
         
         formEditor = new com.aspose.pdf.facades.FormEditor("PdfForm.pdf", "FormEditor_AddField_RadioButton.pdf");
         formEditor.setRadioGap(4);
         formEditor.setRadioHoriz(false);
         formEditor.setItems(new String[]
         { "First", "Second", "Third" });
         formEditor.addField(FieldType.Radio, "AddedRadioButtonField", "Second", 1, 10, 30, 110, 130);
         formEditor.save();
         
        Parameters:
        value - float value
      • getRadioHoriz

        boolean getRadioHoriz()

        Get the flag to indicate whether the radios are arranged horizontally or vertically, default value is true.

        Returns:
        boolean value
      • setRadioHoriz

        void setRadioHoriz(boolean value)

        Set the flag to indicate whether the radios are arranged horizontally or vertically, default value is true.


         
         
         formEditor = new com.aspose.pdf.facades.FormEditor("PdfForm.pdf", "FormEditor_AddField_RadioButton.pdf");
         formEditor.setRadioGap(4);
         formEditor.setRadioHoriz(false);
         formEditor.setItems(new String[]
         { "First", "Second", "Third" });
         formEditor.addField(FieldType.Radio, "AddedRadioButtonField", "Second", 1, 10, 30, 110, 130);
         formEditor.save();
         
        Parameters:
        value - boolean value
      • getRadioButtonItemSize

        double getRadioButtonItemSize()
         Gets or sets size of radio button item size (when new radio button field is added).
         
         
         FormEditor formEditor = new com.aspose.pdf.facades.FormEditor("PdfForm.pdf", "FormEditor_AddField_RadioButton.pdf");
         formEditor.setRadioGap(4);
         formEditor.setRadioHoriz(false);
         formEditor.setRadioButtonItemSize(20);
         formEditor.setItems(new String[]
         { "First", "Second", "Third" });
         formEditor.addField(com.aspose.pdf.facades.FieldType.Radio, "AddedRadioButtonField", "Second", 1, 10, 30, 110, 130);
         formEditor.save();
         
        Returns:
        boolean value
      • setRadioButtonItemSize

        void setRadioButtonItemSize(double value)
         Gets or sets size of radio button item size (when new radio button field is added).
         
         
         FormEditor formEditor = new com.aspose.pdf.facades.FormEditor("PdfForm.pdf", "FormEditor_AddField_RadioButton.pdf");
         formEditor.setRadioGap(4);
         formEditor.setRadioHoriz(false);
         formEditor.setRadioButtonItemSize(20);
         formEditor.setItems(new String[]
         { "First", "Second", "Third" });
         formEditor.addField(com.aspose.pdf.facades.FieldType.Radio, "AddedRadioButtonField", "Second", 1, 10, 30, 110, 130);
         formEditor.save();
         
         
        Parameters:
        value - double value
      • getSubmitFlag

        int getSubmitFlag()

        Get the submit button's submission flags

        Returns:
        SubmitFormFlag element
        See Also:
        SubmitFormFlag
      • setSubmitFlag

        void setSubmitFlag(int value)

        Set the submit button's submission flags

        Parameters:
        value - SubmitFormFlag element
        See Also:
        SubmitFormFlag
      • save

        void save()

        Saves changes into destination file.

      • setFieldAttribute

        boolean setFieldAttribute(String fieldName,
                                  int flag)

        Set attributes of field.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "PdfForm_SetFieldAttribute.pdf");
         formEditor.setFieldAttribute("listboxField", PropertyFlag.ReadOnly);
         formEditor.setFieldAttribute("textField", PropertyFlag.NoExport);
         
        Parameters:
        fieldName - Name of field which attributes should be set.
        flag - Flag (NoExport/ReadOnly/Required)
        Returns:
        true if attribute was set successfully.
      • setFieldAppearance

        boolean setFieldAppearance(String fieldName,
                                   int flags)

        Set field flags


         
         
         FormEditor formEditor = new FormEditor("PdfForm1.pdf", "FormEditor_SetFieldAppearance.pdf");
         formEditor.setFieldAppearance("Name", AnnotationFlags.Hidden);
         formEditor.setFieldAppearance("Phone", AnnotationFlags.NoView | AnnotationFlags.Print);
         
        Parameters:
        fieldName - Name of field whose flags should be updated.
        flags - Flag of the field.
        Returns:
        true if flags were updated successfully.
      • setSubmitFlag

        boolean setSubmitFlag(String fieldName,
                              int submitFormFlag)

        Set submit flag of submit button.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_SetSubmitFlag.pdf");
         formEditor.setSubmitFlag("btnSubmit", SubmitFormFlag.Fdf);
         
        Parameters:
        fieldName - Name of submit button.
        submitFormFlag - Submit flag.
        Returns:
        boolean value
      • setSubmitUrl

        boolean setSubmitUrl(String fieldName,
                             String url)

        Sets URL of the button.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_SetSubmitUrl.pdf");
         formEditor.setSubmitUrl("btnSubmit", "www.mysite.com");
         
        Parameters:
        fieldName - Submit button name.
        url - Fully qualified URL.
        Returns:
        boolean value
      • setFieldLimit

        boolean setFieldLimit(String fieldName,
                              int fieldLimit)

        Sets maximum character count of the text field.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_SetFieldLimit.pdf");
         formEditor.setFieldLimit("textField", 15);
         
        Parameters:
        fieldName - Name of the text field.
        fieldLimit - New value of limit for the field.
        Returns:
        true if field limit was successfully set.
      • setFieldCombNumber

        boolean setFieldCombNumber(String fieldName,
                                   int combNumber)

        Sets number of combs for a regular single-line text field (the field is automatically divided into as many equally spaced positions, or combs, as the value of combNumber parameter).


         
         
         FormEditor formEditor = new FormEditor("PdfWithAcroForm.pdf", "FormEditor_SetFieldComb.pdf"));
         formEditor.setFieldCombNumber("textCombField", 5);
         
        Parameters:
        fieldName - The qualified field name.
        combNumber - The number of combs to divide the field into.
        Returns:
        If success, return true;else false.
      • moveField

        boolean moveField(String fieldName,
                          float llx,
                          float lly,
                          float urx,
                          float ury)

        Set new position of field.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_MoveField.pdf");
         formEditor.moveField("textField", 20.5f, 20.3f, 120.6f, 40.8f);
         
        Parameters:
        fieldName - Name of field which must be moved.
        llx - Abscissa of the lower-left corner of the field.
        lly - Ordinate of the lower-left corner of the field.
        urx - Abscissa of the upper-right corner of the field.
        ury - Ordinate of the upper-right corner of the field.
        Returns:
        true if field position was changed successfully.
      • addField

        boolean addField(int fieldType,
                         String fieldName,
                         int pageNum,
                         float llx,
                         float lly,
                         float urx,
                         float ury)

        Add field of specified type to the form.


         
         
         FormEditor formEditor = new com.aspose.pdf.facades.FormEditor("PdfForm.pdf", "FormEditor_AddField_Text.pdf");
         formEditor.addField(FieldType.Text, "AddedTextField", 1, 10, 30, 110, 46);
         formEditor.save();
         
        Parameters:
        fieldType - Type of the field which must be added.
        fieldName - Name of the field which must be added.
        pageNum - Page number where new field must be placed.
        llx - Abscissa of the lower-left corner of the field.
        lly - Ordinate of the lower-left corner of the field.
        urx - Abscissa of the upper-right corner of the field.
        ury - Ordinate of the upper-right corner of the field.
        Returns:
        true if field was successfully added.
      • addField

        boolean addField(int fieldType,
                         String fieldName,
                         String initValue,
                         int pageNum,
                         float llx,
                         float lly,
                         float urx,
                         float ury)

        Add field of specified type to the form.

        Parameters:
        fieldType - Type of the field which must be added.
        fieldName - Name of the field which must be added.
        initValue - Initial value of the field.
        pageNum - Page number where new field must be placed.
        llx - Abscissa of the lower-left corner of the field.
        lly - Ordinate of the lower-left corner of the field.
        urx - Abscissa of the upper-right corner of the field.
        ury - Ordinate of the upper-right corner of the field.
        Returns:
        true if field was successfully added.
      • removeField

        void removeField(String fieldName)

        Remove field from the form.


         
         
         FormEditr formEditor = new FormEditor("PdfForm.pdf", "FormEditor_RemoveField.pdf");
         formEditor.removeField("listboxField");
         formEditor.removeField("textField");
         
        Parameters:
        fieldName - Name of the field which must be removed.
      • resetFacade

        void resetFacade()

        Reset all visual attributes to empty value.

      • resetInnerFacade

        void resetInnerFacade()

        Reset all visual attributes of inner facade to empty value.

      • copyInnerField

        void copyInnerField(String fieldName,
                            String newFieldName,
                            int pageNum)

        Copies an existing field to the same position in specified page number. A new document will be produced, which contains everything the source document has except for the newly copied field.

        Parameters:
        fieldName - String value
        newFieldName - String value
        pageNum - int value
      • copyInnerField

        void copyInnerField(String fieldName,
                            String newFieldName,
                            int pageNum,
                            float abscissa,
                            float ordinate)

        Copies an existing field to a new position specified by both page number and ordinates. A new document will be produced, which contains everything the source document has except for the newly copied field.

        Parameters:
        fieldName - String value
        newFieldName - String value
        pageNum - int value
        abscissa - float value
        ordinate - float value
      • copyOuterField

        void copyOuterField(String srcFileName,
                            String fieldName)

        Copies an existing field from one PDF document to another document with original page number and ordinates. Notice: Only for AcroForm fields (excluding radio box).

        Parameters:
        srcFileName - String value
        fieldName - String value
      • copyOuterField

        void copyOuterField(String srcFileName,
                            String fieldName,
                            int pageNum)

        Copies an existing field from one PDF document to another document with specified page number and original ordinates. Notice: Only for AcroForm fields (excluding radio box).

        Parameters:
        srcFileName - String value
        fieldName - String value
        pageNum - int value
      • copyOuterField

        void copyOuterField(String srcFileName,
                            String fieldName,
                            int pageNum,
                            float abscissa,
                            float ordinate)

        Copies an existing field from one PDF document to another document with specified page number and ordinates. Notice: Only for AcroForm fields (excluding radio box).

        Parameters:
        srcFileName - String value
        fieldName - String value
        pageNum - int value
        abscissa - float value
        ordinate - float value
      • decorateField

        void decorateField(String fieldName)

        Changes visual attributes of the specified field.


         
         
         FormEditor fe = new FormEditor("PdfWithAcroForm.pdf", "FormEditor_DecorateField_text.pdf");
         fe.Facade = new FormFieldFacade();
         fe.Facade.setBackgroundColor(Color.Red);
         fe.Facade.setTextColor(Color.Blue);
         fe.Facade.setBorderColor(Color.Green);
         fe.Facade.setAlignment(FormFieldFacade.AlignCenter);
         fe.decorateField("textField");
         
        Parameters:
        fieldName - The fully qualified field name.
      • decorateField

        void decorateField(int fieldType)

        Changes visual attributes of all fields with the specified field type.


         
         
         FormEditor fe = new FormEditor("PdfForm.pdf", "FormEditor_DecorateField.pdf");
         fe.setFacade(new FormFieldFacade());
         fe.getFacade().setBackgroundColor(Color.red);
         fe.getFacade().setTextColor(Color.blue);
         fe.getFacade().setBorderColor(Color.green);
         fe.getFacade().setAlignment(FormFieldFacade.AlignRight);
         // decorate all text fields.
         fe.decorateField(FieldType.Text);
         
        Parameters:
        fieldType - Type of fields which will be decorated.
        See Also:
        FieldType
      • decorateField

        void decorateField()

        Changes visual attributes of all fields in the PDF document.


         
         
         FormEditor fe = new FormEditor("PdfForm.pdf", "FormEditor_DecorateField.pdf");
         fe.setFacade(new FormFieldFacade());
         fe.getFacade().setBackgroundColor(Color.red);
         fe.getFacade().setTextColor(Color.blue);
         fe.getFacade().setBorderColor(Color.Green);
         fe.getFacade().setAlignment(FormFieldFacade.AlignRight);
         // decorate all fields.
         fe.decorateField();
         
      • renameField

        void renameField(String fieldName,
                         String newFieldName)

        Change name of the field.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "PdfForm_updated.pdf");
         formEditor.renameField("textField", "textField_Renamed");
         
        Parameters:
        fieldName - Old name of the field.
        newFieldName - New name of the field.
      • removeFieldAction

        void removeFieldAction(String fieldName)

        Remove submit action of the field.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_RemoveFieldAction.pdf");
         formEditor.removeFieldAction("btnSubmit");
         
        Parameters:
        fieldName - Name of the field.
      • addSubmitBtn

        void addSubmitBtn(String fieldName,
                          int page,
                          String label,
                          String url,
                          float llx,
                          float lly,
                          float urx,
                          float ury)

        Add submit button on the form.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_AddSubmitBtn.pdf");
         formEditor.addSubmitBtn("submit", 1, "Submit", "www.check.com", 10, 200, 70, 270);
         
        Parameters:
        fieldName - Name of new button.
        page - Page where button will be placed.
        label - Button caption.
        url - URL of the submit button.
        llx - Abscissa of the lower-left corner.
        lly - Ordinate of the lower-left corner.
        urx - Abscissa of the upper-right corner.
        ury - Ordinate of the upper-right corner.
      • addListItem

        void addListItem(String fieldName,
                         String itemName)

        Adds new item to the list box.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", PdfForm_out.pdf");
         formEditor.addListItem("listBoxField", "Item 4 (New Item)");
         
        Parameters:
        fieldName - Name of the field of which new item will be added.
        itemName - Name if new item.
      • addListItem

        void addListItem(String fieldName,
                         String[] exportName)

        Add a new item with Export value to the existing list box field, only for AcroForm combo box field.


         
         
         FormEditor fe = new FormEditor("PdfForm.pdf", "FormEditor_AddListItem2.pdf");
         fe.addListItem("listboxField", new String[]
         { "4", "Item4(Added)" });
         
        Parameters:
        fieldName - Name of field to which items will be added.
        exportName - A String array denoting a new list item with Export Value, i.e. (Item Label, Export Value).
      • delListItem

        void delListItem(String fieldName,
                         String itemName)

        Delete item from the list field.


         
         
         formEditor = new com.aspose.pdf.facades.FormEditor("PdfForm.pdf", "FormEditor_DelListItem.pdf");
         formEditor.delListItem("listboxField", "item2");
         
        Parameters:
        fieldName - Name of the field.
        itemName - Name of the item which must be deleted.
      • setFieldScript

        boolean setFieldScript(String fieldName,
                               String script)

        Set JavaScript for a PushButton field. If old JavaScript existed, it will be replaced by the new one.

        Parameters:
        fieldName - The fully qualified field name.
        script - The Java script to be added/placed into a push button field.
        Returns:
        boolean value: If success, return true; else false.
      • single2Multiple

        boolean single2Multiple(String fieldName)

        Change a single-lined text field to a multiple-lined one.


         
         
         FormEditor formEditor = new FormEditor("PdfForm.pdf", "PdfForm_updated.pdf");
         formEditor.single2Multiple("textField");
         
        Parameters:
        fieldName - The qualified field name.
        Returns:
        If success, return true;else false.
      • setFieldAlignment

        boolean setFieldAlignment(String fieldName,
                                  int alignment)

        Set the alignment style of a text field.


         
         
          FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_updated.pdf"));
          formEditor.setFieldAlignment(fieldName, FormFieldFacade.AlignCenter);
         
        Parameters:
        fieldName - The qualified field name.
        alignment - The alignment style definition, including FormFieldFacade.AlignLeft, FormFieldFacade.AlignCenter and FormFieldFacade.AlignRight.
        Returns:
        boolean value
      • setFieldAlignmentV

        boolean setFieldAlignmentV(String fieldName,
                                   int alignment)

        Set the vertical alignment style of a text field.


         
         
         FormEditor fe = new FormEditor("PdfStaticForm.pdf", "VerticalAlign.pdf");
         fe.setFieldAlignmentV("form1[0].TextField[0]", FormFieldFacade.AlignBottom);
         
        Parameters:
        fieldName - The qualified field name.
        alignment - The alignment style definition, including FormFieldFacade.AlignTop, FormFieldFacade.AlignMiddle and FormFieldFacade.AlignRight.
        Returns:
        If success, return true;else false.
      • getDocument

        IDocument getDocument()

        Gets the document FormEditor is working on.

        Returns:
        IDocument object
      • getContentDisposition

        int getContentDisposition()

        Gets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.

        Returns:
        ContentDisposition element
        See Also:
        ContentDisposition
      • setContentDisposition

        void setContentDisposition(int value)

        Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.

        Parameters:
        value - ContentDisposition element
        See Also:
        ContentDisposition
      • getSaveOptions

        SaveOptions getSaveOptions()

        Gets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.

        Returns:
        SaveOptions object
      • setSaveOptions

        void setSaveOptions(SaveOptions value)

        Sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.

        Parameters:
        value - SaveOptions object
      • getAttachmentName

        String getAttachmentName()

        Gets name of attachment when result of operation is stored into HttpResponse objects as attachment.

        Returns:
        String object
      • setAttachmentName

        void setAttachmentName(String value)

        Sets name of attachment when result of operation is stored into HttpResponse objects as attachment.

        Parameters:
        value - String object
      • close

        void close()
        Closes object
      • dispose

        void dispose()
        Closes object