GroupDocs.Signature for .NET 16.12.0 Release Notes

Major Features

There are over 20 improvements and fixes in this regular release. The most notable are:

  • Introduced multiple signature for all signature types Text Signature, Image Signature and Digital Signature
  • Introduced text alignment options Text Signature
  • Introduced margins options Text Signature
  • Introduced ability to sign all pages of Pdf document with Digital Signatures
  • Introduced Pdf Digital Signature alignment on pages
  • Introduced Margins for Pdf Digital Signature with Alignment options
  • Improved validation layer

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
SIGNATURENET-2026Add ability to sign files with digital signature by given pattern in folderNew Feature
SIGNATURENET-2027Add ability to sign files with image signature by given pattern in folderNew Feature
SIGNATURENET-2113Implement Text Signature alignment for PDF DocumentsNew Feature
SIGNATURENET-2129Implement Text Signature alignment for Words DocumentsNew Feature
SIGNATURENET-2131Implement Text Signature alignment for Cells DocumentsNew Feature
SIGNATURENET-2133Implement Text Signature alignment for Slides DocumentsNew Feature
SIGNATURENET-2307Add ability to sign files with text signature by given pattern in folderNew Feature
SIGNATURENET-2349Implement Digital Signature for all pages for Pdf documentsNew Feature
SIGNATURENET-2368Implement Text Signature Margins for PDF DocumentsNew Feature
SIGNATURENET-2370Implement Text Signature Margins for Cells DocumentsNew Feature
SIGNATURENET-2372Implement ability to sign Slides Documents with given list of Signature OptionsNew Feature
SIGNATURENET-2372Implement Text Signature Margins for Words DocumentsNew Feature
SIGNATURENET-2374Implement Text Signature Margins for Slides DocumentsNew Feature
SIGNATURENET-2384Implement ability to put Digital Signature on all pages for Pdf DocumentsNew Feature
SIGNATURENET-2385Implement Digital Signature Alignment for Pdf DocumentsNew Feature
SIGNATURENET-2392Implement ability to sign Pdf Documents with given list of Signature OptionsNew Feature
SIGNATURENET-2397Implement ability to sign Cells Documents with given list of Signature OptionsNew Feature
SIGNATURENET-2402Implement ability to sign Words Documents with given list of Signature OptionsNew Feature
SIGNATURENET-2377Pdf Text Signature - Adjust Signature Area when Width or Height properties are specifiedBug

Public API and Backward Incompatible Changes

  • Updated public classes for Text Signature Options (PdfTextSignatuteOptions, CellsTextSignatuteOptions, WordsTextSignatuteOptions and SlidesTextSignatuteOptions) were extended with VerticalAlignment, HorizontalAlignment and Margins properties
  • Added new class SignatureOptionsCollection to keep collection of Signature Options
  • Updated Pdf Digital Options - class was extended with Horizontal and Vertical Alignment properties
  • Ability to sign document with multiple signature options

Setup Multiple Signature Options

var storagePath = @"c:\Aspose\Test\Storage";
var outputPath = @"c:\Aspose\Test\Output";
var imagesPath = @"c:\Aspose\Test\Images";
var certificatesPath = @"c:\Aspose\Test\Certificates";
// setup Signature configuration
var signConfig = new SignatureConfig
{
    StoragePath = storagePath,
    OutputPath = outputPath,
    ImagesPath = imagesPath,
    CertificatesPath = certificatesPath
};
// instantiating the conversion handler
var handler = new SignatureHandler(signConfig);
// define Signature Options Collection
var collection = new SignatureOptionsCollection();
// specify text option
var signTextOptions = new PdfSignTextOptions("Mr. John", 100, 100, 100, 100);
// add to collection
collection.Add(signTextOptions);
// specify image options
var signImageOptions = new PdfSignImageOptions("signature.jpg");
signImageOptions.Left = 200;
signImageOptions.Top = 200;
signImageOptions.Width = 100;
signImageOptions.Height = 100;
// add to collection
collection.Add(signImageOptions);
// specify digital options
var signDigitalOptions = new PdfSignDigitalOptions("test.pfx");
signDigitalOptions.Password = "1234567890";
signDigitalOptions.VerticalAlignment = VerticalAlignment.Bottom;
signDigitalOptions.HorizontalAlignment = HorizontalAlignment.Center;
// add to collection
collection.Add(signDigitalOptions);
// sign document
var signedPath = handler.Sign<string>("test.pdf", collection, new SaveOptions { OutputType = OutputType.String });
Console.WriteLine("Signed file path is: " + signedPath);

  • The ability to adjust Text Signature appearance

