public final class FormEditor extends SaveableFacade implements IFormEditor
Class for editing forms (adding/deleting field etc)
| Constructor and Description |
|---|
FormEditor()
Constructor for FormEditor.
|
FormEditor(IDocument document)
Initializes new
FormEditor object on base of the document . |
FormEditor(IDocument document,
OutputStream destStream)
Deprecated.
|
FormEditor(IDocument document,
String destFileName)
Deprecated.
|
FormEditor(InputStream srcStream,
OutputStream destStream)
Deprecated.
|
FormEditor(String srcFileName,
String destFileName)
Constructor for FormEditor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addField(FieldType fieldType,
String fieldName,
int pageNum,
float llx,
float lly,
float urx,
float ury)
Add field of specified type to the form.
|
boolean |
addField(FieldType fieldType,
String fieldName,
String initValue,
int pageNum,
float llx,
float lly,
float urx,
float ury)
Add field of specified type to the form.
|
boolean |
addFieldScript(String fieldName,
String script)
Add JavaScript for a PushButton field.
|
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()
Close object instance
|
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(FieldType 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()
Deprecated.
|
String |
getAttachmentName()
Gets name of attachment when result of operation is stored into HttpResponse objects as
attachment.
|
ContentDisposition |
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.
|
int |
getFieldAppearance(String fieldName)
Get field flags.
|
String[] |
getItems()
Get Items which will be added to newly created list box or combo box.
|
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.
|
SubmitFormFlag |
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 attribtues to empty value.
|
void |
resetInnerFacade()
Reset all visual attribtues of inner facade to empty value.
|
void |
save()
Deprecated.
|
void |
setAttachmentName(String value)
Sets name of attachment when result of operation is stored into HttpResponse objects as
attachment.
|
void |
setContentDisposition(ContentDisposition value)
Sets how content will be stored when result of operation is stored into HttpResponse object.
|
void |
setConvertTo(PdfFormat 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.
|
boolean |
setSubmitFlag(String fieldName,
SubmitFormFlag submitFormFlag)
Set submit flag of submit button.
|
void |
setSubmitFlag(SubmitFormFlag value)
Set the submit button's submission flags
|
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.
|
save, savebindPdf, bindPdf, bindPdf, bindPdf, bindPdfpublic FormEditor()
Constructor for FormEditor.
FormEditor formEditor = new FormEditor();
public FormEditor(IDocument document)
Initializes new FormEditor object on base of the document .
document - Pdf document.@Deprecated public FormEditor(IDocument document, OutputStream destStream)
Initializes new FormEditor object on base of the document .
document - Pdf document.destStream - Destination stream.@Deprecated public FormEditor(IDocument document, String destFileName)
Initializes new FormEditor object on base of the document .
document - Pdf document.destFileName - Path of the destination file.@Deprecated public FormEditor(InputStream srcStream, OutputStream destStream)
Constructor for FormEditor.
FormEditor formEditor = new FormEditor(new FileInputStream("InFile.pdf"), new FileOutputStream("OutFile.pdf"));
srcStream - Source stream.destStream - Destination stream.public String getSrcFileName()
Gets name of source file.
getSrcFileName in interface IFormEditorpublic void setSrcFileName(String value)
Sets name of source file.
FormEditor editor = new FormEditor();
editor.setSrcFileName("InputFile.pdf");
setSrcFileName in interface IFormEditorvalue - string objectpublic String getDestFileName()
Gets destination file name.
getDestFileName in interface IFormEditorpublic void setDestFileName(String value)
Sets destination file name.
FormEditor editor = new FormEditor();
editor.setDestFileName("OutFile.pdf");
setDestFileName in interface IFormEditorvalue - string objectpublic InputStream getSrcStream()
Gets source stream.
getSrcStream in interface IFormEditorpublic void setSrcStream(InputStream value)
Sets source stream.
FormEditor editor = new FormEditor();
editor.setSrcStream(new FileInputStream("InFile.pdf"));
setSrcStream in interface IFormEditorvalue - InputStream objectpublic void setConvertTo(PdfFormat 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.
setConvertTo in interface IFormEditorvalue - PdfFormat elementPdfFormatpublic OutputStream getDestStream()
Gets destination stream.
FormEditor editor = new FormEditor();
editor.setDestStream(new FileInputStream("OutFile.pdf"));
getDestStream in interface IFormEditorpublic void setDestStream(OutputStream value)
Sets destination stream.
FormEditor editor = new FormEditor();
editor.setDestStream(new FileInputStream("OutFile.pdf"));
setDestStream in interface IFormEditorvalue - OutputStream objectpublic String[] getItems()
getItems in interface IFormEditorpublic 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();
setItems in interface IFormEditorvalue - String[] objectpublic String[][] getExportItems()
Gets options for combo box with export values.
getExportItems in interface IFormEditorpublic 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();
setExportItems in interface IFormEditorvalue - String[][] objectpublic FormFieldFacade getFacade()
Gets visual attributes of the field.
getFacade in interface IFormEditorpublic 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();
setFacade in interface IFormEditorvalue - FormFieldFacade objectpublic float getRadioGap()
Get the member to record the gap between two neighboring radio buttons in pixels,default is 50.
getRadioGap in interface IFormEditorpublic 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();
setRadioGap in interface IFormEditorvalue - float valuepublic boolean getRadioHoriz()
Get the flag to indicate whether the radios are arranged horizontally or vertically, default value is true.
getRadioHoriz in interface IFormEditorpublic 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();
setRadioHoriz in interface IFormEditorvalue - boolean valuepublic 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();
getRadioButtonItemSize in interface IFormEditorpublic 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();
setRadioButtonItemSize in interface IFormEditorvalue - double valuepublic SubmitFormFlag getSubmitFlag()
Get the submit button's submission flags
getSubmitFlag in interface IFormEditorSubmitFormFlagpublic void setSubmitFlag(SubmitFormFlag value)
Set the submit button's submission flags
setSubmitFlag in interface IFormEditorvalue - SubmitFormFlag elementSubmitFormFlag@Deprecated public void save()
Saves changes into destination file.
save in interface IFormEditorpublic 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);
setFieldAttribute in interface IFormEditorfieldName - Name of field which attributes should be set.flag - Flag (NoExport/ReadOnly/Required)public 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);
setFieldAppearance in interface IFormEditorfieldName - Name of field whose flags should be updated.flags - Flag of the field.AnnotationFlagspublic boolean setSubmitFlag(String fieldName, SubmitFormFlag submitFormFlag)
Set submit flag of submit button.
FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_SetSubmitFlag.pdf");
formEditor.setSubmitFlag("btnSubmit", SubmitFormFlag.Fdf);
setSubmitFlag in interface IFormEditorfieldName - Name of submit button.submitFormFlag - Submit flag.SubmitFormFlagpublic 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");
setSubmitUrl in interface IFormEditorfieldName - Submit button name.url - Fully qualified URL.public 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);
setFieldLimit in interface IFormEditorfieldName - Name of the text field.fieldLimit - New value of limit for the field.public 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);
setFieldCombNumber in interface IFormEditorfieldName - The qualified field name.combNumber - The number of combs to divide the field into.public 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);
moveField in interface IFormEditorfieldName - Name of field which must be moved.llx - Abscissa of the lower-left corner of the field.lly - Ordinate of the lower-left coerner of the field.urx - Abscissa of the upper-right corner of the field.ury - Ordinate of the upper-right corner of the field.public boolean addField(FieldType 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();
addField in interface IFormEditorfieldType - Type of the field which must be added.fieldName - Name of the field whic 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.public boolean addField(FieldType fieldType, String fieldName, String initValue, int pageNum, float llx, float lly, float urx, float ury)
Add field of specified type to the form.
addField in interface IFormEditorfieldType - Type of the field which must be added.fieldName - Name of the field whic 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.public void removeField(String fieldName)
Remove field from the form.
FormEditr formEditor = new FormEditor("PdfForm.pdf", "FormEditor_RemoveField.pdf");
formEditor.removeField("listboxField");
formEditor.removeField("textField");
removeField in interface IFormEditorfieldName - Name of the field which must be removed.public void resetFacade()
Reset all visual attribtues to empty value.
resetFacade in interface IFormEditorpublic void resetInnerFacade()
Reset all visual attribtues of inner facade to empty value.
resetInnerFacade in interface IFormEditorpublic 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.
copyInnerField in interface IFormEditorfieldName - String valuenewFieldName - String valuepageNum - int valuepublic 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.
copyInnerField in interface IFormEditorfieldName - String valuenewFieldName - String valuepageNum - int valueabscissa - float valueordinate - float valuepublic 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).
copyOuterField in interface IFormEditorsrcFileName - String valuefieldName - String valuepublic 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).
copyOuterField in interface IFormEditorsrcFileName - String valuefieldName - String valuepageNum - int valuepublic 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).
copyOuterField in interface IFormEditorsrcFileName - String valuefieldName - String valuepageNum - int valueabscissa - float valueordinate - float valuepublic 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");
decorateField in interface IFormEditorfieldName - The fully qualified field name.public void decorateField(FieldType 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);
decorateField in interface IFormEditorfieldType - Type of fields which will be decorated.FieldTypepublic 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();
decorateField in interface IFormEditorpublic 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");
renameField in interface IFormEditorfieldName - Old name of the field.newFieldName - New name of the field.public void removeFieldAction(String fieldName)
Remove submit action of the field.
FormEditor formEditor = new FormEditor("PdfForm.pdf", "FormEditor_RemoveFieldAction.pdf");
formEditor.removeFieldAction("btnSubmit");
removeFieldAction in interface IFormEditorfieldName - Name of the field.public 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);
addSubmitBtn in interface IFormEditorfieldName - 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.public 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)");
addListItem in interface IFormEditorfieldName - Name of the field ot which new item will be added.itemName - Name if new item.public 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)" });
addListItem in interface IFormEditorfieldName - 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).public 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");
delListItem in interface IFormEditorfieldName - Name of the field.itemName - Name of the item which must be deleted.public boolean setFieldScript(String fieldName, String script)
Set JavaScript for a PushButton field. If old JavaScript existed, it will be replaced by the new one.
setFieldScript in interface IFormEditorfieldName - The fully qualified field name.script - The Java script to be added/placed into a push button field.public 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");
single2Multiple in interface IFormEditorfieldName - The qualified field name.public 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);
setFieldAlignment in interface IFormEditorfieldName - The qualified field name.alignment - The alignment style definition, including FormFieldFacade.AlignLeft,
FormFieldFacade.AlignCenter and FormFieldFacade.AlignRight.public 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);
setFieldAlignmentV in interface IFormEditorfieldName - The qualified field name.alignment - The alignment style definition, including FormFieldFacade.AlignTop,
FormFieldFacade.AlignMiddle and FormFieldFacade.AlignRight.public IDocument getDocument()
Gets the document FormEditor is working on.
getDocument in interface IFormEditorgetDocument in class Facadepublic ContentDisposition getContentDisposition()
Gets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.
getContentDisposition in interface IFormEditorContentDispositionpublic void setContentDisposition(ContentDisposition value)
Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.
setContentDisposition in interface IFormEditorvalue - ContentDisposition elementContentDispositionpublic SaveOptions getSaveOptions()
Gets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.
getSaveOptions in interface IFormEditorpublic void setSaveOptions(SaveOptions value)
Sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.
setSaveOptions in interface IFormEditorvalue - SaveOptions objectpublic String getAttachmentName()
Gets name of attachment when result of operation is stored into HttpResponse objects as attachment.
getAttachmentName in interface IFormEditorpublic void setAttachmentName(String value)
Sets name of attachment when result of operation is stored into HttpResponse objects as attachment.
setAttachmentName in interface IFormEditorvalue - String objectpublic void close()
close in interface IFacadeclose in interface IFormEditorclose in interface Closeableclose in interface AutoCloseable@Deprecated public void dispose()
dispose in interface com.aspose.ms.System.IDisposabledispose in interface IFormEditorpublic int getFieldAppearance(String fieldName)
Get field flags.
fieldName - Name of the field.public boolean addFieldScript(String fieldName, String script)
Add JavaScript for a PushButton field. If old event exists, new event is added after it.
fieldName - The fully qualified field name.script - The Java script to be added/placed into a push button field.Copyright © 2025 Aspose. All Rights Reserved.