FormEditor Class
Class for editing forms (ading/deleting field etc)
Inheritance Hierarchy

Namespace: Aspose.Pdf.Facades
Assembly: Aspose.PDF (in Aspose.PDF.dll) Version: 20.3
Syntax
public sealed class FormEditor : SaveableFacade

The FormEditor type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleFormEditor
Constructor for FormEditor.
Public methodFormEditor(Document)
Initializes new FormEditor object on base of the document.
Public methodCode exampleFormEditor(Stream, Stream) Obsolete.
Constructor for FormEditor.
Public methodFormEditor(Stream, HttpResponse) Obsolete.
Creates FormEditor which will save result into HttpResponse object.
Public methodCode exampleFormEditor(String, String) Obsolete.
Constructor for FormEditor
Public methodFormEditor(String, HttpResponse) Obsolete.
Creates FormEditor which will save result into HttpResponse object.
Public methodFormEditor(Document, Stream) Obsolete.
Initializes new FormEditor object on base of the document.
Public methodFormEditor(Document, String) Obsolete.
Initializes new FormEditor object on base of the document.
Properties
  NameDescription
Public propertyAttachmentName
Gets or sets name of attachment when result of operation is stored into HttpResponse objects as attachment.
Public propertyContentDisposition
Gets or sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.
Public propertyConvertTo
Sets 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.
Public propertyCode exampleDestFileName Obsolete.
Gets or sets destination file name.
Public propertyCode exampleDestStream Obsolete.
Gets or sets destination stream.
Public propertyDocument
Gets the document facade is working on.
(Inherited from Facade.)
Public propertyCode exampleExportItems
Sets options for combo box with export values.
Public propertyCode exampleFacade
Sets visual attributes of the field.
Public propertyCode exampleItems
Sets items which will be added t onewly created list box or combo box.
Examples
C#
formEditor = new Aspose.Pdf.Facades.FormEditor("input.pdf", "output.pdf");
formEditor.Items = new string[] { "AAA", "BBB", "CCC" };
formEditor.AddField(FieldType.ListBox, "AddedListBoxField", "BBB", 1, 10, 30, 110, 130);
formEditor.Save();
Public propertyRadioButtonItemSize
Gets or sets size of radio button item size (when new radio button field is added).
C#
formEditor = new Aspose.Pdf.Facades.FormEditor("PdfForm.pdf", "FormEditor_AddField_RadioButton.pdf");
formEditor.RadioGap = 4;
formEditor.RadioHoriz = false;
formEditor.RadioButtonItemSize = 20;
formEditor.Items = new string[] { "First", "Second", "Third" };
formEditor.AddField(FieldType.Radio, "AddedRadioButtonField", "Second", 1, 10, 30, 110, 130);
formEditor.Save();
Public propertyCode exampleRadioGap
The member to record the gap between two neighboring radio buttons in pixels,default is 50.
Public propertyCode exampleRadioHoriz
The flag to indicate whether the radios are arranged horizontally or vertically, default value is true.
Public propertyResponse
Gets or sets Response object where result of operation will be stored.
Public propertySaveOptions
Gets or sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.
Public propertyCode exampleSrcFileName Obsolete.
Gets or sets name of source file.
Public propertyCode exampleSrcStream Obsolete.
Gets or sets source stream.
Public propertySubmitFlag
Set the submit button's submission flags
Methods
  NameDescription
Public methodCode exampleAddField(FieldType, String, Int32, Single, Single, Single, Single)
Add field of specified type to the form.
Public methodCode exampleAddField(FieldType, String, String, Int32, Single, Single, Single, Single)
Add field of specified type to the form.
Public methodAddFieldScript
Add JavaScript for a PushButton field. If old event exists, new event is added after it.
Public methodCode exampleAddListItem(String, String)
Adds new item to the list box.
Public methodCode exampleAddListItem(String, String)
Add a new item with Export value to the existing list box field, only for AcroForm combo box field.
Public methodCode exampleAddSubmitBtn
Add submit button on the form.
Public methodBindPdf(Stream)
Initializes the facade.
(Inherited from Facade.)
Public methodBindPdf(String)
Initializes the facade.
(Inherited from Facade.)
Public methodBindPdf(Document)
Initializes the facade.
(Inherited from Facade.)
Public methodClose
Closes the facade.
(Overrides FacadeClose.)
Public methodCode exampleCopyInnerField(String, String, Int32)
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.
Public methodCode exampleCopyInnerField(String, String, Int32, Single, Single)
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.
Public methodCode exampleCopyOuterField(String, String)
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).
Public methodCode exampleCopyOuterField(String, String, Int32)
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).
Public methodCode exampleCopyOuterField(String, String, Int32, Single, Single)
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).
Public methodCode exampleDecorateField
Changes visual attributes of all fields in the PDF document.
Public methodCode exampleDecorateField(String)
Changes visual attributes of the specified field.
Public methodCode exampleDecorateField(FieldType)
Changes visual attributes of all fields with the specified field type.
Public methodCode exampleDelListItem
Delete item from the list field.
Public methodDispose
Disposes the facade.
(Inherited from Facade.)
Public methodEquals (Inherited from Object.)
Public methodGetFieldAppearance
Get field flags.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleMoveField
Set new position of field.
Public methodCode exampleRemoveField
Remove field from the form.
Public methodCode exampleRemoveFieldAction
Remove submit action of the field.
Public methodCode exampleRenameField
Change name of the field.
Public methodResetFacade
Reset all visual attribtues to empty value.
Public methodResetInnerFacade
Reset all visual attribtues of inner facade to empty value.
Public methodSave Obsolete.
Saves changes into destination file.
Public methodSave(Stream)
Saves the PDF document to the specified stream.
(Inherited from SaveableFacade.)
Public methodSave(String)
Saves the PDF document to the specified file.
(Inherited from SaveableFacade.)
Public methodCode exampleSetFieldAlignment
Set the alignment style of a text field.
Public methodCode exampleSetFieldAlignmentV
Set the vertical alignment style of a text field.
Public methodCode exampleSetFieldAppearance
Set field flags
Public methodCode exampleSetFieldAttribute
Set attributes of field.
Public methodCode exampleSetFieldCombNumber
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).
Public methodCode exampleSetFieldLimit
Sets maximum character count of the text field.
Public methodSetFieldScript
Set JavaScript for a PushButton field. If old JavaScript existed, it will be replaced by the new one.
Public methodCode exampleSetSubmitFlag
Set submit flag of submit button.
Public methodCode exampleSetSubmitUrl
Sets URL of the button.
Public methodCode exampleSingle2Multiple
Change a single-lined text field to a multiple-lined one.
Public methodToString (Inherited from Object.)
See Also