Setup Font and Text Color options

var storagePath = @"c:\Aspose\Test\Storage";
var outputPath = @"c:\Aspose\Test\Output";
// setup Signature configuration
var signConfig = new SignatureConfig
{
    StoragePath = storagePath,
    OutputPath = outputPath
};
// instantiating the conversion handler
var handler = new SignatureHandler(signConfig);
// setup image signature options with relative path - image file stores in config.ImagesPath folder
var signOptions = new PdfSignTextOptions("John Smith");
// setup colors settings
signOptions.BackgroundColor = System.Drawing.Color.Beige;
// setup text color
signOptions.ForeColor = System.Drawing.Color.Red;
// setup Font options
signOptions.Font.Bold = true;
signOptions.Font.Italic = true;
signOptions.Font.Underline = true;
signOptions.Font.FontFamily = "Arial";
signOptions.Font.FontSize = 15;
// sign document
var signedPath = handler.Sign<string>("test.pdf", signOptions, new SaveOptions { OutputType = OutputType.String });
Console.WriteLine("Signed file path is: " + signedPath);


Setup Background and Border settings

var storagePath = @"c:\Aspose\Test\Storage";
var outputPath = @"c:\Aspose\Test\Output";
// setup Signature configuration
var signConfig = new SignatureConfig
{
    StoragePath = storagePath,
    OutputPath = outputPath
};
// instantiating the conversion handler
var handler = new SignatureHandler(signConfig);
// setup image signature options with relative path - image file stores in config.ImagesPath folder
var signOptions = new WordsSignTextOptions("John Smith");
// setup background settings
signOptions.BackgroundColor = System.Drawing.Color.Beige;
signOptions.BackgroundTransparency = 0.5;
// setup border settings
signOptions.BorderColor = System.Drawing.Color.Black;
signOptions.BorderDashStyle = Signature.Domain.ExtendedDashStyle.DashDot;
signOptions.BorderWeight = 1.2;
signOptions.BorderTransparency = 0.5;
// sign document
var signedPath = handler.Sign<string>("test.docx", signOptions, new SaveOptions { OutputType = OutputType.String });
Console.WriteLine("Signed file path is: " + signedPath);

  • The ability to adjust Image Signature appearance

Setup Image Signature Rectangle and Margins

var storagePath = @"c:\Aspose\Test\Storage";
var outputPath = @"c:\Aspose\Test\Output";
// setup Signature configuration
var signConfig = new SignatureConfig
{
    StoragePath = storagePath,
    OutputPath = outputPath
};
// instantiating the conversion handler
var handler = new SignatureHandler(signConfig);
// setup image signature options with relative path - image file stores in config.ImagesPath folder
var signOptions = new WordsSignTextOptions("John Smith");
// setup Signature area Size
signOptions.Left = 100;
signOptions.Top = 100;
signOptions.Width = 200;
signOptions.Height = 200;
// setup Signature area Margins
signOptions.Margin = new Padding(10);
// specify separate left margin value
signOptions.Margin.Left = 20;
// sign document
var signedPath = handler.Sign<string>("test.docx", signOptions, new SaveOptions { OutputType = OutputType.String });
Console.WriteLine("Signed file path is: " + signedPath);

Setup Signature area alignment

var storagePath = @"c:\Aspose\Test\Storage";
var outputPath = @"c:\Aspose\Test\Output";
var imagePath = @"c:\Aspose\Test\Images";
// setup Signature configuration
var signConfig = new SignatureConfig
{
StoragePath = storagePath,
ImagesPath = imagePath,
OutputPath = outputPath
};
// instantiating the conversion handler
var handler = new SignatureHandler(signConfig);
// setup image signature options
var signOptions = new PdfSignImageOptions("signature.jpg");
// specify horizontal alignment to the right
signOptions.HorizontalAlignment = HorizontalAlignment.Right;
// specify vertical alignment
signOptions.VerticalAlignment = VerticalAlignment.Bottom;
// sign document
var signedPath = handler.Sign<string>("test.pdf", signOptions, new SaveOptions { OutputType = OutputType.String });
Console.WriteLine("Signed file path is: " + signedPath);