Form
Inheritance: java.lang.Object, com.aspose.pdf.facades.Facade com.aspose.pdf.facades.SaveableFacade com.aspose.pdf.facades.Form, com.aspose.pdf.facades.Facade, com.aspose.pdf.facades.SaveableFacade com.aspose.pdf.facades.Form, com.aspose.pdf.facades.SaveableFacade, com.aspose.pdf.facades.Form
All Implemented Interfaces: com.aspose.ms.System.IDisposable, IFacade, IForm, ISaveableFacade, Closeable, AutoCloseable
public final class Form extends SaveableFacade
Class representing Acro form object.
Constructors
| Constructor | Description |
|---|---|
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
| Form | Construtcor of Form without parameters. Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( “file.pdf”); |
Methods
| Method | Description |
|---|---|
| bindPdf | Initializes the facade. |
| bindPdf | Initializes the facade. |
| close | Closes opened files without any changes. |
| dispose | Closes all opened resources. This method is obsolete, use close() instead. |
| exportFdf | Exports the content of the fields of the pdf into the fdf stream. Form form = new Form(“PdfForm.pdf”); OutputStream stream = new FileOutputStream(“export.fdf”); form.exportFdf(stream); stream.close(); |
| exportXfdf | Exports the content of the fields of the pdf into the xml stream. The button field’s value will not be exported. Form form = new Form(“PdfForm.pdf”); FileInputStream fs = new FileInputStream(“export.xfdf”, FileMode.Create, FileAccess.Write); form.exportXfdf(fs); fs.close(); |
| exportXml | Exports the content of the fields of the pdf into the xml stream. The button field’s value will not be exported. Form form = new Form(“PdfForm.pdf”)); OutputStream fs = new FileOutputStream(“export.xml”); form.exportXml(fs); fs.close(); |
| extractXfaData | Extracts XFA data packet |
| fillBarcodeField | Fill a barcode field according to its fully qualified field name. Form form = new Form(“PdfForm.pdf”); form.fillBarcodeField(“textField”, “42207252”); |
| fillField | Fills the check box field with a boolean value. Notice: Only be applied to Check Box. Please note that Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name “Form.Subform.CheckBoxField” you should specify full name and not “CheckBoxField”. You can use FieldNames property to explore existing field names and search required field by its partial name. Form form = new Form(“PdfForm.pdf”); form.fillField(“checkboxField”, true); //how to search field by its partial name: Form form = new Form(“input.pdf”, “output.pdf”); for(String fieldName : form.getFieldNames()) { if (fieldName.endsWith(“CheckBoxField”)) { System.out.println(“Full name is: " + fieldName); } } |
| fillField | Fills the radio box field with a valid index value according to a fully qualified field name. Before filling the fields, only field’s name must be known. While the value can be specified by its index. Notice: Only be applied to Radio Box, Combo Box and List Box fields. Please note that Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name “Form.Subform.ListBoxField” you should specify full name and not “ListBoxField”. You can use FieldNames property to explore existing field names and search required field by its partial name. //1 Form form = new Form(“PdfForm.pdf”); form.fillField(“listboxField”, 2); form.fillField(“comboboxField”, 2); form.fillField(“radiobuttonField”, 2); //2 //how to search field by its partial name: Form form = new Form(“input.pdf”, “output.pdf”); for(String fieldName : form.getFieldNames()) { if (fieldName.endsWith(“ListBoxField”)) { System.out.println(“Full name is: " + fieldName); } } |
| fillField | Fills the field with a valid value according to a fully qualified field name. Before filling the fields, every field’s names and its corresponding valid values must be known. Both the fields’ name and values are case sensitive. Please note that Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name “Form.Subform.TextField” you should specify full name and not “TextField”. You can use FieldNames property to explore existing field names and search required field by its partial name. Form form = new Form(“PdfForm.pdf”); form.fillField(“FirstName”, “John”); form.fillField(“LastName”, “Smith”); //how to search field by its partial name: Form form = new Form(“input.pdf”, “output.pdf”); for(String fieldName : form.getFieldNames()) { if (fieldName.endsWith(“TextField”)) { System.out.println(“Full name is: " + fieldName); } } |
| fillField | Fill a field with multiple selections.Note: only for AcroForm List Box Field. Form form = new com.aspose.pdf.Form(“PdfForm.pdf”, “Form_Updated.pdf”); form.fillField(“ListBox1”, new String[] { “Three”, “One” }); form.save(); |
| fillField | Fills field with specified value. |
| fillFields | Fills the text box fields with a text values and save the document. |
| fillImageField | Overloads function of FillImageField. The input is a image stream. Form form = new Form(“PdfForm.pdf”, “PdfForm_filled.pdf”); form.fillImageField(“fieldName”, new FileInputStream(“file.jpg”, FileMode.Open, FileAccess.Read)); |
| fillImageField | Pastes an image onto the existing button field as its appearance according to its fully qualified field name. Form form = new Form(“PdfForm.pdf”, “PdfForm_filled.pdf”); form.fillImageField(“fieldName”, “file.jpg”); form.save(); |
| flattenAllFields | Flattens all the fields. Form form = new Form(“PdfForm.pdf”); form.flattenAllFields(); |
| flattenField | Flattens a specified field with the fully qualified field name. Any other field will remain unchangeable. If the fieldName is invalid, all the fields will remain unchangeable. Form form = new Form(“PdfForm.pdf”); form.flattenField(“textField”); |
| getAttachmentName | Gets name of attachment when result of operation is stored into HttpResponse objects as attachment. |
| getButtonOptionCurrentValue | Returns the current value for radio button option fields. Form form = new Form(“PdfForm.pdf”); System.out.println(form.GetButtonOptionCurrentValue(“btnField”)); |
| getButtonOptionValues | Gets the radio button option fields and related values based on the field name. This method has meaning for radio button groups. Form form = new Form(“PdfForm.pdf”); java.util.Map values = form.getButtonOptionValues(“Color”); System.out.println(values.get(“White”).toString()); System.out.println(values.get(“Black”).toString()); |
| getButtonOptionValuesInternal | Gets the radio button option fields and related values based on the field name. This method has meaning for radio button groups. Form form = new Form(“PdfForm.pdf”); Hashtable values = form.getButtonOptionValues(“Color”); System.out.println(values[“White”].toString()); System.out.println(values[“Black”].toString()); |
| getContentDisposition | Gets or sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline. |
| getDestFileName | Gets destination file name. |
| getDestStream | Gets or sets destination stream. |
| getField | Gets the field’s value according to its field name. Form form = new Form(“PdfForm.pdf”); System.out.println(“Field value = " + form.getField(“Field1”)); |
| getFieldFacade | Returns FormFieldFacade object containing all appearance attributes. com.aspose.pdf.facades.Form form = new com.aspose.pdf.facades.Form(“form.pdf”)); FormFieldFacade field = form.getFieldFacade(“field1”); System.out.println(“Color of field border: " + field.getBorderColor()); |
| getFieldFlag | Returns flags of the field. Form form = new Form(“PdfForm.pdf”); if (form.getFieldFlag(“textField”) == ProptyFlag.ReadOnly) { System.out.println(“Field is read-only”); } |
| getFieldLimit | Get the limitation of text field. Form form = new Form(“PdfForm.pdf”); System.out.println(form.getFieldLimit(“textfieldBox”)); |
| getFieldNames | Gets list of field names on the form. Form form = new Form(“PdfForm.pdf”); String[] fields = form.getFieldNames(); for(String field : fields) { System.out.println(field); } |
| getFieldType | Returns type of field. Form form = new Form(“PdfForm.pdf”); if (form.getFieldType(“textField”) == FieldType.Text) { System.out.println(“Type of field is text”); } |
| getFormSubmitButtonNames | Gets all form submit button names. Form form = new Form(“PdfForm.pdf”); String[] submits = form.getFormSubmitButtonNames(); for(String btn : submits) { System.out.println(btn); } |
| getFullFieldName | Gets the full field name according to its short field name. Form form = new Form(“PdfForm.pdf”); System.out.println(“Full field name is : " + form.getFullFieldName(“textField”)); |
| getImportResult | Result of last import operation. Array of objects which describe result of import for each field. |
| getRichText | Get a Rich Text field’s value, including the formatting information of every character. Form form = new Form(“PdfForm.pdf”); System.out.println(form.getRichText(“txtDescriptionRTF”)); |
| getSaveOptions | Gets or sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions. |
| getSrcFileName | Gets source file name. Form form = new com.aspose.pdf.Form(); form.setSrcFileName(“file.pdf”); |
| getSrcStream | Gets source stream. |
| getSubmitFlags | Returns the submit button’s submission flags Form form = new Form(“PdfForm.pdf”); System.out.println( ( form.getSubmitFlags(“btnSubmit”) | SubmitFormFlag.Xfdf != 0) ? " XFDF” : " “); /// System.out.println( ( form.getSubmitFlags(“btnSubmit”) | SubmitFormFlag.Fdf != 0) ? " FDF” : " “); System.out.println( ( form.getSubmitFlags(“btnSubmit”) | SubmitFormFlag.Pdf != 0) ? " PDF” : " “); |
| importFdf | Imports the content of the fields from the fdf file and put them into the new pdf. Form form = new Form(“PdfForm.pdf”, “PdfForm_imported.pdf”); form.importFdf(new FileInputStream(“data.fdf”)); form.save(); |
| importXfdf | Imports the content of the fields from the xfdf(xml) file and put them into the new pdf. Form form = new Form(“PdfForm.pdf”, “Form_ImportXfdf.pdf”); InputStream fs = new FileInputStream(“export_old.xfdf”); form.importXfdf(fs); fs.close(); form.save(); |
| importXml | Imports the content of the fields from the xml file and put them into the new pdf. Form form = new Form(“PdfForm.pdf”); InputStream fs = new FileInputStream(“import.xml”); form.importXml(fs); form.save(“Form_Imported.pdf”); |
| importXml | Imports the content of the fields from the xml file and put them into the new pdf. |
| importXml | Imports the content of the fields from the xml file and put them into the new pdf. Form form = new Form(“PdfForm.pdf”); form.importXml(“import.xml”); form.save( “Form_Imported.pdf”); |
| isRequiredField | Determines whether field is required or not. |
| renameField | Renames a field. Either AcroForm field or XFA field is OK. Form form = new Form(“PdfForm.pdf”, “PdfFormUpdated.pdf”); form.renameField(“field”, “field1”); form.save(); |
| save | Saves the value of the filled fields and close the opened Pdf document. Form form = new Form(“PdfForm.pdf”, “PdfForm_Changed.pdf”); form.fillField(“textField”, “new value”); form.save(); |
| save | Saves the value of the filled fields and close the opened Pdf document. Form form = new Form(“PdfForm.pdf”, “PdfForm_Changed.pdf”); form.fillField(“textField”, “new value”); form.save(); |
| save | Saves the value of the filled fields and close the opened Pdf document. Form form = new Form(“PdfForm.pdf”, “PdfForm_Changed.pdf”); form.fillField(“textField”, “new value”); form.save(); |
| setAttachmentName | Sets name of attachment when result of operation is stored into HttpResponse objects as attachment. |
| setContentDisposition | Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline. |
| setConvertTo | 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. |
| setDestFileName | Sets destination file name. Form form = new com.aspose.pdf.Form(); form.setDestFileName(“file.pdf”); |
| setDestStream | Gets destination stream. Form form = new com.aspose.pdf.Form(); form.setDestStream (new FileInputStream(“file.pdf”)); |
| setSaveOptions | Gets or sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions. |
| setSrcFileName | Sets source file name. |
| setSrcStream | Gets source stream. Form form = new com.aspose.pdf.Form(); form.setSrcStream (new FileInputStream(“source.pdf”))); |
| setXfaData | Replaces XFA data with specified data packet. Data packet may be extracted using ExtractXfaData. |
Form
public Form()
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
Form
Construtcor of Form without parameters.
Form form = new com.aspose.pdf.facades.Form(); form.setSrcFileName( "file.pdf");
bindPdf
Initializes the facade.
bindPdf
Initializes the facade.
close
public void close()
Closes opened files without any changes.
dispose
@Deprecated public void dispose()
Closes all opened resources. This method is obsolete, use close() instead.
exportFdf
Exports the content of the fields of the pdf into the fdf stream.
Form form = new Form("PdfForm.pdf"); OutputStream stream = new FileOutputStream("export.fdf"); form.exportFdf(stream); stream.close(); exportXfdf
Exports the content of the fields of the pdf into the xml stream. The button field's value will not be exported.
Form form = new Form("PdfForm.pdf"); FileInputStream fs = new FileInputStream("export.xfdf", FileMode.Create, FileAccess.Write); form.exportXfdf(fs); fs.close(); exportXml
Exports the content of the fields of the pdf into the xml stream. The button field's value will not be exported.
Form form = new Form("PdfForm.pdf")); OutputStream fs = new FileOutputStream("export.xml"); form.exportXml(fs); fs.close(); extractXfaData
Extracts XFA data packet
fillBarcodeField
Fill a barcode field according to its fully qualified field name.
Form form = new Form("PdfForm.pdf"); form.fillBarcodeField("textField", "42207252"); fillField
Fills the check box field with a boolean value. Notice: Only be applied to Check Box. Please note that Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name "Form.Subform.CheckBoxField" you should specify full name and not "CheckBoxField". You can use FieldNames property to explore existing field names and search required field by its partial name.
Form form = new Form("PdfForm.pdf"); form.fillField("checkboxField", true); //how to search field by its partial name: Form form = new Form("input.pdf", "output.pdf"); for(String fieldName : form.getFieldNames()) { if (fieldName.endsWith("CheckBoxField")) { System.out.println("Full name is: " + fieldName); } } fillField
Fills the radio box field with a valid index value according to a fully qualified field name. Before filling the fields, only field's name must be known. While the value can be specified by its index. Notice: Only be applied to Radio Box, Combo Box and List Box fields. Please note that Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name "Form.Subform.ListBoxField" you should specify full name and not "ListBoxField". You can use FieldNames property to explore existing field names and search required field by its partial name.
//1 Form form = new Form("PdfForm.pdf"); form.fillField("listboxField", 2); form.fillField("comboboxField", 2); form.fillField("radiobuttonField", 2); //2 //how to search field by its partial name: Form form = new Form("input.pdf", "output.pdf"); for(String fieldName : form.getFieldNames()) { if (fieldName.endsWith("ListBoxField")) { System.out.println("Full name is: " + fieldName); } } fillField
Fills the field with a valid value according to a fully qualified field name. Before filling the fields, every field's names and its corresponding valid values must be known. Both the fields' name and values are case sensitive. Please note that Facades supports only full field names and does not work with partial field names in contrast with Aspose.Pdf.Kit; For example if field has full name "Form.Subform.TextField" you should specify full name and not "TextField". You can use FieldNames property to explore existing field names and search required field by its partial name.
Form form = new Form("PdfForm.pdf"); form.fillField("FirstName", "John"); form.fillField("LastName", "Smith"); //how to search field by its partial name: Form form = new Form("input.pdf", "output.pdf"); for(String fieldName : form.getFieldNames()) { if (fieldName.endsWith("TextField")) { System.out.println("Full name is: " + fieldName); } } fillField
Fill a field with multiple selections.Note: only for AcroForm List Box Field.
Form form = new com.aspose.pdf.Form("PdfForm.pdf", "Form_Updated.pdf"); form.fillField("ListBox1", new String[] { "Three", "One" }); form.save(); fillField
Fills field with specified value.
fillFields
Fills the text box fields with a text values and save the document.
fillImageField
Overloads function of FillImageField. The input is a image stream.
Form form = new Form("PdfForm.pdf", "PdfForm_filled.pdf"); form.fillImageField("fieldName", new FileInputStream("file.jpg", FileMode.Open, FileAccess.Read)); fillImageField
Pastes an image onto the existing button field as its appearance according to its fully qualified field name.
Form form = new Form("PdfForm.pdf", "PdfForm_filled.pdf"); form.fillImageField("fieldName", "file.jpg"); form.save(); flattenAllFields
public void flattenAllFields()
Flattens all the fields.
Form form = new Form("PdfForm.pdf"); form.flattenAllFields(); flattenField
Flattens a specified field with the fully qualified field name. Any other field will remain unchangeable. If the fieldName is invalid, all the fields will remain unchangeable.
Form form = new Form("PdfForm.pdf"); form.flattenField("textField"); getAttachmentName
public String getAttachmentName()
Gets name of attachment when result of operation is stored into HttpResponse objects as attachment.
Returns: string object
getButtonOptionCurrentValue
Returns the current value for radio button option fields.
Form form = new Form("PdfForm.pdf"); System.out.println(form.GetButtonOptionCurrentValue("btnField")); getButtonOptionValues
Gets the radio button option fields and related values based on the field name. This method has meaning for radio button groups.
Form form = new Form("PdfForm.pdf"); java.util.Map values = form.getButtonOptionValues("Color"); System.out.println(values.get("White").toString()); System.out.println(values.get("Black").toString()); getButtonOptionValuesInternal
Gets the radio button option fields and related values based on the field name. This method has meaning for radio button groups.
Form form = new Form("PdfForm.pdf"); Hashtable values = form.getButtonOptionValues("Color"); System.out.println(values["White"].toString()); System.out.println(values["Black"].toString()); getContentDisposition
public ContentDisposition getContentDisposition()
Gets or sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.
Returns: ContentDisposition element @see ContentDisposition
getDestFileName
@Deprecated public String getDestFileName()
Gets destination file name.
Returns: string object
getDestStream
@Deprecated public OutputStream getDestStream()
Gets or sets destination stream.
Returns: OutputStream object
getField
Gets the field's value according to its field name.
Form form = new Form("PdfForm.pdf"); System.out.println("Field value = " + form.getField("Field1")); getFieldFacade
Returns FormFieldFacade object containing all appearance attributes.
com.aspose.pdf.facades.Form form = new com.aspose.pdf.facades.Form("form.pdf")); FormFieldFacade field = form.getFieldFacade("field1"); System.out.println("Color of field border: " + field.getBorderColor()); getFieldFlag
Returns flags of the field.
Form form = new Form("PdfForm.pdf"); if (form.getFieldFlag("textField") == ProptyFlag.ReadOnly) { System.out.println("Field is read-only"); } getFieldLimit
Get the limitation of text field.
Form form = new Form("PdfForm.pdf"); System.out.println(form.getFieldLimit("textfieldBox")); getFieldNames
public String [] getFieldNames()
Gets list of field names on the form.
Form form = new Form("PdfForm.pdf"); String[] fields = form.getFieldNames(); for(String field : fields) { System.out.println(field); } Returns: String[] object
getFieldType
Returns type of field.
Form form = new Form("PdfForm.pdf"); if (form.getFieldType("textField") == FieldType.Text) { System.out.println("Type of field is text"); } getFormSubmitButtonNames
public String [] getFormSubmitButtonNames()
Gets all form submit button names.
Form form = new Form("PdfForm.pdf"); String[] submits = form.getFormSubmitButtonNames(); for(String btn : submits) { System.out.println(btn); } Returns: String[] object
getFullFieldName
Gets the full field name according to its short field name.
Form form = new Form("PdfForm.pdf"); System.out.println("Full field name is : " + form.getFullFieldName("textField")); getImportResult
public com.aspose.pdf.facades.AForm.FormImportResult[] getImportResult()
Result of last import operation. Array of objects which describe result of import for each field.
Returns: FormImportResult[] array
getRichText
Get a Rich Text field's value, including the formatting information of every character.
Form form = new Form("PdfForm.pdf"); System.out.println(form.getRichText("txtDescriptionRTF")); getSaveOptions
public SaveOptions getSaveOptions()
Gets or sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.
Returns: SaveOptions object
getSrcFileName
@Deprecated public String getSrcFileName()
Gets source file name.
Form form = new com.aspose.pdf.Form(); form.setSrcFileName("file.pdf"); Returns: string object
getSrcStream
public InputStream getSrcStream()
Gets source stream.
Returns: InputStream object
getSubmitFlags
Returns the submit button's submission flags
Form form = new Form("PdfForm.pdf"); System.out.println( ( form.getSubmitFlags("btnSubmit") | SubmitFormFlag.Xfdf != 0) ? " XFDF" : " "); /// System.out.println( ( form.getSubmitFlags("btnSubmit") | SubmitFormFlag.Fdf != 0) ? " FDF" : " "); System.out.println( ( form.getSubmitFlags("btnSubmit") | SubmitFormFlag.Pdf != 0) ? " PDF" : " "); importFdf
Imports the content of the fields from the fdf file and put them into the new pdf.
Form form = new Form("PdfForm.pdf", "PdfForm_imported.pdf"); form.importFdf(new FileInputStream("data.fdf")); form.save(); importXfdf
Imports the content of the fields from the xfdf(xml) file and put them into the new pdf.
Form form = new Form("PdfForm.pdf", "Form_ImportXfdf.pdf"); InputStream fs = new FileInputStream("export_old.xfdf"); form.importXfdf(fs); fs.close(); form.save(); importXml
Imports the content of the fields from the xml file and put them into the new pdf.
Form form = new Form("PdfForm.pdf"); InputStream fs = new FileInputStream("import.xml"); form.importXml(fs); form.save("Form_Imported.pdf"); importXml
Imports the content of the fields from the xml file and put them into the new pdf.
importXml
Imports the content of the fields from the xml file and put them into the new pdf.
Form form = new Form("PdfForm.pdf"); form.importXml("import.xml"); form.save( "Form_Imported.pdf"); isRequiredField
Determines whether field is required or not.
renameField
Renames a field. Either AcroForm field or XFA field is OK.
Form form = new Form("PdfForm.pdf", "PdfFormUpdated.pdf"); form.renameField("field", "field1"); form.save(); save
public void save()
Saves the value of the filled fields and close the opened Pdf document.
Form form = new Form("PdfForm.pdf", "PdfForm_Changed.pdf"); form.fillField("textField", "new value"); form.save(); save
Saves the value of the filled fields and close the opened Pdf document.
Form form = new Form("PdfForm.pdf", "PdfForm_Changed.pdf"); form.fillField("textField", "new value"); form.save(); save
Saves the value of the filled fields and close the opened Pdf document.
Form form = new Form("PdfForm.pdf", "PdfForm_Changed.pdf"); form.fillField("textField", "new value"); form.save(); setAttachmentName
Sets name of attachment when result of operation is stored into HttpResponse objects as attachment.
setContentDisposition
Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.
setConvertTo
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.
setDestFileName
Sets destination file name.
Form form = new com.aspose.pdf.Form(); form.setDestFileName("file.pdf"); setDestStream
Gets destination stream.
Form form = new com.aspose.pdf.Form(); form.setDestStream (new FileInputStream("file.pdf")); setSaveOptions
Gets or sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.
setSrcFileName
Sets source file name.
setSrcStream
Gets source stream.
Form form = new com.aspose.pdf.Form(); form.setSrcStream (new FileInputStream("source.pdf"))); setXfaData
Replaces XFA data with specified data packet. Data packet may be extracted using ExtractXfaData.