Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

PdfGraphicsAcroFormSignatureField.ContentImage Property

Specifies an image displayed in the signature form field.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v19.2.Drawing.dll

Declaration

public Image ContentImage { get; set; }

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.

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

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.

See Also