GroupDocs.Signature for .NET 17.1.0 Release Notes

Major Features

There are over 30 improvements, new features and fixes in this regular release. The most notable are:

  • Introduced alternative Text Signature implementation for all supported format Types
  • Introduced Digital Signatures Verification for all supported document formats
  • Introduced Text Signature Verification for Pdf Documents
  • Pdf Text Signature was extended with Text Annotation object and Text as rendered Image on document pages
  • Introduced ability to specify name of output file (relative or absolute)
  • Introduced Image Signature Size Adjustment for Pdf, Slides and Words Documents
  • Introduced opacity of Text Signature for Pdf and Cells Documents
  • Improved Digital Signature Options with ability to pass certificate from Stream object
  • Improved validation layer

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
SIGNATURENET-2499Implement alternative Text Signature implementation as Annotation for Pdf DocumentsNew Feature
SIGNATURENET-2491Implement ability to setup output file name for Save OptionsNew Feature
SIGNATURENET-2486Implement Text Signature Verification for Pdf DocumentsNew Feature
SIGNATURENET-2477Implement Unique Identifier of Text Signature for Pdf DocumentsNew Feature
SIGNATURENET-2475Provide alternative Text Signature implementation as Image for Slides DocumentsNew Feature
SIGNATURENET-2473Provide alternative Text Signature implementation as Image for Words DocumentsNew Feature
SIGNATURENET-2471Provide alternative Text Signature implementation as Image for Cells DocumentsNew Feature
SIGNATURENET-2469Provide alternative Text Signature implementation as Image for Pdf DocumentsNew Feature
SIGNATURENET-2449Implement ability to check, load and verify digitally signed Words documentsNew Feature
SIGNATURENET-2447Implement ability to check, load and verify digitally signed Cells documentsNew Feature
SIGNATURENET-2437Implement ability to check, load and verify digitally signed Pdf documentsNew Feature
SIGNATURENET-2380Implement Text Signature Opacity for Cells DocumentsNew Feature
SIGNATURENET-2378Implement Text Signature Opacity for Pdf DocumentsNew Feature
SIGNATURENET-2190Implement Image Signature Size Adjustments for SlidesNew Feature
SIGNATURENET-2186Implement Image Signature Size Adjustments for WordsNew Feature
SIGNATURENET-2184Implement Image Signature Size Adjustments for PDFNew Feature
SIGNATURENET-2517Update Digital Verification Options with ability to pass Certificate from StreamImprovement
SIGNATURENET-2516Update Digital Signature Options with ability to pass Certificate from StreamImprovement
SIGNATURENET-2505Improve logic of Words finding page algorithmImprovement
SIGNATURENET-2504Improve logic for cells text and image signature position.Improvement
SIGNATURENET-2466Provide alternative Text Signature implementation for Pdf DocumentsImprovement
SIGNATURENET-2431Provide alternative Text and Image Signature implementation for Open Office format filesImprovement
SIGNATURENET-2494Fix wrong alignment for Words Text SignatureBug
SIGNATURENET-2492Fix Border and Transparency appearance of Text Signature for Cells DocumentsBug
SIGNATURENET-2464Text signature for Words is not visible.Bug
SIGNATURENET-2458Intentions for a Pdf document with Text Signature don’t work.Bug
SIGNATURENET-2457Not able to set PDF/Cells test signature opacityBug
SIGNATURENET-2454Text signature with font and background options looks wrongBug
SIGNATURENET-2453Wrong exception’s text for wrong passwordBug
SIGNATURENET-2452OpenOfice doesn’t open .xls with default encryption method.Bug
SIGNATURENET-2441Detection of a type of an encrypted cells file starts an inappropriate exceptionBug
SIGNATURENET-2322When saving signed Words Document to different format - signature disappearsBug

