Status of imported field More...

Inherits Aspose::Pdf::Facades::SaveableFacade.

Classes

class  FormImportResult
 Class which describes result if field import. More...
 

Public Types

enum  ImportStatus { ImportStatus::Success, ImportStatus::FieldNotFound }
 Status of imported field More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Public Member Functions

System::ArrayPtr< System::SharedPtr< Form::FormImportResult > > get_ImportResult ()
 Result of last import operation. Array of objects which descibre result of import for each field. More...
 
System::String get_SrcFileName () const
 Gets source file name.
Form form = new Aspose.Pdf.Facades.Form();
form.SrcFileName = "file.pdf";
More...
 
void set_SrcFileName (System::String value)
 Sets source file name.
Form form = new Aspose.Pdf.Facades.Form();
form.SrcFileName = "file.pdf";
More...
 
void set_ConvertTo (PdfFormat value)
 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. More...
 
System::String get_DestFileName () const
 Gets destiination file name. More...
 
void set_DestFileName (System::String value)
 Sets destiination file name. More...
 
System::SharedPtr< System::IO::Streamget_SrcStream () const
 Gets source stream.
Form form = new Aspose.Pdf.Facades.Form();
form.SrcStream = new FileStream("source.pdf", FileMode.Open, FileAccess.Read);
More...
 
void set_SrcStream (System::SharedPtr< System::IO::Stream > value)
 Sets source stream.
Form form = new Aspose.Pdf.Facades.Form();
form.SrcStream = new FileStream("source.pdf", FileMode.Open, FileAccess.Read);
More...
 
System::SharedPtr< System::IO::Streamget_DestStream () const
 Gets destination stream. More...
 
void set_DestStream (System::SharedPtr< System::IO::Stream > value)
 Sets destination stream. More...
 
System::ArrayPtr< System::Stringget_FieldNames ()
 Gets list of field names on the form. More...
 
System::ArrayPtr< System::Stringget_FormSubmitButtonNames ()
 Gets all form submit button names. More...
 
Aspose::Pdf::ContentDisposition get_ContentDisposition () const
 Gets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline. More...
 
void set_ContentDisposition (Aspose::Pdf::ContentDisposition value)
 Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline. More...
 
System::SharedPtr< System::Web::HttpResponseget_Response () const
 Gets Response object where result of operation will be stored. More...
 
void set_Response (System::SharedPtr< System::Web::HttpResponse > value)
 Sets Response object where result of operation will be stored. More...
 
System::SharedPtr< Aspose::Pdf::SaveOptionsget_SaveOptions () const
 Gets save options when result is stored as HttpResponse. Default value: PdfSaveOptions. More...
 
void set_SaveOptions (System::SharedPtr< Aspose::Pdf::SaveOptions > value)
 Sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions. More...
 
System::String get_AttachmentName () const
 Gets name of attachment when result of operation is stored into HttpResponse objects as attachment. More...
 
void set_AttachmentName (System::String value)
 Sets name of attachment when result of operation is stored into HttpResponse objects as attachment. More...
 
System::SharedPtr< FormFieldFacadeGetFieldFacade (System::String fieldName)
 Returns FrofmFieldFacade object containing all appearance attributes.
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form("form.pdf");
FormFieldFacade field = form.GetFieldFacade("field1");
Console.WriteLine("Color of field border: " + field.BorderColor);
More...
 
 Form (System::SharedPtr< System::IO::Stream > srcStream, System::SharedPtr< System::IO::Stream > destStream)
 Constructor of Form with two stream parameters. Specify same source and destination stream for incremental update. More...
 
 Form ()
 Construtcor of Form without parameters.
Form form = new Aspose.Pdf.Facades.Form();
form.SrcFileName = "file.pdf";
More...
 
bool FillField (System::String fieldName, System::String fieldValue)
 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 Aspose.Pdf.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. More...
 
bool FillField (System::String fieldName, int32_t index)
 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 Aspose.Pdf.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. More...
 
bool FillField (System::String fieldName, bool beChecked)
 Fills the check box field with a boolean value. Notice: Only be applied to Check Box. Please note that Aspose.Pdf.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. More...
 
System::String GetButtonOptionCurrentValue (System::String fieldName)
 Returns the current value for radio button option fields. More...
 
System::SharedPtr< System::Collections::Generic::Dictionary< System::String, System::String > > GetButtonOptionValues (System::String fieldName)
 Gets the radio button option fields and related values based on the field name. This method has meaning for radio button groups. More...
 
System::String GetField (System::String fieldName)
 Gets the field's value according to its field name. More...
 
System::String GetFullFieldName (System::String fieldName)
 Gets the full field name according to its short field name. More...
 
