Back to Devexpress

PdfSignatureBuilder.SetImageData(Byte[]) Method

officefileapi-devexpress-dot-pdf-dot-pdfsignaturebuilder-dot-setimagedata-x28-system-dot-byte-x29.md

latest4.9 KB
Original Source

PdfSignatureBuilder.SetImageData(Byte[]) Method

Sets the signature’s image data.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public void SetImageData(
    byte[] imageData
)
vb
Public Sub SetImageData(
    imageData As Byte()
)

Parameters

NameTypeDescription
imageDataByte[]

A byte array that represents image data.

|

Remarks

Use the PdfSignatureFieldInfo.SignatureBounds property to specify the signature location. If the SignatureBounds property is not specified, the signature is not visible.

The PDF Document API supports the signature image data in the following formats:

  • BMP;
  • JPEG;
  • PNG;
  • EMF+
  • TIFF;
  • GIF.

If the signature image is not provided, the signature is transparent.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SetImageData(Byte[]) method.

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.

pdf-document-api-custom-signer/CS/CustomSigner/Program.cs#L30

csharp
//Specify the image and signer information:
signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("signature.jpg"));
signatureBuilder.Location = "LOCATION";

pdf-document-api-custom-tsa-client/CS/CustomTsaClient/Program.cs#L27

csharp
//Specify image data and signer information:
signatureBuilder.SetImageData(File.ReadAllBytes("JaneCooper.jpg"));
signatureBuilder.Location = "United Kingdom";

pdf-document-api-sign-documents-with-certificate/CS/SignPDFWithHardwareCertificate/Program.cs#L59

csharp
var cooperSignature = new PdfSignatureBuilder(pkcs7Signature, signatureFieldInfo);
cooperSignature.SetImageData(System.IO.File.ReadAllBytes("JaneCooper.jpg"));

pdf-document-api-custom-signer/VB/CustomSigner/Program.vb#L30

vb
'Specify the image and signer information:
signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("signature.jpg"))
signatureBuilder.Location = "LOCATION"

pdf-document-api-custom-tsa-client/VB/CustomTsaClient/Program.vb#L25

vb
'Specify image data and signer information:
signatureBuilder.SetImageData(File.ReadAllBytes("JaneCooper.jpg"))
signatureBuilder.Location = "United Kingdom"

pdf-document-api-use-azure-key-vault-api-to-sign-document/VB/PdfAPIAzureKeyVaultSample/Program.vb#L47

vb
' Specify an image and signer information:
signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("signature.jpg"))
signatureBuilder.Location = "LOCATION"

pdf-document-api-sign-documents-with-certificate/VB/SignPDFWithHardwareCertificate/Program.vb#L46

vb
Dim cooperSignature = New PdfSignatureBuilder(pkcs7Signature, signatureFieldInfo)
cooperSignature.SetImageData(File.ReadAllBytes("JaneCooper.jpg"))
' Sign and save the document

See Also

PdfSignatureBuilder Class

PdfSignatureBuilder Members

DevExpress.Pdf Namespace