Public API and Backward Incompatible Changes

  • Updated public classes for Text Signature Options (PdfTextSignatuteOptions, CellsTextSignatuteOptions, WordsTextSignatuteOptions and SlidesTextSignatuteOptions). Text Signature Options classes were extended with Signature Implementation enumeration types per each Document Types, like PdfTextSignatureImplementation, CellsTextSignatureImplementation, WordsTextSignatureImplementation and SlidesTextSignatureImplementation.

  • Added new class SignatureAppearance that describes extended settings for specific signature implementation. Added derived classes like PdfTextAnnotationAppearance that describes additional appearance options for PdfTextSignatureImplementation.TextAnnotation enumeration type. On this page you can find example

    Sign Pdf document with Text Signature as Image

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        OutputPath = outputPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup image signature options with relative path - image file stores in config.ImagesPath folder
    PdfSignTextOptions 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;
    //type of implementation
    signOptions.SignatureImplementation = PdfTextSignatureImplementation.Image;
    // sign document
    string signedPath = handler.Sign<string>("test.pdf", signOptions,
        new SaveOptions { OutputType = OutputType.String, OutputFileName = "Pdf_TextSignatureAsImage" });
    Console.WriteLine("Signed file path is: " + signedPath);
        
    

    Sign Pdf document with Text Signature as Annotation

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        OutputPath = outputPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup image signature options with relative path - image file stores in config.ImagesPath folder
    PdfSignTextOptions signOptions = new PdfSignTextOptions("John Smith");
    signOptions.Left = 100;
    signOptions.Top = 100;
    signOptions.Height = 200;
    signOptions.Width = 200;
    // 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;
    //type of implementation
    signOptions.SignatureImplementation = PdfTextSignatureImplementation.Annotation;
    // specify extended appearance options
    PdfTextAnnotationAppearance appearance = new PdfTextAnnotationAppearance();
    appearance.BorderColor = Color.Blue;
    appearance.BorderEffect = PdfTextAnnotationBorderEffect.Cloudy;
    appearance.BorderEffectIntensity = 2;
    appearance.BorderStyle = PdfTextAnnotationBorderStyle.Dashed;
    appearance.HCornerRadius = 10;
    appearance.BorderWidth = 5;
    appearance.Contents = signOptions.Text + " content description";
    appearance.Subject = "Appearance Subject";
    appearance.Title = "MrJohn Signature";
    signOptions.Appearance = appearance;
    // sign document
    string signedPath = handler.Sign<string>("test.pdf", signOptions,
        new SaveOptions { OutputType = OutputType.String, OutputFileName = "Pdf_TextSignatureAsAnnotation" });
    Console.WriteLine("Signed file path is: " + signedPath);
        
    
  • Added new classes for verification options: VerifyOptions, VerifyTextOptions, VerifyDigitalOptions, PdfVerifyTextOptions, PdfVerifyDigitalOptions, CellsVerifyDigitalOptions, WordsVerifyDigitalOptions, SlidesVerifyDigitalOptions.

  • Save signed file with different file name

    Output file name can be set in SaveOptions.

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        OutputPath = outputPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup options with text of signature
    SignOptions signOptions = new CellsSignTextOptions("John Smith");
    // specify load options
    LoadOptions loadOptions = new LoadOptions();
    // specify save options
    CellsSaveOptions saveOptions = new CellsSaveOptions()
        { OutputType = OutputType.String, OutputFileName = "FileWithDifferentFileName" };
    // sign document
    string signedPath = handler.Sign<string>("test.xls", signOptions, loadOptions, saveOptions);
    Console.WriteLine("Signed file path is: " + signedPath);
        
    
  • Verification PDF Documents signed with Text Signature

    Text Verification of PDF Document

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        OutputPath = outputPath
    };
    String text = "John Smith, esquire";
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup image signature options with relative path - image file stores in config.ImagesPath folder
    PdfSignTextOptions signOptions = new PdfSignTextOptions(text);
    signOptions.Left = 100;
    signOptions.Top = 100;
    signOptions.DocumentPageNumber = 1;
    // sign document
    string signedPath = handler.Sign<string>("test2pages.pdf", signOptions,
        new SaveOptions { OutputType = OutputType.String, OutputFileName = "Pdf_Documents_Verification_Text" });
    // setup digital verification options
    PDFVerifyTextOptions verifyOptions = new PDFVerifyTextOptions(text);
    verifyOptions.DocumentPageNumber = 1;
        
    //verify document
    VerificationResult result = handler.Verify(signedPath, verifyOptions);
    Console.WriteLine("Verification result: " + result.IsValid);
        
    
  • Verification Cells Documents signed with digital certificates

    Digital Verification of Cells Document with .cer certificate container

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    string imagePath = @"c:\Aspose\Test\Images";
    string certificatesPath = @"c:\Aspose\Test\Certificates";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        ImagesPath = imagePath,
        OutputPath = outputPath,
        CertificatesPath = certificatesPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup digital verification options
    CellsVerifyDigitalOptions verifyOptions = new CellsVerifyDigitalOptions("SherlockHolmes.cer");
    verifyOptions.Comments = "Test1";
    verifyOptions.SignDateTimeFrom = new DateTime(2017, 1, 26, 14, 55, 07);
    verifyOptions.SignDateTimeTo = new DateTime(2017, 1, 26, 14, 55, 09);
        
    //verify document
    VerificationResult result = handler.Verify("test_digitalsigned.xls", verifyOptions);
    Console.WriteLine("Signed file verification result: " + result.IsValid);
        
    

    Digital Verification of Cells Document with .pfx certificate container

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    string imagePath = @"c:\Aspose\Test\Images";
    string certificatesPath = @"c:\Aspose\Test\Certificates";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        ImagesPath = imagePath,
        OutputPath = outputPath,
        CertificatesPath = certificatesPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup digital verification options
    CellsVerifyDigitalOptions verifyOptions1 = new CellsVerifyDigitalOptions("DrWatson.pfx");
    //password is needed to open .pfx certificate
    verifyOptions1.Password = "1234567890";
    CellsVerifyDigitalOptions verifyOptions2 = new CellsVerifyDigitalOptions("SherlockHolmes.cer");
    VerifyOptionsCollection verifyOptionsCollection =
        new VerifyOptionsCollection(new List<VerifyOptions>() { verifyOptions1, verifyOptions2 });
        
    //verify document
    VerificationResult result = handler.Verify("test_digitalsigned.xls", verifyOptionsCollection);
    Console.WriteLine("Signed file verification result: " + result.IsValid);
        
    
  • Verification PDF Documents signed with digital certificates

    Digital Verification of PDF Document with .cer certificate container

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    string imagePath = @"c:\Aspose\Test\Images";
    string certificatesPath = @"c:\Aspose\Test\Certificates";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        ImagesPath = imagePath,
        OutputPath = outputPath,
        CertificatesPath = certificatesPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup digital verification options
    PDFVerifyDigitalOptions verifyOptions = new PDFVerifyDigitalOptions("DrWatson.cer");
    verifyOptions.Reason = "Test reason";
    verifyOptions.Contact = "Test contact";
    verifyOptions.Location = "Test location";
    //verify document
    VerificationResult result = handler.Verify("test_digitalsigned.pdf", verifyOptions);
    Console.WriteLine("Signed file verification result: " + result.IsValid);
        
    

    Digital Verification of PDF Document with .pfx certificate container

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    string imagePath = @"c:\Aspose\Test\Images";
    string certificatesPath = @"c:\Aspose\Test\Certificates";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        ImagesPath = imagePath,
        OutputPath = outputPath,
        CertificatesPath = certificatesPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup digital verification options
    PDFVerifyDigitalOptions verifyOptions1 = new PDFVerifyDigitalOptions("DrWatson.pfx");
    //password is needed to open .pfx certificate
    verifyOptions1.Password = "1234567890";
    PDFVerifyDigitalOptions verifyOptions2 = new PDFVerifyDigitalOptions("SherlockHolmes.cer");
    VerifyOptionsCollection verifyOptionsCollection =
        new VerifyOptionsCollection(new List<VerifyOptions>() { verifyOptions1, verifyOptions2 });
    //verify document
    VerificationResult result = handler.Verify("test_digitalsigned.pdf", verifyOptionsCollection);
    Console.WriteLine("Signed file verification result: " + result.IsValid);
        
    
  • Verification Words Documents signed with digital certificates

    Digital Verification of Words Document with .cer certificate container

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    string imagePath = @"c:\Aspose\Test\Images";
    string certificatesPath = @"c:\Aspose\Test\Certificates";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        ImagesPath = imagePath,
        OutputPath = outputPath,
        CertificatesPath = certificatesPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
        
    VerifyOptionsCollection verifyOptionsCollection = new VerifyOptionsCollection();
    // setup digital verification options
    WordsVerifyDigitalOptions verifyOptions = new WordsVerifyDigitalOptions("SherlockHolmes.cer");
    verifyOptions.Comments = "Test1";
    verifyOptions.SignDateTimeFrom = new DateTime(2017, 1, 26, 14, 55, 57);
    verifyOptions.SignDateTimeTo = new DateTime(2017, 1, 26, 14, 55, 59);
    //verify document
    VerificationResult result = handler.Verify("test_digitalsigned.Docx", verifyOptions);
    Console.WriteLine("Signed file verification result: " + result.IsValid);
        
    

    Digital Verification of Words Document with .pfx certificate container

    string storagePath = @"c:\Aspose\Test\Storage";
    string outputPath = @"c:\Aspose\Test\Output";
    string imagePath = @"c:\Aspose\Test\Images";
    string certificatesPath = @"c:\Aspose\Test\Certificates";
    // setup Signature configuration
    SignatureConfig signConfig = new SignatureConfig
    {
        StoragePath = storagePath,
        ImagesPath = imagePath,
        OutputPath = outputPath,
        CertificatesPath = certificatesPath
    };
    // instantiating the conversion handler
    SignatureHandler handler = new SignatureHandler(signConfig);
    // setup digital verification options
    WordsVerifyDigitalOptions verifyOptions1 = new WordsVerifyDigitalOptions("DrWatson.pfx");
    //password is needed to open .pfx certificate
    verifyOptions1.Password = "1234567890";
    WordsVerifyDigitalOptions verifyOptions2 = new WordsVerifyDigitalOptions("SherlockHolmes.cer");
    VerifyOptionsCollection verifyOptionsCollection =
        new VerifyOptionsCollection(new List<VerifyOptions>() { verifyOptions1, verifyOptions2 });
    //verify document
    VerificationResult result = handler.Verify("test_digitalsigned.Docx", verifyOptionsCollection);
    Console.WriteLine("Signed file verification result: " + result.IsValid);