Dim caption As String = "AddSignatureFormField"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.NewPDF()
If status = GdPictureStatus.OK Then
Dim fontResName As String = gdpicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontHelvetica)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If (gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeA4) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.DrawRectangle(300, 100, 200, 50, False, True) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.DrawText(fontResName, 320, 80, "Apply your signature here.") = GdPictureStatus.OK) Then
Dim signatureID As Integer = gdpicturePDF.AddSignatureFormField(300, 100, 200, 50, "Signature1")
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
status = gdpicturePDF.SaveToFile("test_AddSignatureFormField.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("The signature field with the index " + signatureID.ToString() + " has been added successfully and the file has been saved.", caption)
Else
MessageBox.Show("The method SaveToFile() has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The method AddSignatureFormField() has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The NewPage() method or one of the Draw... methods has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The method AddStandardFont() has failed with the status: " + status.ToString(), caption)
End If
Else
MessageBox.Show("The method NewPDF() has failed with the status: " + status.ToString(), caption)
End If
gdpicturePDF.Dispose()
string caption = "AddSignatureFormField";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.NewPDF();
if (status == GdPictureStatus.OK)
{
string fontResName = gdpicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontHelvetica);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if ((gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeA4) == GdPictureStatus.OK) &&
(gdpicturePDF.DrawRectangle(300, 100, 200, 50, false, true) == GdPictureStatus.OK) &&
(gdpicturePDF.DrawText(fontResName, 320, 80, "Apply your signature here.") == GdPictureStatus.OK))
{
int signatureID = gdpicturePDF.AddSignatureFormField(300, 100, 200, 50, "Signature1");
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
status = gdpicturePDF.SaveToFile("test_AddSignatureFormField.pdf");
if (status == GdPictureStatus.OK)
MessageBox.Show("The signature field with the index " + signatureID.ToString() + " has been added successfully and the file has been saved.", caption);
else
MessageBox.Show("The method SaveToFile() has failed with the status: " + status.ToString(), caption);
}
else
{
MessageBox.Show("The method AddSignatureFormField() has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("The NewPage() method or one of the Draw... methods has failed with the status: " + gdpicturePDF.GetStat().ToString(), caption);
}
}
else
{
MessageBox.Show("The method AddStandardFont() has failed with the status: " + status.ToString(), caption);
}
}
else
{
MessageBox.Show("The method NewPDF() has failed with the status: " + status.ToString(), caption);
}
gdpicturePDF.Dispose();