GroupDocs.Signature for .NET 23.9 Release Notes
In this release, we introduce supporting of the HIBC LIC barcode Symbology and two-dimensional Han Xin Code. Additionaly there are some enhancements in this release.
Full list of changes in this release
Key | Category | Summary |
---|---|---|
SIGNATURENET-4744 | ★ Feature | Adding HIBC LIC QR code support |
SIGNATURENET-4743 | ★ Feature | Implement new QR-code Type HanXin |
SIGNATURENET-4750 | Enhancement | Support pagination for ImageLayers format in the search process |
SIGNATURENET-4679 | Enhancement | Improve experience with multi pages TIFF document |
SIGNATURENET-4757 | Enhancement | Extend document preview generation data |
SIGNATURENET-4751 | Enhancement | Remove duplicates of GetSearchPages implementation in the SearchOptions classes |
SIGNATURENET-4726 | 🔧 Fix | Fixing image acquisition in the Linux environment |
Major Features
This release includes two new barcode format features, numerous enhancements, and several bug fixes:
- Adding HIBC LIC QR code support
- Implement new QR-code Type HanXin
- Improve experience with multi pages TIFF document
- Extend document preview generation data
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.
using (Signature signature = new Signature(filePath))
{
// Create HIBCLICCombinedData data object which composes Primary and Secondary data
var hibclicCombinedData = new HIBCLICCombinedData()
{
PrimaryData = new HIBCLICPrimaryData()
{
ProductOrCatalogNumber = "12345",
LabelerIdentificationCode = "A999",
UnitOfMeasureID = 1
},
SecondaryAdditionalData = new HIBCLICSecondaryAdditionalData()
{
ExpiryDate = DateTime.Today,
ExpiryDateFormat = HIBCLICDateFormat.MMDDYY,
Quantity = 30,
LotNumber = "LOT123",
SerialNumber = "SERIAL123",
DateOfManufacture = DateTime.Today
}
};
// create options
QrCodeSignOptions options = new QrCodeSignOptions
{
EncodeType = QrCodeTypes.QR,
Left = 100,
Top = 100,
Data = hibclicCombinedData
};
// 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 hibclicCombinedData = qrCode.GetData<HIBCLICCombinedData>();
}
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.
using (Signature signature = new Signature(sourceFilePath))
{
var hanXinCodeOptions = new QrCodeSignOptions("(01)04912345123459(15)970331(30)128(10)ABC123", QrCodeTypes.HanXin)
{
Left = 201,
Top = 1,
Height = 200,
Width = 200,
ReturnContent = true,
ReturnContentType = FileType.PNG
};
// compose list of options
var listOptions = new List<SignOptions>()
{
hanXinCodeOptions
};
// 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);
}
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.
using (var signature = new Signature("multipage.tiff"))
{
var options = new QrCodeSignOptions("Patient #36363393. R: No-Issues")
{
// set signature position
Left = 10,
Top = 10,
// set signature rectangle
Width = 200,
Height = 200,
//specify pages numbers which we want to sign
PagesSetup = new PagesSetup()
{
PageNumbers = new List<int> { 1, 3 }
}
};
// sign document to file
SignResult signResult = signature.Sign(outputFilePath, options);
Console.WriteLine($"\nDocument signed with {signResult.Succeeded.Count} signatures");
Console.WriteLine("\nList of newly created signatures:");
foreach (BaseSignature temp in signResult.Succeeded)
{
Console.WriteLine($"{temp.SignatureType} at page #{temp.PageNumber}: Id:{temp.SignatureId}.");
}
}
Extend document preview generation data
🌐 We marked delegates CreatePageStream and ReleasePageStream from the class PreviewOptions as obsolete. Instead of them there are 2 new delegates CreateDocPageStream and ReleaseDocPageStream which support new type PreviewPageData. This class contains not only pageNumber, but also filename and image preview format.
//sample of declaring delegate which returns stream
private Stream CreateDocPageStream(PreviewPageData pageData)
{
var fileName = $"{pageData.FileName}{pageData.PageNumber}.{pageData.PreviewFormat.ToString().ToLower()}"
string filePath = GetOutputFilePath($"{fileName}");
return File.OpenWrite(filePath);
}