GroupDocs.Signature for Java 23.6 Release Notes

There are 25+ features, enhancements, and bug fixes in this release.

Full list of changes in this release

KeyCategorySummary
SIGNATURENET-4257FeatureImplement support of Succeeded Signature list for Verification Result
SIGNATURENET-4255FeatureImplement new Barcode Type HIBC LIC 39/128 (HIBCCode39LIC, HIBCCode128LIC)
SIGNATURENET-4254FeatureImplement new QR-Code Types HIBC LIC QR
SIGNATURENET-4223FeatureImplement Verification of Certificate documents
SIGNATURENET-4317FixSigned PDF Documents saved under .NET Core are not opening with the native Adobe Acrobat Reader
SIGNATURENET-4316FixPDF Documents saved under non-licensed mode are unable to be digitally signed
SIGNATURENET-4315FixError on signing PDF Document with Digital signature and specific certificate properties
SIGNATURENET-4314FixPDF documents metadata items do not detect data type on loading
SIGNATURENET-4313FixLoading of special JPEG images raises the StackOverflowException exception
SIGNATURENET-4312FixThe exception occurs when signing Spreadsheet documents with specific X509 .pfx certificates
SIGNATURENET-4311FixUnexpected response image when rendering .ods file
SIGNATURENET-4310FixException is thrown when processing image preview with .ods file
SIGNATURENET-4309FixGS1CompositeBar barcodes are not recognized with full original text
SIGNATURENET-4303FixProcessing time may be equal to zero for some cases under Net4.0 framework
SIGNATURENET-4281FixMailmark Barcode type default value throws an exception
SIGNATURENET-4387FeatureImplement support of AZW3 File Type
SIGNATURENET-4553FeatureAdded HIBC PAS QR Codes QR, Aztec and DataMatrix
SIGNATURENET-4551FeatureAdded HIBC PASCode39 and PASCode128 Barcodes
SIGNATURENET-4413EnhancementImplement AZW3 as new export save file format for Word Processing documents
SIGNATURENET-4417EnhancementMigrate product from .NET 40 to NET 462 frameworks
SIGNATURENET-4428EnhancementReplace DateTime Now values with the Universal format UTC-now
SIGNATURENET-4428FixThe exception is thrown when .ps document is being opened
SIGNATURENET-4314FixException with UTC DateTime format with Digital PDF signatures
SIGNATURENET-4313FixImplicit using of third party Org.BouncyCastle in referenced libraries
SIGNATURENET-4312FixFixed issue with casting object types on Open Office documents
SIGNATURENET-4369★ FeatureImplement support of ZIP File Type
SIGNATURENET-4442★ FeatureImplement support of TAR File Type
SIGNATURENET-4479★ FeatureImplement Document Info for archives
SIGNATURENET-4476✜ EnhancementSupport Succeeded and Failed list as result of processing archives
SIGNATURENET-4374🔧 FixError on signing Wordprocessing documents digitally with Linux generated certificates
SIGNATURENET-4373🔧 FixException on processing Spreadsheets file with Digital signatures with non Win-OS certificates
SIGNATURENET-4203🔧 FixSome tests for PDF throw “Invalid provider type specified” exception
SIGNATURENET-4169🔧 FixSome files couldn’t be processed with curent version of the product

Major Features

This release includes three features and one enhancement:

Implement support for Succedded list of Verification Result

VerificationResult now supports the list of the getSucceeded() verified signatures.

/**
 * Verify document and list Succeded signatures
 */
