GroupDocs.Signature for .NET 20.10 Release Notes

Major Features

There are eight important new features, improvements and important bug fixes in this release. New features are related to customization of PDF digital signatures on document pages and allow to adjust signature appearance. Below the list of most notable changes in release of GroupDocs.Signature for .NET 20.10:

  • Introduced extended customization of PDF Digital signatures appearance.
  • Implemented ability to apply signature extensions to Digital Signatures.
  • Fixed bug with restoring signatures metadata from signed image documents.
  • Bug fixes.

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
SIGNATURENET-3136Improve PDF Digital Appearance implementation to support all image related extensionsFeature
SIGNATURENET-3104Implement CustomAppearance property for PDF Digital SignatureFeature
SIGNATURENET-3127Improve processing nullable Font properties entire options with default valuesImprovement
SIGNATURENET-3133Exception Specified cast is not valid when processing signed image documentsBug
SIGNATURENET-3131Incorrect Page count when obtaining .Odt documents format informationBug
SIGNATURENET-3130Null reference exception occurs for applying Text signature options with nullable Font propertyBug
SIGNATURENET-3128This file type is not supportedBug
SIGNATURENET-2971Word-processing blank document preview doesn’t contain trial messageBug

Public API and Backward Incompatible Changes

New class PdfDigitalSignatureAppearance was added with several properties that allow to customize appearance of digital sigantures on the PDF Document pages.

New class PdfDigitalSignatureAppearance contains follow properties.

New class PdfDigitalSignatureAppearance

public sealed class PdfDigitalSignatureAppearance : SignatureAppearance
{
    /// <summary>
    /// Gets or sets contact info label. Default value: "Contact".
    /// if this value is empty then no contact label will appear on digital signature area.
    /// </summary>
    public string ContactInfoLabel { get; set; }

    /// <summary>
    /// Gets or sets reason label. Default value: "Reason".
    /// if this value is empty then no reason label will appear on digital signature area.
    /// </summary>
    public string ReasonLabel { get; set; }

    /// <summary>
    /// Gets or sets location label. Default value: "Location".
    /// if this value is empty then no location label will appear on digital signature area.
    /// </summary>
    public string LocationLabel { get; set; }

    /// <summary>
    /// Gets or sets digital signed label. Default value: "Digitally signed by".
    /// </summary>
    public string DigitalSignedLabel { get; set; }

    /// <summary>
    /// Gets or sets date signed label. Default value: "Date".
    /// </summary>
    public string DateSignedAtLabel { get; set; }

    /// <summary>
    /// Get or set background color of signature appearance.
    /// By default the value is SystemColors.Windows
    /// </summary>
    public Color Background { get; set; }

    /// <summary>
    /// Creates signature appearance object with default values.
    /// </summary>
    public PdfDigitalSignatureAppearance();
}

Following example shows how to sign PDF Document with customization of Digital signature appearance on the page.

// initialize Signature instance
using (Signature signature = new Signature("sample.pdf"))
{
    DigitalSignOptions options = new DigitalSignOptions("certificate.pfx")
    {
        // certificate password
        Password = "1234567890",
        // digital certificate details
        Reason = "Approved",
        Location = "New York",

        // apply custom PDF signature appearance
        Appearance = new PdfDigitalSignatureAppearance()
        {
            // do now show contact details
            ContactInfoLabel = string.Empty,
            // simplify reason label
            ReasonLabel = "?",
            // change location label
            LocationLabel = "From",
            DigitalSignedLabel = "By",
            DateSignedAtLabel = "On",
            // apply custom appearance color
            Background = Color.Red
        },
        AllPages = true,
        Width = 160,
        Height = 80,
        // setup signature border
        Border = new Border()
        {
            Visible = true,
            Color = Color.Red,
            DashStyle = DashStyle.DashDot,
            Weight = 2
        }
    };
    SignResult signResult = signature.Sign("signed.pdf", options);
}