PdfGraphicsAcroFormSignatureField.ContentImage Property
Specifies an image displayed in the signature form field.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Pdf.v19.2.Drawing.dll
Declaration
Property Value
Type | Description |
---|---|
Image | A Image object that is an image displayed in the signature form field. |
Remarks
If an image for the signature form field is specified using the ContentImage property, the appearance settings of the signature form field (e.g., PdfAcroFormSignatureField.Text, PdfGraphicsAcroFormField.Appearance) will be ignored. In this case, only an image is displayed in the signature field rectangle.
To specify whether an image should be stretched to fill the rectangle of a signature form field, use the PdfGraphicsAcroFormSignatureField.StretchContentImage property.
Example
This example shows how to create a signature field and add it to a PDF document using the Document Creation API.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-add-a-signature-field-to-a-document-t494227
Imports DevExpress.Pdf
Imports System.Drawing
Namespace AddSignatureField
Friend Class Program
Shared Sub Main(ByVal args() As String)
Using processor As New PdfDocumentProcessor()
' Create an empty document.
processor.CreateEmptyDocument("..\..\Result.pdf")
' Create graphics and draw a signature field.
Using graphics As PdfGraphics = processor.CreateGraphics()
DrawSignatureField(graphics)
' Render a page with graphics.
processor.RenderNewPage(PdfPaperSize.Letter, graphics)
End Using
End Using
End Sub
Private Shared Sub DrawSignatureField(ByVal graphics As PdfGraphics)
' Create a signature field specifying its name and location.
Dim signature As New PdfGraphicsAcroFormSignatureField("signature", New RectangleF(0, 20, 120, 130))
' Specify a content image for the signature field.
Dim image As Image = System.Drawing.Image.FromFile("..\..\Image.png")
signature.ContentImage = image
' Add the field to the document.
graphics.AddFormField(signature)
End Sub
End Class
End Namespace
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ContentImage property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.