facebooktwittermenuarrow-up

GemBox Support Forum

Add image to PDF Signature appearance? Change text color?

Hello,

I try GemBox.Pdf to digitally sign pdfs.
I get it worked using a Belgian electronic ID Card (pkcs11) thanks to your digital signatures example.

But I’m missing 2 things:

  1. I didn’t find a way to add an image to the signature field appearance. Is it possible?
  2. I want to customize the text color on the signature field, is there a way to do it?

Thanks
Whiletrue

Hi Whiletrue,

Regarding the text color, please try using this latest version from our BugFixes page or NuGet.

We have added the PdfSignatureAppearance.FontColor property, you can use it like this:

PdfSignatureField signatureField = ...

// Get signature appearance settings.
PdfSignatureAppearance signatureAppearance = signatureField.Appearance;

// Set font family to "Times New Roman".
signatureAppearance.FontFamily = new PdfFontFamily("Times New Roman");

// Set font color to red.
signatureAppearance.FontColor = PdfColor.FromRgb(1, 0, 0);

// ...

Regarding the signature image, GemBox.Pdf currently doesn’t provide an easy-to-use API for adding images.
But note that we’re working on this, this feature should be available in the near future (within a month or two).

For now as a workaround, I could provide you a solution that uses GemBox.Document to create any kind of visual appearance that you want (both text and image) which you would then add to a signature field using GemBox.Pdf.
Let me know if you’re interested in this.

Regards,
Mario