GroupDocs.Signature for .NET 16.10.0 Release Notes

Major Features

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

  • Introduced signature area options Text Signature
  • Introduced Font options for Text Signature
  • Introduced Background options for Text Signature
  • Introduced Border setting for Text Signature
  • Introduced Image Alignment for Image Signature
  • Introduced Image signature Margins on Document Page
  • Introduced Save Format options for different Documents types
  • Improved Validation layer

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
SIGNATURENET-2347Implement Visible flag of Pdf Digital SignatureNew Feature
SIGNATURENET-2314Implement Save Format Options for Slides DocumentsNew Feature
SIGNATURENET-2312Implement Save Format Options for Cells DocumentsNew Feature
SIGNATURENET-2310Implement Save Format Options for Words DocumentsNew Feature
SIGNATURENET-2305Implement Save Format Options for PDF DocumentsNew Feature
SIGNATURENET-2222Implement Different Words Save Format OptionsNew Feature
SIGNATURENET-2199Implement Image Signature Margins for SlidesNew Feature
SIGNATURENET-2197Implement Image Signature Margins for CellsNew Feature
SIGNATURENET-2195Implement Image Signature Margins for WordsNew Feature
SIGNATURENET-2193Implement Image Signature Margins for PDFNew Feature
SIGNATURENET-2181Implement Text Signature Color Options for SlidesNew Feature
SIGNATURENET-2179Implement Text Signature Color Options for WordsNew Feature
SIGNATURENET-2177Implement Text Signature Color Options for CellsNew Feature
SIGNATURENET-2175Implement Text Signature Color Options for PDFNew Feature
SIGNATURENET-2162Implement Text Signature Font properties for SlidesNew Feature
SIGNATURENET-2160Implement Text Signature Font properties for CellsNew Feature
SIGNATURENET-2158Implement Text Signature Font properties for WordsNew Feature
SIGNATURENET-2156Implement Text Signature Font properties for PDFNew Feature
SIGNATURENET-2119Implement text size options in text signature for Slides documentsNew Feature
SIGNATURENET-2118Implement text size options in text signature for Cells documentsNew Feature
SIGNATURENET-2117Implement text size options in text signature for Words documentsNew Feature
SIGNATURENET-2116Implement text size options in text signature for Pdf documentsNew Feature
SIGNATURENET-2112Add ability to specify color options for text signatureNew Feature
SIGNATURENET-2109Add ability to specify options for saving signed DocumentNew Feature
SIGNATURENET-2092Implement Image Signature Alignment for SlidesNew Feature
SIGNATURENET-2091Implement Image Signature Alignment for WordsNew Feature
SIGNATURENET-2090Implement Image Signature Alignment for CellsNew Feature
SIGNATURENET-2089Implement Image Signature Alignment for PDFNew Feature
SIGNATURENET-2348Adjust Pdf Size options to document points dimensionBug
SIGNATURENET-2280When signing a password-protected Words file with a digital signature, an exception is thrownBug
SIGNATURENET-2274When signing a PPTX and a password is set in the options, Aspose.Slides.PptxUnsupportedFormatException is thrownBug
SIGNATURENET-2067Fix Words Provider to locate Image Signature on Page Number from OptionBug

Public API and Backward Incompatible Changes

Updated public classes for Text Signature Options

a. Class GroupDocs.Signature.Options.PdfSignTextOptions was extended with Font, ForeColor, BorderColor and BackgroundColor properties.
b. Class GroupDocs.Signature.Options.WordsSignTextOptions was extended with Font, ForeColor, BorderColor, BackgroundColor, BorderTransparency, BorderWeight and BorderDashStyleBackgroundTransparency properties.
c. Class GroupDocs.Signature.Options.CellsSignTextOptions was extended with Font, ForeColor, BorderColor, BackgroundColor, BorderTransparency, BorderWeight and BorderDashStyleBackgroundTransparency properties.
d. Class GroupDocs.Signature.Options.SlidesSignTextOptions was extended with Font, ForeColor, BorderColor, BorderWeight and BackgroundColor properties.

Updated public classes for Image Signature Options

a. Classes GroupDocs.Signature.Options.PdfSignImageOptions, GroupDocs.Signature.Options.CellsSignImageOptions, GroupDocs.Signature.Options.WordsSignImageOptions, GroupDocs.Signature.Options.SlidesSignImageOptions were extended with VerticalAlignment, HorizontalAlignment and Margin properties.

Save signed documents with different file format

When document was signed there is ability to specify different format of output file. Each Document Type (like Pdf, Cells, Words, Slides) has own enumeration of supported output file formats. For Pdf documents there is enumeration PdfSaveFileFormat, for Words documents - WordsSaveFileFormat. Also base class SaveOptions was used for derived classes PdfSaveOptions, WordsSaveOptions, CellsSaveOptions, SlidesSaveOptions.

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 options with text of signature
var signOptions = new CellsSignTextOptions("John Smith");
// specify load options
LoadOptions loadOptions = new LoadOptions();
loadOptions.Password = "1234567890";
// specify save options
CellsSaveOptions saveOptions = new CellsSaveOptions(OutputType.String);
saveOptions.FileFormat = Signature.Domain.CellsSaveFileFormat.ODS;
// sign document
var signedPath = handler.Sign<string>("test.xls", signOptions, loadOptions, saveOptions);
Console.WriteLine("Signed file path is: " + signedPath);

Setup Font and Text Color options

Signature options for most document types contain Font and ForeColor properties. Here is example for Pdf Document

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

WordsSignTextOptions class contains extended properties to specify Background and Border options for Text Signature appearance.

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);

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);