GetFormFieldFullTitleWithCloneNumber Method (GdPicturePDF)
In This Topic
Returns the fully qualified field name, which is completed with a '#' and the corresponding clone number, of a required form field, that is specified by
its unique form field's identifier and it is related to the currently loaded PDF document. The clone numbers distinguish full titles of all kids form fields
belonging to one parent form field. For a field with no parent, the fully qualified name and that with clone number are the same.
Syntax
'Declaration
Public Function GetFormFieldFullTitleWithCloneNumber( _
ByVal As Integer _
) As String
public string GetFormFieldFullTitleWithCloneNumber(
int
)
public function GetFormFieldFullTitleWithCloneNumber(
: Integer
): String;
public function GetFormFieldFullTitleWithCloneNumber(
: int
) : String;
public: string* GetFormFieldFullTitleWithCloneNumber(
int
)
public:
String^ GetFormFieldFullTitleWithCloneNumber(
int
)
Parameters
- FieldId
- A unique form field identifier specifying a required form field object. You can obtain this identifier using methods like GdPicturePDF.GetFormFieldId, GdPicturePDF.GetFormFieldChildID or methods intended to add form fields.
Return Value
The fully qualified field name completed with the clone number of the specified form field, in this form: name#clone_number. The
GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
Example
How to retrieve full titles and clone numbers of the form fields in the current document.
Dim caption As String = "Example: GetFormFieldFullTitleWithCloneNumber"
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If gdpicturePDF.LoadFromFile("forms.pdf", False) = GdPictureStatus.OK Then
Dim count As Integer = gdpicturePDF.GetFormFieldsCount()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
Dim formID As Integer = 0, cloneNr As Integer = 0
Dim message As String = "", fullTitle As String = "", withCloneNr As String = ""
Dim type As PdfFormFieldType = PdfFormFieldType.PdfFormFieldTypeUnknown
For i As Integer = 0 To count - 1
formID = gdpicturePDF.GetFormFieldId(i)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
type = gdpicturePDF.GetFormFieldType(formID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + "Field nr." + (i + 1).ToString() + ": type=" + type.ToString() + vbCrLf
fullTitle = gdpicturePDF.GetFormFieldFullTitle(formID)
message = message + " fullTitle="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + fullTitle
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
cloneNr = gdpicturePDF.GetFormFieldCloneNumber(formID)
message = message + "; cloneNr="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + cloneNr.ToString()
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
withCloneNr = gdpicturePDF.GetFormFieldFullTitle(formID)
message = message + "; titleWithCloneNr="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + withCloneNr
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + "The GetFormFieldType() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
Exit For
End If
message += vbCrLf
Next
If count = 0 Then MessageBox.Show("This file doesn't include forms.", caption) Else MessageBox.Show(message, caption)
Else
MessageBox.Show("The GetFormFieldsCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetFormFieldFullTitleWithCloneNumber";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("forms.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetFormFieldsCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
int formID = 0, cloneNr = 0;
string message = "", fullTitle = "", withCloneNr = "";
PdfFormFieldType type = PdfFormFieldType.PdfFormFieldTypeUnknown;
for (int i = 0; i < count; i++)
{
formID = gdpicturePDF.GetFormFieldId(i);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
type = gdpicturePDF.GetFormFieldType(formID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
message = message + "Field nr." + (i + 1).ToString() + ": type=" + type.ToString() + "\n";
fullTitle = gdpicturePDF.GetFormFieldFullTitle(formID);
message = message + " fullTitle=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + fullTitle;
else
message = message + gdpicturePDF.GetStat().ToString();
cloneNr = gdpicturePDF.GetFormFieldCloneNumber(formID);
message = message + "; cloneNr=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + cloneNr.ToString();
else
message = message + gdpicturePDF.GetStat().ToString();
withCloneNr = gdpicturePDF.GetFormFieldFullTitle(formID);
message = message + "; titleWithCloneNr=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + withCloneNr;
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + "The GetFormFieldType() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
}
else
{
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
break;
}
message += "\n";
}
if (count == 0)
MessageBox.Show("This file doesn't include forms.", caption);
else
MessageBox.Show(message, caption);
}
else
MessageBox.Show("The GetFormFieldsCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();
Example
How to retrieve full titles and clone numbers of the form fields in the current document.
Dim caption As String = "Example: GetFormFieldFullTitleWithCloneNumber"
Dim gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If gdpicturePDF.LoadFromFile("forms.pdf", False) = GdPictureStatus.OK Then
Dim count As Integer = gdpicturePDF.GetFormFieldsCount()
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
Dim formID As Integer = 0, cloneNr As Integer = 0
Dim message As String = "", fullTitle As String = "", withCloneNr As String = ""
Dim type As PdfFormFieldType = PdfFormFieldType.PdfFormFieldTypeUnknown
For i As Integer = 0 To count - 1
formID = gdpicturePDF.GetFormFieldId(i)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
type = gdpicturePDF.GetFormFieldType(formID)
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + "Field nr." + (i + 1).ToString() + ": type=" + type.ToString() + vbCrLf
fullTitle = gdpicturePDF.GetFormFieldFullTitle(formID)
message = message + " fullTitle="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + fullTitle
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
cloneNr = gdpicturePDF.GetFormFieldCloneNumber(formID)
message = message + "; cloneNr="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + cloneNr.ToString()
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
withCloneNr = gdpicturePDF.GetFormFieldFullTitle(formID)
message = message + "; titleWithCloneNr="
If gdpicturePDF.GetStat() = GdPictureStatus.OK Then
message = message + withCloneNr
Else
message = message + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + "The GetFormFieldType() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
End If
Else
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString()
Exit For
End If
message += vbCrLf
Next
If count = 0 Then MessageBox.Show("This file doesn't include forms.", caption) Else MessageBox.Show(message, caption)
Else
MessageBox.Show("The GetFormFieldsCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "Example: GetFormFieldFullTitleWithCloneNumber";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
if (gdpicturePDF.LoadFromFile("forms.pdf", false) == GdPictureStatus.OK)
{
int count = gdpicturePDF.GetFormFieldsCount();
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
int formID = 0, cloneNr = 0;
string message = "", fullTitle = "", withCloneNr = "";
PdfFormFieldType type = PdfFormFieldType.PdfFormFieldTypeUnknown;
for (int i = 0; i < count; i++)
{
formID = gdpicturePDF.GetFormFieldId(i);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
type = gdpicturePDF.GetFormFieldType(formID);
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
{
message = message + "Field nr." + (i + 1).ToString() + ": type=" + type.ToString() + "\n";
fullTitle = gdpicturePDF.GetFormFieldFullTitle(formID);
message = message + " fullTitle=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + fullTitle;
else
message = message + gdpicturePDF.GetStat().ToString();
cloneNr = gdpicturePDF.GetFormFieldCloneNumber(formID);
message = message + "; cloneNr=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + cloneNr.ToString();
else
message = message + gdpicturePDF.GetStat().ToString();
withCloneNr = gdpicturePDF.GetFormFieldFullTitle(formID);
message = message + "; titleWithCloneNr=";
if (gdpicturePDF.GetStat() == GdPictureStatus.OK)
message = message + withCloneNr;
else
message = message + gdpicturePDF.GetStat().ToString();
}
else
message = message + "The GetFormFieldType() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
}
else
{
message = message + "The GetFormFieldId() method has failed with the status: " + gdpicturePDF.GetStat().ToString();
break;
}
message += "\n";
}
if (count == 0)
MessageBox.Show("This file doesn't include forms.", caption);
else
MessageBox.Show(message, caption);
}
else
MessageBox.Show("The GetFormFieldsCount() method has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
else
MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();
See Also