GroupDocs.Signature for .NET 24.7 Release Notes

The release of GroupDocs.Signature version 24.7 adds enhancements.

Full list of changes in this release

KeyCategorySummary
SIGNATURENET-4999EnhancementRemove obsolete constructors from the PreviewOptions class
SIGNATURENET-5165EnhancementMerge Code93Extended and Code93Standard into Code93 for EncodeTypes and DecodeType. Add support for RectMicroQR, MicroQR types

Major Enhancements

Remove obsolete constructors from the PreviewOptions class

🌐 The constructors PreviewOptions that were marked as obsolete have now been removed. To create instances of PreviewOptions, please use the updated constructors. Below is an example of how to generate previews using the new constructors.

        public static void GeneratePreview()
        {
        // The path to the documents directory.
            string filePath = Constants.SAMPLE_PDF;

            using (Signature signature = new Signature(filePath))
            {
                // create preview options object
                PreviewOptions previewOption = new PreviewOptions(GeneratePreview.CreatePageStream, GeneratePreview.ReleasePageStream)
                {
                    PreviewFormat = PreviewOptions.PreviewFormats.JPEG,
                };
                // generate preview
                signature.GeneratePreview(previewOption);
            }
        }

        private static Stream CreatePageStream(PreviewPageData pageData)
        {
            string imageFilePath = Path.Combine(Constants.OutputPath, "GeneratePreviewFolder", "image-" + pageData.PageNumber.ToString() + ".jpg");
            var folder = Path.GetDirectoryName(imageFilePath);
            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
            return new FileStream(imageFilePath, FileMode.Create);
        }

        private static void ReleasePageStream(PreviewPageData pageData, Stream pageStream)
        {
            pageStream.Dispose();
            string imageFilePath = Path.Combine(Constants.OutputPath, "GeneratePreviewFolder", "image-" + pageData.PageNumber.ToString() + ".jpg");
            Console.WriteLine($"Image file {imageFilePath} is ready for preview");
        }

Merge Code93Extended and Code93Standard into Code93 for EncodeTypes and DecodeType. Add support for RectMicroQR, MicroQR types

🌐 Merged Code93Extended and Code93Standard into Code93 for EncodeTypes and DecodeType. Replaced Code39Standard to Code39 as it is defined in ISO/IEC 16388. Replaced Code39Extended to Code39FullASCII because ISO/IEC 16388 defines the code variant as full ASCII support over Code39. Below is an example of advanced BarcodeSignOptions using the Code39 barcode type.

        static BarcodeSignOptions GetBarcodeSignOptions()
        {
            BarcodeSignOptions result = new BarcodeSignOptions("123456789012", BarcodeTypes.Code39);
            // alignment settings
            result.Left = 100;
            result.Top = 50;
            result.Width = 200;
            result.Height = 120;
            result.AllPages = true;
            result.PageNumber = 1;
            result.PagesSetup = new PagesSetup() { FirstPage = true, LastPage = false, OddPages = true, EvenPages = false, PageNumbers = { 1, 2, 3 } };
            result.HorizontalAlignment = Domain.HorizontalAlignment.Right;
            result.VerticalAlignment = Domain.VerticalAlignment.Top;
            // border settings
            result.Border.Color = System.Drawing.Color.Red;
            result.Border.DashStyle = GroupDocs.Signature.Domain.DashStyle.DashLongDash;
            result.Border.Transparency = 0.8;
            result.Border.Weight = 2;
            result.Border.Visible = true;
            // background settings
            result.Background.Color = System.Drawing.Color.Yellow;
            result.Background.Transparency = 0.5;
            result.ForeColor = System.Drawing.Color.Green;

            return result;
        }