Signature signature = new Signature("sample.pdf");
{
    BarcodeVerifyOptions options = new BarcodeVerifyOptions();
    options.setText("12345");
    options.setMatchType(TextMatchType.Contains);
    // verify document signatures
    VerificationResult result = signature.verify(options);
    if (result.isValid())
    {
        System.out.print("\nDocument was verified successfully!");
        System.out.print("\nList of Succeded sigantures:");
        for(BaseSignature temp : result.getSucceeded())
       {
            System.out.print(" -#"+temp.getSignatureId()+"-"+temp.getSignatureType()+" at: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight());
        }
    }
    else
    {
        System.out.print("\nDocument failed verification process.");
    }
}

Implement Verification of Certificate documents

New CertificateVerifyOptions class contains different properties of the digital certificate file to validate over the verify method.

LoadOptions loadOptions = new LoadOptions();
{
    loadOptions.setPassword("1234567890");
};
Signature signature = new Signature("certificate.pfx", loadOptions);
{
    CertificateVerifyOptions options = new CertificateVerifyOptions();
    {
        // do not provide X.509 chain validation
        options.setPerformChainValidation(false);
        // find exact math
        options.setMatchType(TextMatchType.Exact);
        // check the serial number
        options.setSerialNumber("00AAD0D15C628A13C7");
    };

    // verify certificate
    VerificationResult result = signature.verify(options);
    if (result.isValid())
    {
        System.out.print("\nCertificate was verified successfully!");
    }
    else
    {
        System.out.print("\nCertificate failed verification process.");
    }
}

Implement support of AZW3 File Type

FileTypes was extended with new AZW3 supported file type.

/**
 * Sign azw3 file type
 */
Signature signature = new Signature("sample.azw3");
{
    // create sign options
    TextSignOptions options = new TextSignOptions("signed!")
    {
        // set signature position
        options.setLeft(100);
        options.setTop(100);
    };
    // sign document to file
    SignResult result = signature.sign("output.azw3", options);
}

Added HIBC PAS QR Codes QR, Aztec and DataMatrix

QRCodeTypes static class was updated with new types to support HIBC PAS QR.

 /**
 * <p>
 * HIBC PAS QR-Code Type object.
 * </p>
 */
public static final QrCodeType HIBCPASQR;

/**
 * <p>
 * HIBC PAS Data Matrix QR-Code Type object.
 * </p>
 */
public static final QrCodeType HIBCPASDataMatrix;

/**
 * <p>
 * HIBC PAS Aztec QR-Code Type object.
 * </p>
 */
public static final QrCodeType HIBCPASAztec;
Signature signature = new Signature("sample.pdf"");
{
    // create barcode option with predefined QR-Code text that follow HIBC LIC standard
    QrCodeSignOptions options = new QrCodeSignOptions("A123PROD30917/75#422011907#GP293");
    {
        // setup Barcode encoding type
        options.setEncodeType(QrCodeTypes.HIBCPASQR);
        // set signature position
        options.setLeft(100);
        options.setTop(100);
    };
    // sign document to file
    SignResult result = signature.sign("output.pdf", options);
}

Added HIBC PASCode39 and PASCode128 Barcodes

BarcodeTypes static class was updated with new types to support HIBC PAS Barcodes.

 /**
 * <p>
 * HIBC PAS 39 Barcode Type object.
 * </p>
 */
public static final BarcodeType HIBCCode39PAS;

/**
 * <p>
 * HIBC PAS 128 Barcode Type object.
 * </p>
 */
public static final BarcodeType HIBCCode128PAS;
Signature signature = new Signature("sample.pdf"");
{
    // create barcode option with predefined barcode text that follow HIBC PAS standard
    BarcodeSignOptions options = new BarcodeSignOptions("+A99912345/$$52001510X3");
    {
        // setup Barcode encoding type
        options.setEncodeType(BarcodeTypes.HIBCCode39PAS);
        // set signature position
        options.setLeft(100);
        options.setTop(100);
    };
    // sign document to file
    SignResult result = signature.sign(outputFilePath, options);
}

Implement AZW3 as new export save file format for Word Processing documents

WordProcessingSaveOptions was updated with new types to support AZW3 save file format File Format.

Signature signature = new Signature("sample.docx");
{
    // create QRCode option with predefined QRCode text
    TextSignOptions signOptions = new TextSignOptions("JohnSmith")
    {
        // set signature position
    signOptions.setLeft(100);
    signOptions.setTop(100);
    };

    WordProcessingSaveOptions saveOptions = new WordProcessingSaveOptions()
    {
        saveOptions.setFileFormat(WordProcessingSaveFileFormat.Azw3);
        saveOptions.setOverwriteExistingFiles(true);
    };
    // sign document to file
    SignResult result = signature.sign("output.azw3", signOptions, saveOptions);
}

Implement support of ZIP File Type

🌐 New class DocumentResultSignature was added to describe the processed document within the archive file. This class extends BaseSignature and implements IResult interface as container of the process (sign, verify, search) over this particular document. See example below. 🌐 FileTypes was extended with new ZIP supported file type.

/**
 * <p>
 Get ZIP file and sign all documents within the archive
 * </p>
 */
Signature signature = new Signature("sample.zip");
{
    // create sign options
    TextSignOptions options = new TextSignOptions("signed!");
    {
        // set signature position
        options.setLeft(100);
        options.setTop(100);
    };
    // sign archive to new zip file
    SignResult result = signature.sign("output.zip", options);
    // analyze signed documents
    int number = 1;
    for (BaseSignature o : signResult.getSucceeded())
    {
        DocumentResultSignature document = (DocumentResultSignature)o;
        System.out.print("Document #"+ number++ +": "+document.getFileName()+". Processed: "+document.getProcessingTime()+", mls");
    }
}

Implement support of TAR File Type

🌐 FileTypes was extended with new TAR supported file type.

/**
 * <p>
 * Get TAR file and sign all documents within the archive
 * </p>
 */
Signature signature = new Signature("sample.tar");
{
    // create list of signature options
    BarcodeSignOptions bcOptions1 = new BarcodeSignOptions("12345678", BarcodeTypes.Code128);
    bcOptions1.setLeft(100);
    bcOptions1.setTop(100);

    QrCodeSignOptions qrOptions2 = new QrCodeSignOptions("12345678", QrCodeTypes.QR);
    qrOptions2.setLeft(400);
    qrOptions2.setTop(400);

    List<SignOptions> listOptions = new ArrayList<SignOptions>();
    listOptions.add(bcOptions1);
    listOptions.add(qrOptions2);
    // sign document to file
    SignResult signResult = signature.sign(outputFilePath, listOptions);
    // analyze signed documents
    System.out.print("\nList of successfully signed documents:");
    int number = 1;
    for (BaseSignature o : signResult.getSucceeded())
    {
        DocumentResultSignature document = (DocumentResultSignature)o;
        System.out.print("Document #"+number++ +": "+document.getFileName()+". Processed: "+document.getProcessingTime()+", mls");
    }
}

Implement Document Info for archives

🌐 Class DocumentInfo was extended with the new property getDocuments() to represent the list of the document info with the archives.

/**
 * <p>
 * Get zip file and obtain documents information with the archive 
 * </p>
 */
Signature signature = new Signature("sample.zip");
{
    IDocumentInfo documentInfo = signature.getDocumentInfo();
    System.out.print("Archive properties "+ Path.getFileName(archivePath)+":");
    System.out.print(" - format : "+documentInfo.getFileType().getFileFormat());
    System.out.print(" - extension : "+documentInfo.getFileType().getExtension());
    System.out.print(" - size : "+documentInfo.getSize());
    System.out.print(" - documents count : "+documentInfo.getPageCount());

    // display each document information
    System.out.print("Documents information:");
    for (DocumentResultSignature document : documentInfo.getDocuments())
    {
        System.out.print(" - Document: "+document.getFileName()+" Size: "+document.getSourceDocumentSize()+" archive-size: "+document.getDestinDocumentSize());
    }
}

Support Succeeded and Failed list as result of processing archives

🌐 The SignResult will keep the list of succeeded and failed DocumentResultSignature elements in the result of the Sign method.

/**
 * Support Succeeded and Failed list as result of processing archives
 */
Signature signature = new Signature("sample.zip");
{
    // create sign options
    TextSignOptions options = new TextSignOptions("signed!");
    {
        // set signature position
        options.setLeft(100);
        options.setTop(100);
    };
    // sign archive to new zip file
    SignResult result = signature.sign("output.zip", options);
    // analyze signed documents
    int number = 1;
    for (BaseSignature o : signResult.getSucceeded())
    {
        DocumentResultSignature document = (DocumentResultSignature)o;
        System.out.print("Document #"+ number++ +": "+document.getFileName()+". Processed: "+document.getProcessingTime()+", mls");
    }
    if (signResult.getFailed().size() > 0)
    {
        System.out.print("\nList of failed documents:");
        number = 1;
        for (BaseSignature o : signResult.getFailed())
        {
            DocumentResultSignature document = (DocumentResultSignature)o;
            System.out.print("Document #"+number++ +": "+document.getFileName()+". Processed: "+document.getProcessingTime()+", mls");
        }
    }
}