AddEmptySignatureField(PdfPage) Метод (PdfPageDigitalSignatureHelper)
Добавляет пустое поле для подписи на PDF страницу.
Parameters
- page
- Страница, на которую следует добавить пустое поле для подписи.
Return Value
Новый экземпляр класса
PdfInteractiveFormSignatureField, который представляет собой добавленное поле подписи.
Вот пример, который показывает, как добавить пустое поле для подписи на PDF страницу:
Imports System.Drawing
Imports Vintasoft.Imaging.Pdf
''' <summary>
''' Adds an empty signature field to a PDF page.
''' </summary>
Public Class PdfPageDigitalSignatureHelper_EmptySignatureField
Public Shared Sub Run()
' create a helper that alows to add digital signature to a PDF document
Dim digitalSignatureHelper As New PdfPageDigitalSignatureHelper(Nothing, New RectangleF(20, 20, 250, 100))
' set the appearance for signature field
digitalSignatureHelper.SignatureText = "Add your signature here"
digitalSignatureHelper.SignatureBackgoundColor = Color.Yellow
' open PDF document
Using document As New PdfDocument("TestDocumentToSign.pdf")
' add signature field to the first PDF page
digitalSignatureHelper.AddEmptySignatureField(document.Pages(0))
' save PDF document to the output file
document.SaveChanges("TestDocumentToSign-output.pdf")
End Using
End Sub
End Class
using System.Drawing;
using Vintasoft.Imaging.Pdf;
/// <summary>
/// Adds an empty signature field to a PDF page.
/// </summary>
public class PdfPageDigitalSignatureHelper_EmptySignatureField
{
public static void Run()
{
// create a helper that alows to add digital signature to a PDF document
PdfPageDigitalSignatureHelper digitalSignatureHelper =
new PdfPageDigitalSignatureHelper(null, new RectangleF(20, 20, 250, 100));
// set the appearance for signature field
digitalSignatureHelper.SignatureText = "Add your signature here";
digitalSignatureHelper.SignatureBackgoundColor = Color.Yellow;
// open PDF document
using (PdfDocument document = new PdfDocument("TestDocumentToSign.pdf"))
{
// add signature field to the first PDF page
digitalSignatureHelper.AddEmptySignatureField(document.Pages[0]);
// save PDF document to the output file
document.SaveChanges("TestDocumentToSign-output.pdf");
}
}
}
Целевые платформы: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5