int32_t GetFieldLimit (System::String fieldName)
 Get the limitation of text field. More...
 
void Save ()
 Saves the value of the filled fields and close the opened Pdf document. More...
 
virtual void Save (System::String destFile)
 Saves document into specified file. More...
 
virtual void Save (System::SharedPtr< System::IO::Stream > destStream)
 Saves document into specified stream. More...
 
virtual void Close ()
 Closes opened files without any changes. More...
 
void FlattenAllFields ()
 Flattens all the fields. More...
 
void FlattenField (System::String fieldName)
 Flattens a specified field with the fully qualified field name. Any other field will remain unchangable. If the fieldName is invalid, all the fields will remain unchangable. More...
 
bool FillBarcodeField (System::String fieldName, System::String data)
 Fill a barcode field according to its fully qualified field name. More...
 
void ImportFdf (System::SharedPtr< System::IO::Stream > inputFdfStream)
 Imports the content of the fields from the fdf file and put them into the new pdf. More...
 
void ExportFdf (System::SharedPtr< System::IO::Stream > outputFdfStream)
 Exports the content of the fields of the pdf into the fdf stream. More...
 
void ImportXml (System::SharedPtr< System::IO::Stream > inputXmlStream)
 Imports the content of the fields from the xml file and put them into the new pdf. More...
 
void ExportXml (System::SharedPtr< System::IO::Stream > outputXmlStream)
 Exports the content of the fields of the pdf into the xml stream. The button field's value will not be exported. More...
 
void ExtractXfaData (System::SharedPtr< System::IO::Stream > outputXmlStream)
 Extracts XFA data packet More...
 
void SetXfaData (System::SharedPtr< System::IO::Stream > inputXmlStream)
 Replaces XFA data with specified data packet. Data packet may be extracted using ExtractXfaData. More...
 
void ImportXfdf (System::SharedPtr< System::IO::Stream > inputXfdfStream)
 Imports the content of the fields from the xfdf(xml) file and put them into the new pdf. More...
 
void ExportXfdf (System::SharedPtr< System::IO::Stream > outputXfdfStream)
 Exports the content of the fields of the pdf into the xml stream. The button field's value will not be exported. More...
 
void FillField (System::String fieldName, System::ArrayPtr< System::String > fieldValues)
 Fill a field with multiple selections.Note: only for AcroForm List Box Field. More...
 
void RenameField (System::String fieldName, System::String newFieldName)
 Renames a field. Either AcroForm field or XFA field is OK. More...
 
System::String GetRichText (System::String fieldName)
 Get a Rich Text field's value, including the formattinf information of every character. More...
 
SubmitFormFlag GetSubmitFlags (System::String fieldName)
 Returns the submit button's submission flags More...
 
 Form (System::String srcFileName)
 Constructor of Form. More...
 
 Form (System::SharedPtr< System::IO::Stream > srcStream)
 Constructor for form. More...
 
 Form (System::String srcFileName, System::String destFileName)
 Constructor of Form class. Specify same source file name and destination file name to perform incremental update. More...
 
 Form (System::String srcFileName, System::SharedPtr< System::IO::Stream > destStream)
 Constructor of Form. More...
 
 Form (System::SharedPtr< System::IO::Stream > srcStream, System::String destFileName)
 Constructor of Form More...
 
FieldType GetFieldType (System::String fieldName)
 Returns type of field. More...
 
bool IsRequiredField (System::String fieldName)
 Determines whether field is required or not. More...
 
PropertyFlag GetFieldFlag (System::String fieldName)
 Returns flags of the field. More...
 
void FillImageField (System::String fieldName, System::String imageFileName)
 Pastes an image onto the existing button field as its appearance according to its fully qualified field name. More...
 
void FillImageField (System::String fieldName, System::SharedPtr< System::IO::Stream > imageStream)
 Overloads function of FillImageField. The input is a image stream. More...
 
 Form (System::SharedPtr< Aspose::Pdf::Document > document)
 Initializes new Form object on base of the document . More...
 
 Form (System::SharedPtr< Aspose::Pdf::Document > document, System::String destFileName)
 Initializes new Form object on base of the document . More...
 
 Form (System::SharedPtr< Aspose::Pdf::Document > document, System::SharedPtr< System::IO::Stream > destStream)
 Initializes new Form object on base of the document . More...
 
void ImportXml (System::SharedPtr< System::IO::Stream > inputXmlStream, bool IgnoreFormTemplateChanges)
 Imports the content of the fields from the xml file and put them into the new pdf. More...
 
