Skip to main content
.NET Framework 4.5.2+

PdfGraphicsAcroFormSignatureField.ContentImage Property

Specifies an image displayed in the signature form field.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Drawing

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

The appearance settings of the signature form field (e.g., Text, Appearance) are ignored if the ContentImage property is specified.

Use the StretchContentImage property to specify whether to stretch an image to fill the form field rectangle.

Example

This example shows how to use PDF Graphics API to create a signature field and add it to a new PDF page.

View Example

using DevExpress.Pdf;
using System.Drawing;

//...

static void Main(string[] args)
{
    using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
    {
        // Create an empty document. 
        processor.CreateEmptyDocument("..\\..\\Result.pdf");

        // Create graphics and draw a signature field.
        using (PdfGraphics graphics = processor.CreateGraphics())
        {
            DrawSignatureField(graphics);

            // Render a page with graphics.
            processor.RenderNewPage(PdfPaperSize.Letter, graphics);
        }
    }
}

static void DrawSignatureField(PdfGraphics graphics)
{
    // Create a signature field
    PdfGraphicsAcroFormSignatureField signature = new PdfGraphicsAcroFormSignatureField("signature", new RectangleF(0, 20, 120, 130));

    // Specify a content image for the signature field.
    Image image = Image.FromFile("..\\..\\Image.png");
    signature.ContentImage = image;            

    // Add the field to the document.
    graphics.AddFormField(signature);
}

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