Latest release (March 2024)

The release of GroupDocs.Signature version 24.3 adds new feature and enhancement.

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
SIGNATURENET-4744โ˜… FeatureAdding HIBC LIC QR code support
SIGNATURENET-4743โ˜… FeatureImplement new QR-code Type HanXin
SIGNATURENET-4750EnhancementSupport pagination for ImageLayers format in the search process
SIGNATURENET-4679EnhancementImprove experience with multi pages TIFF document
SIGNATURENET-4757EnhancementExtend document preview generation data
SIGNATURENET-4751EnhancementRemove duplicates of GetSearchPages implementation in the SearchOptions classes
SIGNATURENET-4726๐Ÿ”ง FixFixing image acquisition in the Linux environment
SIGNATURENET-4786โ˜… FeatureImplement ability to sign the xlsm with VBA files
SIGNATURENET-4809EnhancementPDF digital signing with external digital signatures
SIGNATURENET-4853EnhancementSupporting Swiss QR Code symbology
SIGNATURENET-4818EnhancementImprove experience with multi pages Webp document
SIGNATURENET-4784EnhancementSupport signing with HIBC LIC primary and secondary data structure
SIGNATURENET-4680๐Ÿ”ง FixSigning pdf with digital signature puts evaluation watermark on output doc
SIGNATURENET-4736EnhancementEnhance Archive operations with supporting preview command
SIGNATURENET-4357EnhancementSupporting HIBC PAS QR symbology
SIGNATURENET-4977โ˜… FeatureAdd ability to create text signature in the word headers and footers
SIGNATURENET-4948EnhancementImplement new QR-code Type GS1HanXin
SIGNATURENET-4824๐Ÿ”ง FixUnreadable evaluation message for PDF signed digitally without license
SIGNATURENET-4982โ˜… FeatureAdded functionality to insert image signatures into the header or footer of Word processing documents.
SIGNATURENET-4988โ˜… FeatureAdded functionality to insert Barcode/QrCode signatures into the header or footer of Word processing documents.
SIGNATURENET-4990โ˜… FeatureAdded functionality to insert Stamp signatures into the header or footer of Word processing documents.

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.

    Signature signature = new Signature(filePath);

	// create Mailmark2D data object
	Mailmark2D mailmark2D = new Mailmark2D();
	mailmark2D.setUPUCountryID("JGB ");
	mailmark2D.setInformationTypeID("0");
	mailmark2D.setClass("1");
	mailmark2D.setSupplyChainID(123);
	mailmark2D.setItemID(1234);
	mailmark2D.setDestinationPostCodeAndDPS("QWE1");
	mailmark2D.setRTSFlag("0");
	mailmark2D.setReturnToSenderPostCode("QWE2");
	mailmark2D.setDataMatrixType(Mailmark2DType.Type_7);
	mailmark2D.setCustomerContentEncodeMode(DataMatrixEncodeMode.C40);
	mailmark2D.setCustomerContent("CUSTOM");

	// create options
	QrCodeSignOptions options = new QrCodeSignOptions();

	options.setEncodeType(QrCodeTypes.QR);
	options.setLeft(100);
	options.setTop(100);
		// setup Data property to Mailmark2D instance
	options.setData(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.

Signature signature = new Signature(sourceFilePath);
{
	// create GS1DotCode BarCode options
	BarcodeSignOptions GS1DotCodeOptions = new BarcodeSignOptions("(01)04912345123459(15)970331(30)128(10)ABC123", BarcodeTypes.GS1DotCode);
	{
		GS1DotCodeOptions.setLeft(1);
		GS1DotCodeOptions.setTop(1);
		GS1DotCodeOptions.setHeight(150);
		GS1DotCodeOptions.setWidth(200);
		GS1DotCodeOptions.setReturnContent(true);
		GS1DotCodeOptions.setReturnContentType(FileType.PNG);
	};
	// compose list of options
	List<SignOptions> listOptions = new ArrayList<SignOptions>();
	{
		listOptions.add(GS1DotCodeOptions);
	};
	// sign document to file with list of all specific QR-Codes
	SignResult signResult = signature.sign(destinFilePath, listOptions);

	System.out.print("\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;

Signature signature = new Signature(filePath);
{
	// create list of verification options
	BarcodeVerifyOptions barOptions = new BarcodeVerifyOptions();
	{
		barOptions.setText("12345");
		barOptions.setMatchType(TextMatchType.Contains);
	};
	QrCodeVerifyOptions qrOptions = new QrCodeVerifyOptions();
	{
		qrOptions.setText("12345");
		qrOptions.setMatchType(TextMatchType.Contains);
	};
	List<VerifyOptions> listOptions = new ArrayList<VerifyOptions>();
	listOptions.add(barOptions);
	listOptions.add(qrOptions);
	// Verify documents at the archive
	VerificationResult result = signature.verify(listOptions);

	// check the result
	if (result.isValid())
	{
		System.out.print("\nDocument was verified successfully!");
		System.out.print("\nList of Succeeded signatures:");
		for (BaseSignature temp : result.getSucceeded())
		{
			System.out.print(" -#{temp.SignatureId}-{temp.SignatureType} at: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}");
		}
	}
	else
	{
		System.out.print("\nDocument failed verification process.");
	}
}

Adding HIBC LIC QR code support

๐ŸŒ New class HIBCLICCombinedData has been added to support the HIBC LIC barcode Symbology. It is used by manufacturers of health care products for identification purpose. Labelers can encode Primary Data and Secondary Data.

Signature signature = new Signature(filePath);
{
	// Create HIBCLICCombinedData data object which composes Primary and Secondary data
	HIBCLICCombinedData hibclicCombinedData = new HIBCLICCombinedData();
	{
		HIBCLICPrimaryData primaryData = new HIBCLICPrimaryData();
		primaryData.setProductOrCatalogNumber("12345");
		primaryData.setLabelerIdentificationCode("A999");
		primaryData.setUnitOfMeasureID(1);

		HIBCLICSecondaryAdditionalData secondaryAdditionalData = new HIBCLICSecondaryAdditionalData();
		secondaryAdditionalData.setExpiryDate(new Date());
		secondaryAdditionalData.setExpiryDateFormat(HIBCLICDateFormat.MMDDYY);
		secondaryAdditionalData.setQuantity(30);
		secondaryAdditionalData.setLotNumber("LOT123");
		secondaryAdditionalData.setSerialNumber("SERIAL123");
		secondaryAdditionalData.setDateOfManufacture(new Date());

	};
	hibclicCombinedData.setPrimaryData(new HIBCLICPrimaryData());

	// create options
	QrCodeSignOptions options = new QrCodeSignOptions();
	{
		options.setEncodeType(QrCodeTypes.QR);
		options.setLeft(100);
		options.setTop(100);
		options.setData(hibclicCombinedData);
	};

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

//Thenw let's search qr code and get decoded typed data back
Signature signature = new Signature(outputFilePath);
{
	List<QrCodeSignature> signatures = signature.search(QrCodeSignature.class, SignatureType.QrCode);
	QrCodeSignature qrCode = signatures.get(0);
	HIBCLICCombinedData hibclicCombinedData = qrCode.getData(HIBCLICCombinedData.class);
}

Implement new QR-code Type HanXin

๐ŸŒ New property HanXin was added in the QRCodeTypes class. Han Xin Code is a two-dimensional matrix symbology that allows to encode Simplified Chinese characters.

Signature signature = new Signature(sourceFilePath);
{
	QrCodeSignOptions hanXinCodeOptions = new QrCodeSignOptions("(01)04912345123459(15)970331(30)128(10)ABC123", QrCodeTypes.HanXin);
	{
		hanXinCodeOptions.setLeft(201);
		hanXinCodeOptions.setTop(1);
		hanXinCodeOptions.setHeight(200);
		hanXinCodeOptions.setWidth(200);
		hanXinCodeOptions.setReturnContent(true);
		hanXinCodeOptions.setReturnContentType(FileType.PNG);
	};

	// compose list of options
	List<SignOptions> listOptions = new ArrayList<SignOptions>();
	listOptions.add(hanXinCodeOptions);
	
	// sign document to file with list of all specific QR-Codes
	SignResult signResult = signature.sign(destinFilePath, listOptions);

	System.out.print("\nSource document signed successfully.\nFile saved at " + destinFilePath);
}

Improve experience with multi pages TIFF document

๐ŸŒ In this release, we added the ability to work with TIFF/TIF documents as with multi pages document. It’s possible to configure PagesSetup property with list of the specific pages.

Signature signature = new Signature("multipage.tiff");
{
	QrCodeSignOptions options = new QrCodeSignOptions("Patient #36363393. R: No-Issues");
	{
		// set signature position
		options.setLeft(10);
		options.setTop(10);
		// set signature rectangle
		options.setWidth(200);
		options.setHeight(200);
		//specify pages numbers which we want to sign
		PagesSetup pageSetup = new PagesSetup();
		pageSetup.setPageNumbers(Arrays.asList(1,3));

		options.setPagesSetup(pageSetup);
	};

	// sign document to file
	SignResult signResult = signature.sign(outputFilePath, options);
	System.out.print("\nDocument signed with {signResult.Succeeded.Count} signatures");
	System.out.print("\nList of newly created signatures:");
	for (BaseSignature temp : signResult.getSucceeded())
	{
		System.out.print("{temp.SignatureType} at page #{temp.PageNumber}: Id:{temp.SignatureId}.");
	}
}

Implement ability to sign the xlsm with VBA files

๐ŸŒ In response to your feedback, we’ve implemented the ability to sign xlsm files containing VBA macros. Now, you can seamlessly sign your xlsm documents with VBA files for added security and compliance. New class DigitalVBA has been added to support signing VBA macroses.

Signature signature = new Signature(excelFilePath);
{
	DigitalSignOptions signOptions = new DigitalSignOptions();
	//Add extension for signing VBA project digitally
	DigitalVBA digitalVBA = new DigitalVBA(certificatePath, password);
	//Set to true only for signing VBA project
	digitalVBA.setSignOnlyVBAProject(true);
	digitalVBA.setComments("VBA Comment");
	signOptions.getExtensions().add(digitalVBA);

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

PDF digital signing with external digital signatures

We understand the importance of digital signatures in PDF documents. In this release, we’ve introduced support for signing PDFs with external digital signatures, making it easier to verify the authenticity and integrity of your PDF files. It supports usb smartcards, tokens without exportable private keys.

Supporting Swiss QR Code symbology

๐ŸŒ To meet the specific needs of our Swiss users, we’ve added support for the Swiss QR Code symbology. Now you can generate and process Swiss QR Codes with ease, ensuring compatibility with the latest standards. New class SwissQR has been added, which allows to configure QR properties.

Signature signature = new Signature(filePath);
{
	SwissQR data = new SwissQR();
	{
		data.setAccount("CH4431999123000889012");
		data.setAmount(1000.25);
		data.setCurrency("CHF");
		data.setReference("210000000003139471430009017");

		SwissAddress creditor = new SwissAddress();            
		creditor.setName("Muster & Sรถhne");
		creditor.setStreet("Musterstrasse");
		creditor.setHouseNo("12b");
		creditor.setPostalCode("8200");
		creditor.setTown("Zรผrich");
		creditor.setCountryCode("CH");            

		SwissAddress debtor = new SwissAddress();            
		debtor.setName("Muster AG");
		debtor.setStreet("Musterstrasse");
		debtor.setHouseNo("1");
		debtor.setPostalCode("3030");
		debtor.setTown("Bern");
		debtor.setCountryCode("CH");
	
		data.setCreditor(creditor);
		data.setDebtor(debtor);
	};

	// create options
	QrCodeSignOptions options = new QrCodeSignOptions();            
	options.setEncodeType(QrCodeTypes.QR);
	options.setLeft(100);
	options.setTop(100);
	options.setData(data);            

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

//Thenw let's search qr code and get decoded typed data back
Signature signature = new Signature(outputFilePath);
{
	List<QrCodeSignature> signatures = signature.search(QrCodeSignature.class, SignatureType.QrCode);
	QrCodeSignature qrCode = signatures.get(0);
	SwissQR swissData = qrCode.getData(SwissQR.class);
}

Improve experience with multi pages Webp document

๐ŸŒ Your experience with multi-page WebP documents has been significantly enhanced. From now it’s possible to sign specific pages in the WebP document.

Signature signature = new Signature("multipage.webp");
{
	QrCodeSignOptions options = new QrCodeSignOptions("Patient #363633103. R: No-Issues");
	
	// set signature position
	options.setLeft(10);
	options.setTop(10);
	// set signature rectangle
	options.setWidth(200);
	options.setHeight(200);
	//specify pages numbers which we want to sign
	PagesSetup pagesSetup = new PagesSetup();            
	pagesSetup.setPageNumbers(Arrays.asList(1,3));
	options.setPagesSetup(pagesSetup);                       

	// sign document to file
	SignResult signResult = signature.sign(outputFilePath, options);
	System.out.print("\nDocument signed with {signResult.Succeeded.Count} signatures");
	System.out.print("\nList of newly created signatures:");
	for (BaseSignature temp : signResult.getSucceeded())
	{
		System.out.print("{temp.SignatureType} at page #{temp.PageNumber}: Id:{temp.SignatureId}.");
	}
}

Support signing with HIBC LIC primary and secondary data structure

๐ŸŒ Ability to sign with HIBC LIC barcode Symbology using primary and secondary data separately

Signature signature = new Signature(filePath);
{
	// Create HIBCLIC Secondary data
	HIBCLICSecondaryAdditionalData data = new HIBCLICSecondaryAdditionalData();
	{
		data.setExpiryDate( new Date());
		data.setExpiryDateFormat(HIBCLICDateFormat.MMDDYY);
		data.setQuantity(30);
		data.setLotNumber("LOT123");
		data.setSerialNumber("SERIAL123");
		data.setDateOfManufacture(new Date());
	};

	// create options
	QrCodeSignOptions options = new QrCodeSignOptions();
	{
		options.setEncodeType(QrCodeTypes.QR);
		options.setLeft(100);
		options.setTop(100);
		options.setData(data);
	};

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

//Thenw let's search qr code and get decoded typed data back
Signature signature = new Signature(outputFilePath);
{
	List<QrCodeSignature> signatures = signature.search(QrCodeSignature.class, SignatureType.QrCode);
	QrCodeSignature qrCode = signatures.get(0);
	HIBCLICSecondaryAdditionalData data = qrCode.getData(HIBCLICSecondaryAdditionalData.class);
}

Signing pdf with digital signature puts evaluation watermark on output doc

๐ŸŒ We’ve addressed a bug where signing PDF documents with digital signatures would inadvertently result in an evaluation watermark appearing on the output document. This issue has been resolved, ensuring that your signed documents remain professional and watermark-free.

Enhance Archive operations with supporting preview command

๐ŸŒ We’ve added a new PageDataStreamFactory interface to allow you to preview pages of documents or archives. The createPageDataStream method of this interface supports the new PreviewPageData type. This class contains not only pageNumber, but also filename and image preview format. This cutting-edge feature is designed to provide users with a seamless and insightful preview experience while interacting with archived documents.


Signature signature = new Signature(filePath);
PreviewOptions options = new PreviewOptions(new PageDataStreamFactory() {
	@Override
	public OutputStream createPageDataStream(PreviewPageData pageData) {
		return pageStreamArchive(pageData);
	}

	@Override
	public void closePageDataStream(PreviewPageData pageData, OutputStream pageStream) {
		releaseStreamArchive(pageData, pageStream);
	}
});

options.setPreviewFormat(PreviewFormats.JPEG);
signature.generatePreview(options);

private OutputStream pageStreamArchive(PreviewPageData pageData)
{
	try {

		String filePath = getOutputFilePath("New_"+Path.getFileName(this.getFilePath())+"\\"+pageData.getFileName()+"_p"+pageData.getPageNumber()+"."+PreviewFormats.toExtension(pageData.getPreviewFormat()), OutputFolder);
		return  new FileOutputStream(filePath);
	} catch (Exception e){
		throw new GroupDocsException(e.getMessage());
	}


}
private void releaseStreamArchive(PreviewPageData pageData, OutputStream pageStream)
{
	try {
		pageStream.close();
	}catch (Exception e){
		throw new GroupDocsException(e.getMessage());
	}
}

Supporting HIBC PAS QR symbology

๐ŸŒ Elevate healthcare processes with HIBC PAS QR symbology support, designed specifically to meet the stringent requirements of the healthcare industry. Ensure precision and accuracy in encoding and decoding critical data related to prescriptions and healthcare information. New class HIBCPASData has been added, which allows to configure QR properties.

 using (Signature signature = new Signature(filePath))
{
    var data = new HIBCPASData()
    {
        DataLocation = HIBCPASDataLocation.Patient,
    };

    data.AddRecord(HIBCPASDataType.LabelerIdentificationCode, "A123");
    data.AddRecord(HIBCPASDataType.ManufacturerSerialNumber, "SERIAL123");

    // create options
    QrCodeSignOptions options = new QrCodeSignOptions
    {
        EncodeType = QrCodeTypes.QR,
        Left = 110,
        Top = 110,
        Data = data
    };

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

//Thenw let's search qr code and get decoded typed data back
using (Signature.Signature signature = new Signature.Signature(outputFilePath))
{
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
    QrCodeSignature qrCode = signatures.FirstOrDefault();
    var data = qrCode.GetData<HIBCPASData>();
}

Add ability to create text signature in the word headers and footers

๐ŸŒ We are thrilled to unveil an exciting enhancementโ€” the addition of a text signature feature in the Word document headers and footers. Now, users can easily create and customize text signatures directly within the headers and footers of their Word documents. New enum ShapePosition has been added, which defines appropriate signature location in the document layout. It can be configured through the new property ShapePosition in the TextSignOptions.

// Sign document with text signature.
Signature signature = new Signature("sample.docx");
{
	List<SignOptions> listOptions = new ArrayList<SignOptions>();

	TextSignOptions headerSign = new TextSignOptions("Hello header!");
	headerSign.setShapePosition(ShapePosition.Header);

	TextSignOptions footerSign = new TextSignOptions("Hello footer!");
	footerSign.setShapePosition(ShapePosition.Footer);            

	listOptions.add(headerSign);
	listOptions.add(footerSign);

	signature.sign(outputFilePath, listOptions);
}

๐ŸŒ We are thrilled to unveil an exciting enhancementโ€” the addition of a image signature feature in the Word document headers and footers. Now, users can easily create and customize image signatures directly within the headers and footers of their Word documents.

 // Sign document with Image signature.
Signature signature = new Signature("sample.docx");
{
	ImageSignOptions options = new ImageSignOptions("signature.jpg");
	{
		// set signature position
		options.setLeft(100);
		options.setTop(100);
		options.setAllPages(true);
		options.setShapePosition(ShapePosition.Header);
	};
	signature.sign("SampleSigned.docx", options);
}

๐ŸŒ We are thrilled to unveil an exciting enhancementโ€” the addition of a Barcode/QrCode signature feature in the Word document headers and footers. Now, users can easily create and customize Barcode/QrCode signatures directly within the headers and footers of their Word documents.

// Sign document with QrCode signature.
Signature signature = new Signature("sample.docx");
{
	// create QRCode option with predefined QRCode text
	QrCodeSignOptions options = new QrCodeSignOptions("JohnSmith");
	{
		// setup QRCode encoding type
		options.setEncodeType(QrCodeTypes.QR);
		// set signature position
		options.setLeft(100);
		options.setTop(100);
		options.setShapePosition(ShapePosition.Header);
	};

	signature.sign("SampleSigned.docx", options);
}

๐ŸŒ We are thrilled to unveil an exciting enhancementโ€” the addition of a Stamp signature feature in the Word document headers and footers. Now, users can easily create and customize Stamp signatures directly within the headers and footers of their Word documents.

// Sign document with Stamp signature.
Signature signature = new Signature("sample.docx");
{
	StampSignOptions options = new StampSignOptions();
	{
		// set stamp signature position
		options.setLeft(100);
		options.setTop(100);
		options.setShapePosition(ShapePosition.Header);
	};
	// setup first external line of Stamp
	StampLine outerLine = new StampLine();
	outerLine.setText(" * European Union * European Union  * European Union  *");            
	outerLine.setHeight(22);
	outerLine.setTextBottomIntent(6);
	outerLine.setTextColor(Color.darkGray);
	outerLine.setBackgroundColor(Color.cyan);
	options.getOuterLines().add(outerLine);

	//Inner square lines - horizontal lines inside the rings
	StampLine innerLine = new StampLine();
	innerLine.setText("John");
	innerLine.setTextColor(Color.magenta);           
	innerLine.getFont().setBold(true);
	innerLine.setHeight(40);
	options.getInnerLines().add(innerLine);

	signature.sign("SampleSigned.docx", options);
}

Reorganization of some classes

๐ŸŒ We’ve moved the SignatureExtension, SpreadsheetPosition and TextShadow classes to the new namespace com.groupdocs.signature.domain.extensions.signoptions.