bool FillField (System::String fieldName, System::String value, bool fitFontSize)
 Fills field with specified value. More...
 
 Form (System::SharedPtr< System::IO::Stream > inputStream, System::SharedPtr< System::Web::HttpResponse > response)
 Creates form which will save result into HttpResponse object. More...
 
 Form (System::String inputFile, System::SharedPtr< System::Web::HttpResponse > response)
 Creates form which will save result into HttpResponse object. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::Facade
System::SharedPtr< Aspose::Pdf::Documentget_Document () const
 Gets the document facade is working on. More...
 
void SetVentureLicense (System::SharedPtr< Aspose::Pdf::LicenseManagement::VentureLicense > license)
 
System::SharedPtr< Aspose::Pdf::LicenseManagement::VentureLicense > GetVentureLicense ()
 
virtual void BindPdf (System::String srcFile)
 Initializes the facade. More...
 
virtual void BindPdf (System::SharedPtr< System::IO::Stream > srcStream)
 Initializes the facade. More...
 
virtual void BindPdf (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 Initializes the facade. More...
 
void Dispose ()
 Disposes the facade. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::IFacade
virtual void BindPdf (System::SharedPtr< Document > srcDoc)=0
 Binds PDF document for editing. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 
- Public Member Functions inherited from Aspose::Pdf::LicenseManagement::IVentureLicenseTarget
virtual void SetVentureLicense (System::SharedPtr< VentureLicense > license)=0
 

Protected Member Functions

virtual void BindPdf (System::SharedPtr< System::IO::Stream > srcStream, System::String password)
 Initializes the facade. More...
 
virtual void BindPdf (System::String srcFile, System::String password)
 Initializes the facade. More...
 
System::SharedPtr< System::Xml::XmlNodeGetFieldTemplate (System::String fieldName)
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::SaveableFacade
 SaveableFacade ()
 The constructor. More...
 
 SaveableFacade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::Facade
bool get__IsObjectLicensed ()
 Gets licensed state of the system. Returns true is system works in licensed mode and false otherwise. More...
 
 Facade ()
 The constructor. More...
 
 Facade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
virtual void AssertDocument () const
 Asserts if the facade is initialized. More...
 
virtual ~Facade ()
 

Static Protected Member Functions

static bool IsImageField (System::SharedPtr< Aspose::Pdf::Annotations::WidgetAnnotation > annotation)
 
static FieldType getFieldType (System::SharedPtr< Aspose::Pdf::Annotations::WidgetAnnotation > annotation)
 

Additional Inherited Members

- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Status of imported field

Member Enumeration Documentation

◆ ImportStatus

Status of imported field

Enumerator
Success 

Field was successfully imported

FieldNotFound 

Field with this name was not found in the document form.

Constructor & Destructor Documentation

◆ Form() [1/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< System::IO::Stream srcStream,
System::SharedPtr< System::IO::Stream destStream 
)

Constructor of Form with two stream parameters. Specify same source and destination stream for incremental update.

Deprecated:
Use constructor without destination.
Parameters
srcStreamSource stream.
destStreamDestination stream.
Form form = new Form(
new FileStream( "InFile.pdf", FileMode.Open, FileAccess.Read),
new FileStream("OutFile.pdf", FileMode.Create, FileAccess.Write));

◆ Form() [2/12]

Aspose::Pdf::Facades::Form::Form ( )

Construtcor of Form without parameters.

Form form = new Aspose.Pdf.Facades.Form();
form.SrcFileName = "file.pdf";

◆ Form() [3/12]

Aspose::Pdf::Facades::Form::Form ( System::String  srcFileName)

Constructor of Form.

Parameters
srcFileNameSource file path.
Form form = new Form("PdfForm.pdf");

◆ Form() [4/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< System::IO::Stream srcStream)

Constructor for form.

Parameters
srcStreamsource stream.
Form form = new Form(new FileStream("PdfForm.pdf", FileMode.Open, FileAccess.Read));

◆ Form() [5/12]

Aspose::Pdf::Facades::Form::Form ( System::String  srcFileName,
System::String  destFileName 
)

Constructor of Form class. Specify same source file name and destination file name to perform incremental update.

Deprecated:
Use constructor without destination.
Parameters
srcFileNamePath of the source file.
destFileNamePath of the destination file.
Form form = new Form("PdfForm.pdf", "PdfForm_Updated.pdf");

◆ Form() [6/12]

Aspose::Pdf::Facades::Form::Form ( System::String  srcFileName,
System::SharedPtr< System::IO::Stream destStream 
)

Constructor of Form.

Deprecated:
Use constructor without destination.
Parameters
srcFileNameSource file path.
destStreamDestination file path.
Form form = new Form("PdfForm.pdf", "PdfForm_Updated.pdf");

◆ Form() [7/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< System::IO::Stream srcStream,
System::String  destFileName 
)

Constructor of Form

Deprecated:
Use constructor without destination.
Parameters
srcStreamSource stream.
destFileNameDestination file path.
Form form = new Form(new FileStream("PdfForm.pdf", FileMode.Open, FileAccess.Read), "PdfForm_Updated.pdf");

◆ Form() [8/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< Aspose::Pdf::Document document)

Initializes new Form object on base of the document .

Parameters
documentPdf document.

◆ Form() [9/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< Aspose::Pdf::Document document,
System::String  destFileName 
)

Initializes new Form object on base of the document .

Deprecated:
Use constructor without destination.
Parameters
documentPdf document.
destFileNamePath of the destination file.

◆ Form() [10/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< Aspose::Pdf::Document document,
System::SharedPtr< System::IO::Stream destStream 
)

Initializes new Form object on base of the document .

Deprecated:
Use constructor without destination.
Parameters
documentPdf document.
destStreamDestination stream.

◆ Form() [11/12]

Aspose::Pdf::Facades::Form::Form ( System::SharedPtr< System::IO::Stream inputStream,
System::SharedPtr< System::Web::HttpResponse response 
)

Creates form which will save result into HttpResponse object.

Deprecated:
Use constructor without destination.
Parameters
inputStreamStream containing source document.
responseHttpResponse object where result will be saved.

◆ Form() [12/12]

Aspose::Pdf::Facades::Form::Form ( System::String  inputFile,
System::SharedPtr< System::Web::HttpResponse response 
)

Creates form which will save result into HttpResponse object.

Deprecated:
Use constructor without destination.
Parameters
inputFileName of input file.
responseHttpResponse object where result will be stored.

Member Function Documentation

◆ BindPdf() [1/2]

virtual void Aspose::Pdf::Facades::Form::BindPdf ( System::SharedPtr< System::IO::Stream srcStream,
System::String  password 
)
protectedvirtual

Initializes the facade.

Parameters
srcStreamThe stream of PDF file.
passwordThe password of the PDF document.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ BindPdf() [2/2]

virtual void Aspose::Pdf::Facades::Form::BindPdf ( System::String  srcFile,
System::String  password 
)
protectedvirtual

Initializes the facade.

Parameters
srcFileThe PDF file.
passwordThe password of the PDF document.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ Close()

virtual void Aspose::Pdf::Facades::Form::Close ( )
virtual

Closes opened files without any changes.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ ExportFdf()

void Aspose::Pdf::Facades::Form::ExportFdf ( System::SharedPtr< System::IO::Stream outputFdfStream)

Exports the content of the fields of the pdf into the fdf stream.

Parameters
outputFdfStreamThe output fdf stream.
Form form = new Form("PdfForm.pdf");
Stream stream = new FileStream("export.fdf", FileMode.Create, FileAccess.Write);
form.ExportFdf(stream);
stream.Close();

◆ ExportXfdf()

void Aspose::Pdf::Facades::Form::ExportXfdf ( System::SharedPtr< System::IO::Stream outputXfdfStream)

Exports the content of the fields of the pdf into the xml stream. The button field's value will not be exported.

Parameters
outputXfdfStreamThe output xml stream.
Form form = new Form("PdfForm.pdf");
FileStream fs = new FileStream("export.xfdf", FileMode.Create, FileAccess.Write);
form.ExportXfdf(fs);
fs.Close();

◆ ExportXml()

void Aspose::Pdf::Facades::Form::ExportXml ( System::SharedPtr< System::IO::Stream outputXmlStream)

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"));
FileStream fs = new FileStream("export.xml", FileMode.Create, FileAccess.Write);
form.ExportXml(fs);
fs.Close();
Parameters
outputXmlStreamOutput Xml stream.

◆ ExtractXfaData()

void Aspose::Pdf::Facades::Form::ExtractXfaData ( System::SharedPtr< System::IO::Stream outputXmlStream)

Extracts XFA data packet

Parameters
outputXmlStreamStream where XML data will be stored.

◆ FillBarcodeField()

bool Aspose::Pdf::Facades::Form::FillBarcodeField ( System::String  fieldName,
System::String  data 
)

Fill a barcode field according to its fully qualified field name.

Parameters
fieldNameThe fully qualified field name.
dataThe new barcode value.
Returns
If filling succeed, return true; otherwise, false.
Form form = new Form("PdfForm.pdf");
form.FillBarcodeField("textField", "42207252");

◆ FillField() [1/5]

bool Aspose::Pdf::Facades::Form::FillField ( System::String  fieldName,
System::String  fieldValue 
)

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 Aspose.Pdf.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.

Parameters
fieldNameThe field's name to be filled.
fieldValueThe field's value which must be a valid value for some fields.
Returns
true if field is found and filled successfully.
Form form = new Form(TestSettings.GetInputFile("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");
foreach(string fieldName in form.FieldNames)
{
if (fieldName.EndsWith("TextField"))
{
Console.WriteLine("Full name is: " + fieldName);
}
}

◆ FillField() [2/5]

bool Aspose::Pdf::Facades::Form::FillField ( System::String  fieldName,
int32_t  index 
)

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 Aspose.Pdf.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.

Parameters
fieldNameName of field to be filled.
indexIndex of chosen item.
Returns
true if field was found and successfully filled.
Form form = new Form("PdfForm.pdf");
form.FillField("listboxField", 2);
form.FillField("comboboxField", 2);
form.FillField("radiobuttonField", 2);
//how to search field by its partial name:
Form form = new Form("input.pdf", "output.pdf");
foreach(string fieldName in form.FieldNames)
{
if (fieldName.EndsWith("ListBoxField"))
{
Console.WriteLine("Full name is: " + fieldName);
}
}

◆ FillField() [3/5]

bool Aspose::Pdf::Facades::Form::FillField ( System::String  fieldName,
bool  beChecked 
)

Fills the check box field with a boolean value. Notice: Only be applied to Check Box. Please note that Aspose.Pdf.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");
foreach(string fieldName in form.FieldNames)
{
if (fieldName.EndsWith("CheckBoxField"))
{
Console.WriteLine("Full name is: " + fieldName);
}
}
Parameters
fieldNameThe field's name to be filled.
beCheckedA boolean flag: true means to check the box, while false to uncheck it.
Returns
true if field was found and successfully filled.

◆ FillField() [4/5]

void Aspose::Pdf::Facades::Form::FillField ( System::String  fieldName,
System::ArrayPtr< System::String fieldValues 
)

Fill a field with multiple selections.Note: only for AcroForm List Box Field.

Parameters
fieldNameThe fully qualified field name.
fieldValuesA string array which contains several items to be selected.
Form form = new Aspose.Pdf.Facades.Form("PdfForm.pdf", "Form_Updated.pdf");
form.FillField("ListBox1", new String[] { "Three", "One" });
form.Save();

◆ FillField() [5/5]

bool Aspose::Pdf::Facades::Form::FillField ( System::String  fieldName,
System::String  value,
bool  fitFontSize 
)

Fills field with specified value.

Parameters
fieldNameName of field
valueNew value of the field
fitFontSizeIf true, the font size in the edit boxes will be fitted.
Returns
true if field was found and successfully filled.

◆ FillImageField() [1/2]

void Aspose::Pdf::Facades::Form::FillImageField ( System::String  fieldName,
System::String  imageFileName 
)

Pastes an image onto the existing button field as its appearance according to its fully qualified field name.

Parameters
fieldNameThe fully qualified field name of the image button field.
imageFileNameThe path of the image file, relative and absolute are both ok.
Form form = new Form("PdfForm.pdf", "PdfForm_filled.pdf");
form.FillImageField("fieldName", "file.jpg");
form.Save();

◆ FillImageField() [2/2]

void Aspose::Pdf::Facades::Form::FillImageField ( System::String  fieldName,
System::SharedPtr< System::IO::Stream imageStream 
)

Overloads function of FillImageField. The input is a image stream.

Parameters
fieldNameThe fully qualified field name.
imageStreamThe image's stream.
Form form = new Form("PdfForm.pdf", "PdfForm_filled.pdf");
form.FillImageField("fieldName", new FileStream("file.jpg", FileMode.Open, FileAccess.Read));

◆ FlattenAllFields()

void Aspose::Pdf::Facades::Form::FlattenAllFields ( )

Flattens all the fields.

Form form = new Form("PdfForm.pdf");
form.FlattenAllFields();

◆ FlattenField()

void Aspose::Pdf::Facades::Form::FlattenField ( System::String  fieldName)

Flattens a specified field with the fully qualified field name. Any other field will remain unchangable. If the fieldName is invalid, all the fields will remain unchangable.

Form form = new Form("PdfForm.pdf");
form.FlattenField("textField");
Parameters
fieldNameThe name of the field to be flattened.

◆ get_AttachmentName()

System::String Aspose::Pdf::Facades::Form::get_AttachmentName ( ) const

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

◆ get_ContentDisposition()

Aspose::Pdf::ContentDisposition Aspose::Pdf::Facades::Form::get_ContentDisposition ( ) const

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

◆ get_DestFileName()

System::String Aspose::Pdf::Facades::Form::get_DestFileName ( ) const

Gets destiination file name.

Deprecated:
Use Save(outputFile) method for getting facade results.
Form form = new Aspose.Pdf.Facades.Form();
form.DestFileName = "file.pdf";

◆ get_DestStream()

System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::Form::get_DestStream ( ) const

Gets destination stream.

Deprecated:
Use Save(outputStream) method for getting facade results.
Form form = new Aspose.Pdf.Facades.Form();
form.DestStream = new FileStream("file.pdf", FileMode.Open, FileAccess.Read);

◆ get_FieldNames()

System::ArrayPtr<System::String> Aspose::Pdf::Facades::Form::get_FieldNames ( )

Gets list of field names on the form.

Form form = new Form("PdfForm.pdf");
string[] fields = form.FieldNames;
foreach(string field in fields)
{
Console.WriteLine(field);
}

◆ get_FormSubmitButtonNames()

System::ArrayPtr<System::String> Aspose::Pdf::Facades::Form::get_FormSubmitButtonNames ( )

Gets all form submit button names.

Form form = new Form("PdfForm.pdf");
string[] submits = form.FormSubmitButtonNames;
foreach(string btn in submits)
{
Console.WriteLine(btn);
}

◆ get_ImportResult()

System::ArrayPtr<System::SharedPtr<Form::FormImportResult> > Aspose::Pdf::Facades::Form::get_ImportResult ( )

Result of last import operation. Array of objects which descibre result of import for each field.

◆ get_Response()

System::SharedPtr<System::Web::HttpResponse> Aspose::Pdf::Facades::Form::get_Response ( ) const

Gets Response object where result of operation will be stored.

◆ get_SaveOptions()

System::SharedPtr<Aspose::Pdf::SaveOptions> Aspose::Pdf::Facades::Form::get_SaveOptions ( ) const

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

◆ get_SrcFileName()

System::String Aspose::Pdf::Facades::Form::get_SrcFileName ( ) const

Gets source file name.

Form form = new Aspose.Pdf.Facades.Form();
form.SrcFileName = "file.pdf";
Deprecated:
Use BindPdf(inputFile) method for facade initialization.

◆ get_SrcStream()

System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::Form::get_SrcStream ( ) const

Gets source stream.

Form form = new Aspose.Pdf.Facades.Form();
form.SrcStream = new FileStream("source.pdf", FileMode.Open, FileAccess.Read);
Deprecated:
Use BindPdf(inputStream) method for facade initialization.

◆ GetButtonOptionCurrentValue()

System::String Aspose::Pdf::Facades::Form::GetButtonOptionCurrentValue ( System::String  fieldName)

Returns the current value for radio button option fields.

Parameters
fieldNameField Name
Returns
String value for the current radio group optino. See also GetButtonOptionValues
Form form = new Form("PdfForm.pdf");
Console.WriteLine(form.GetButtonOptionCurrentValue("btnField"));

◆ GetButtonOptionValues()

System::SharedPtr<System::Collections::Generic::Dictionary<System::String, System::String> > Aspose::Pdf::Facades::Form::GetButtonOptionValues ( System::String  fieldName)

Gets the radio button option fields and related values based on the field name. This method has meaning for radio button groups.

Parameters
fieldNameField Name
Returns
Hash table of option values keyed by form item name
Form form = new Form("PdfForm.pdf");
Hashtable values = form.GetButtonOptionValues("Color");
Console.WriteLine(values["White"].ToString());
Console.WriteLine(values["Black"].ToString());

◆ GetField()

System::String Aspose::Pdf::Facades::Form::GetField ( System::String  fieldName)

Gets the field's value according to its field name.

Parameters
fieldNameThe fully qualified field name.
Returns
The field's value.
Form form = new Form("PdfForm.pdf");
Console.WriteLine("Field value = " + form.GetField("Field1"));

◆ GetFieldFacade()

System::SharedPtr<FormFieldFacade> Aspose::Pdf::Facades::Form::GetFieldFacade ( System::String  fieldName)

Returns FrofmFieldFacade object containing all appearance attributes.

Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form("form.pdf");
FormFieldFacade field = form.GetFieldFacade("field1");
Console.WriteLine("Color of field border: " + field.BorderColor);
Parameters
fieldNameName of field to read.
Returns
FormFieldFacade object

◆ GetFieldFlag()

PropertyFlag Aspose::Pdf::Facades::Form::GetFieldFlag ( System::String  fieldName)

Returns flags of the field.

Parameters
fieldNameField name
Returns
Property flag (ReadOnly/ Required/NoExport
Form form = new Form("PdfForm.pdf");
if (form.GetFieldFlag("textField") == PropertyFlag.ReadOnly)
{
Console.WriteLine("Field is read-only");
}

◆ GetFieldLimit()

int32_t Aspose::Pdf::Facades::Form::GetFieldLimit ( System::String  fieldName)

Get the limitation of text field.

Parameters
fieldNameThe qualified field name.
Returns
Return the limitation number of characters a text field can be filled. It not set, return 0.
Form form = new Form("PdfForm.pdf");
Console.WriteLine(form.GetFieldLimit("textfieldBox"));

◆ GetFieldTemplate()

System::SharedPtr<System::Xml::XmlNode> Aspose::Pdf::Facades::Form::GetFieldTemplate ( System::String  fieldName)
protected

◆ GetFieldType()

FieldType Aspose::Pdf::Facades::Form::GetFieldType ( System::String  fieldName)

Returns type of field.

Parameters
fieldNameField name.
Returns
Element of FileType enumeration corresponding to field type.
Form form = new Form("PdfForm.pdf");
if (form.GetFieldType("textField") == FieldType.Text)
{
Console.WriteLine("Type of field is text");
}

◆ getFieldType()

static FieldType Aspose::Pdf::Facades::Form::getFieldType ( System::SharedPtr< Aspose::Pdf::Annotations::WidgetAnnotation annotation)
staticprotected

◆ GetFullFieldName()

System::String Aspose::Pdf::Facades::Form::GetFullFieldName ( System::String  fieldName)

Gets the full field name according to its short field name.

Parameters
fieldNameThe fully qualified field name.
Returns
The full field name.
Form form = new Form("PdfForm.pdf");
Console.WriteLine("Full field name is : " + form.GetFullFieldName("textField"));

◆ GetRichText()

System::String Aspose::Pdf::Facades::Form::GetRichText ( System::String  fieldName)

Get a Rich Text field's value, including the formattinf information of every character.

Parameters
fieldNameThe fully qualified field name of the Rich Text field.
Returns
Return a string containing formatting information of the Rich Text field.
Form form = new Form("PdfForm.pdf");
Console.WriteLine(form.GetRichText("txtDescriptionRTF"));

◆ GetSubmitFlags()

SubmitFormFlag Aspose::Pdf::Facades::Form::GetSubmitFlags ( System::String  fieldName)

Returns the submit button's submission flags

Parameters
fieldNameThe qualified field name.
Returns
Submission flags of the button.
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form("PdfForm.pdf");
System.Console.WriteLine((form.GetSubmitFlags("btnSubmit") | Aspose.Pdf.Facades.SubmitFormFlag.Xfdf )!= 0 ? " XFDF" : " ");
System.Console.WriteLine((form.GetSubmitFlags("btnSubmit") | Aspose.Pdf.Facades.SubmitFormFlag.Fdf )!= 0 ? " FDF" : " ");
System.Console.WriteLine((form.GetSubmitFlags("btnSubmit") | Aspose.Pdf.Facades.SubmitFormFlag.Pdf )!= 0 ? " PDF" : " ");

◆ ImportFdf()

void Aspose::Pdf::Facades::Form::ImportFdf ( System::SharedPtr< System::IO::Stream inputFdfStream)

Imports the content of the fields from the fdf file and put them into the new pdf.

Parameters
inputFdfStreamThe input fdf stream.
Form form = new Form("PdfForm.pdf", "PdfForm_imported.pdf");
form.ImportFdf(new FileStream("data.fdf", FileMode.Open, FileAccess.Read));
form.Save();

◆ ImportXfdf()

void Aspose::Pdf::Facades::Form::ImportXfdf ( System::SharedPtr< System::IO::Stream inputXfdfStream)

Imports the content of the fields from the xfdf(xml) file and put them into the new pdf.

Parameters
inputXfdfStreamThe input xfdf(xml) stream.
Form form = new Form("PdfForm.pdf", "Form_ImportXfdf.pdf");
Stream fs = new FileStream("export_old.xfdf", FileMode.Open, FileAccess.Read);
form.ImportXfdf(fs);
fs.Close();
form.Save();

◆ ImportXml() [1/2]

void Aspose::Pdf::Facades::Form::ImportXml ( System::SharedPtr< System::IO::Stream inputXmlStream)

Imports the content of the fields from the xml file and put them into the new pdf.

Parameters
inputXmlStreamStream from which XML for import is read.
Form form = new Form("PdfForm.pdf", "Form_Imported.pdf");
FileStream fs = new FileStream(TestSettings.GetInputFile("import.xml"), FileMode.Open, FileAccess.Read);
form.ImportXml(fs);
form.Save();

◆ ImportXml() [2/2]

void Aspose::Pdf::Facades::Form::ImportXml ( System::SharedPtr< System::IO::Stream inputXmlStream,
bool  IgnoreFormTemplateChanges 
)

Imports the content of the fields from the xml file and put them into the new pdf.

Parameters
inputXmlStreamThe input xml stream.
IgnoreFormTemplateChangesIf this parameter is true then all changes of the XFA form template will not be saved

◆ IsImageField()

static bool Aspose::Pdf::Facades::Form::IsImageField ( System::SharedPtr< Aspose::Pdf::Annotations::WidgetAnnotation annotation)
staticprotected

◆ IsRequiredField()

bool Aspose::Pdf::Facades::Form::IsRequiredField ( System::String  fieldName)

Determines whether field is required or not.

Parameters
fieldNameThe name of field.
Returns
True - the field is required; otherwise, false.

◆ RenameField()

void Aspose::Pdf::Facades::Form::RenameField ( System::String  fieldName,
System::String  newFieldName 
)

Renames a field. Either AcroForm field or XFA field is OK.

Parameters
fieldNamethe old field name
newFieldNamethe new field name
Form form = new Form("PdfForm.pdf", "PdfFormUpdated.pdf");
form.RenameField("field", "field1");
form.Save();

◆ Save() [1/3]

void Aspose::Pdf::Facades::Form::Save ( )

Saves the value of the filled fields and close the opened Pdf document.

Deprecated:
Use Save(destination) method for saving facade results.
Form form = new Form("PdfForm.pdf", "PdfForm_Changed.pdf");
form.FillField("textField", "new value");
form.Save();

◆ Save() [2/3]

virtual void Aspose::Pdf::Facades::Form::Save ( System::String  destFile)
virtual

Saves document into specified file.

Parameters
destFileFile where document will be saved.

Reimplemented from Aspose::Pdf::Facades::SaveableFacade.

◆ Save() [3/3]

virtual void Aspose::Pdf::Facades::Form::Save ( System::SharedPtr< System::IO::Stream destStream)
virtual

Saves document into specified stream.

Parameters
destStreamStream where document will be saved.

Reimplemented from Aspose::Pdf::Facades::SaveableFacade.

◆ set_AttachmentName()

void Aspose::Pdf::Facades::Form::set_AttachmentName ( System::String  value)

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

◆ set_ContentDisposition()

void Aspose::Pdf::Facades::Form::set_ContentDisposition ( Aspose::Pdf::ContentDisposition  value)

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

◆ set_ConvertTo()

void Aspose::Pdf::Facades::Form::set_ConvertTo ( PdfFormat  value)

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.

◆ set_DestFileName()

void Aspose::Pdf::Facades::Form::set_DestFileName ( System::String  value)

Sets destiination file name.

Deprecated:
Use Save(outputFile) method for getting facade results.
Form form = new Aspose.Pdf.Facades.Form();
form.DestFileName = "file.pdf";

◆ set_DestStream()

void Aspose::Pdf::Facades::Form::set_DestStream ( System::SharedPtr< System::IO::Stream value)

Sets destination stream.

Deprecated:
Use Save(outputStream) method for getting facade results.
Form form = new Aspose.Pdf.Facades.Form();
form.DestStream = new FileStream("file.pdf", FileMode.Open, FileAccess.Read);

◆ set_Response()

void Aspose::Pdf::Facades::Form::set_Response ( System::SharedPtr< System::Web::HttpResponse value)

Sets Response object where result of operation will be stored.

◆ set_SaveOptions()

void Aspose::Pdf::Facades::Form::set_SaveOptions ( System::SharedPtr< Aspose::Pdf::SaveOptions value)

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

◆ set_SrcFileName()

void Aspose::Pdf::Facades::Form::set_SrcFileName ( System::String  value)

Sets source file name.

Form form = new Aspose.Pdf.Facades.Form();
form.SrcFileName = "file.pdf";
Deprecated:
Use BindPdf(inputFile) method for facade initialization.

◆ set_SrcStream()

void Aspose::Pdf::Facades::Form::set_SrcStream ( System::SharedPtr< System::IO::Stream value)

Sets source stream.

Form form = new Aspose.Pdf.Facades.Form();
form.SrcStream = new FileStream("source.pdf", FileMode.Open, FileAccess.Read);
Deprecated:
Use BindPdf(inputStream) method for facade initialization.

◆ SetXfaData()

void Aspose::Pdf::Facades::Form::SetXfaData ( System::SharedPtr< System::IO::Stream inputXmlStream)

Replaces XFA data with specified data packet. Data packet may be extracted using ExtractXfaData.

Parameters
inputXmlStreamStream where XML is stored.