GroupDocs.Signature for .NET 23.8 Release Notes

In this release, we introduce support of the Royal Mail Mailmark 2D barcode, which has been developed to encode postal and shipping information, and also support of two-dimensional GS1 DotCode. Additionaly there are some enhancements in this release.

Full list of changes in this release

KeyCategorySummary
SIGNATURENET-3882★ FeatureImplement MailMark as new QR type Embedded Object
SIGNATURENET-4657★ FeatureImplement new Barcode Type GS1DotCode
SIGNATURENET-4650EnhancementEnhanse Archive operations with supporting verify command
SIGNATURENET-4671EnhancementUpdate deprecated System.Drawing.Common to version 6
SIGNATURENET-4685EnhancementRemove duplicated GetSignPages implementation

Major Features

This release includes two new barcode format features and one archive enhancement:

Implement MailMark as new QR type Embedded Object

🌐 New class Mailmark2D has been added to support the Royal Mail Mailmark 2D barcode standard.

 using (Signature signature = new Signature(filePath))
{
    // create Mailmark2D data object
    Mailmark2D mailmark2D = new Mailmark2D()
    {
        UPUCountryID = "JGB ",
        InformationTypeID = "0",
        Class = "1",
        SupplyChainID = 123,
        ItemID = 1234,
        DestinationPostCodeAndDPS = "QWE1",
        RTSFlag = "0",
        ReturnToSenderPostCode = "QWE2",
        DataMatrixType = Mailmark2DType.Type_7,
        CustomerContentEncodeMode = DataMatrixEncodeMode.C40,
        CustomerContent = "CUSTOM"
    };

    // create options
    QrCodeSignOptions options = new QrCodeSignOptions
    {
        EncodeType = QrCodeTypes.QR,
        Left = 100,
        Top = 100,
        // setup Data property to Mailmark2D instance
        Data = mailmark2D
    };

    // sign document to file
    signature.Sign(outputFilePath, options);
}

Implement new Barcode Type GS1DotCode

🌐 New property GS1DotCode was added in the BarcodeTypes class. GS1 DotCode is a two-dimensional (2D) matrix symbology that can carry all GS1 keys and attributes. It can be applied to hold trade item information such as the item expiry date, serial number or batch/lot number.

 using (Signature signature = new Signature(sourceFilePath))
{
    // create GS1DotCode BarCode options
    var GS1DotCodeOptions = new BarcodeSignOptions("(01)04912345123459(15)970331(30)128(10)ABC123", BarcodeTypes.GS1DotCode)
    {
        Left = 1,
        Top = 1,
        Height = 150,
        Width = 200,
        ReturnContent = true,
        ReturnContentType = FileType.PNG
    };
    // compose list of options
    var listOptions = new List<SignOptions>()
    {
        GS1DotCodeOptions
    };
    // sign document to file with list of all specific QR-Codes
    var signResult = signature.Sign(destinFilePath, listOptions);

    Console.WriteLine("\nSource document signed successfully.\nFile saved at " + destinFilePath);
}

Enhanse Archive operations with supporting verify command

🌐 In this release, we added ability to verify signatures in the archive documents.

// The path to the archive with signed documents
string filePath = Constants.SAMPLE_SIGNED_7Z;

using (Signature signature = new Signature(filePath))
{
    // create list of verification options
    BarcodeVerifyOptions barOptions = new BarcodeVerifyOptions()
    {
        Text = "12345",
        MatchType = TextMatchType.Contains
    };
    QrCodeVerifyOptions qrOptions = new QrCodeVerifyOptions()
    {
        Text = "12345",
        MatchType = TextMatchType.Contains
    };
    List<VerifyOptions> listOptions = new List<VerifyOptions>() { barOptions, qrOptions };

    // Verify documents at the archive
    VerificationResult result = signature.Verify(listOptions);

    // check the result                
    if (result.IsValid)
    {
        Console.WriteLine("\nDocument was verified successfully!");
        Console.WriteLine("\nList of Succeeded signatures:");
        foreach (BaseSignature temp in result.Succeeded)
        {
            Console.WriteLine($" -#{temp.SignatureId}-{temp.SignatureType} at: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}");
        }
    }
    else
    {
        Helper.WriteError("\nDocument failed verification process.");
    }
}