GroupDocs.Annotation for .NET 19.1 Release Notes

Major Features

Below is the list of most notable changes in release of GroupDocs.Annotation for .NET 19.1:

  • Fixed bug of impossibility to set the line width on Slides documents
  • Fixed issue with opening protected with password Words and PDF documents
  • Improved performance issues when processing Slides documents
  • Add possibility to cache page previews
  • Added ability to annotate documents of older formats for Slides, Words, Cells (ppt, doc, xls)
  • Added ability to add text caption for distance annotation for Cells, Diagrams and Slides
  • Refactored logic for getting pages for Slides documents

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
ANNOTATIONNET-823Add possibility to cache page previewsFeature
ANNOTATIONNET-830 Implement possibility to display distance annotation caption for Slides formatFeature
ANNOTATIONNET-831 Implement possibility to display distance annotation caption for Cells formatFeature
ANNOTATIONNET-832 Implement possibility to display distance annotation caption for Diagram formatFeature
ANNOTATIONNET-832 Add supporting processing older format for Slides (.ppt)Feature
ANNOTATIONNET-841 Add supporting processing older format for Cells (.xls)Feature
ANNOTATIONNET-842 Add supporting processing older format for Words (.doc)Feature
ANNOTATIONNET-835Refactor logic for getting pages for Slides documentsImprovement
ANNOTATIONNET-837Refactor PdfToPng saverImprovement
ANNOTATIONNET-844Line width not set in SlidesBug
ANNOTATIONNET-808Application is consuming 100% resources usage while loading documentBug
ANNOTATIONNET-849Issue when opening protected with password documentsBug
ANNOTATIONNET-866AnnotationImageHandler.GetPages exception in trial mode (for documents with more than 2 pages)Bug
ANNOTATIONNET-878Not closed stream when remove annotationsBug

Public API and Backward Incompatible Change

  1. ImageOptions for GetPages() method

    You can get image representation of pages of your PDF document by using GetPages method of AnnotationImageHandler class.

    List<PageImage> GetPages(Stream fileStream, ImageOptions options)
    List<PageImage> GetPages(string guid, ImageOptions options)
    List<PageImage> GetPages(string guid)
    
    ParameterTypeDescription
    CountPagesToConvertintDetermines count of pages to convert. PageNumber should be greater than 0.
    PageNumberintDetermines page number (index) to be converted. If PageNumber = 0 (by default) then all pages of document will be converted.
    PageNumbersToConvertListDetermines list of page numbers, that will be converted. For example, if need converted only 3, 5 and 7 pages.
    WithoutAnnotationsboolDetermines that image pages will be returned without annotations.

    Priority – it’s what will be happen if all parameters are sets:

    ParameterPriorityDescription
    WithoutAnnotations1If this parameter is true, then document will be returned without annotations.
    PageNumbersToConvert2If this parameter not null and count of elements > 0, then only page numbers from PageNumbersToConvert parameter will be converted. PageNumber and CountPagesToConvert will be ignored.
    PageNumber3If this parameter = 0 (by default), then all pages of document will be converted. If parameter > 0, then will converted specified page.
    CountPagesToConvert4Working only if PageNumber > 0. If CountPagesToConvert = 1, then only one page will be converted (which is defined by PageNumber parameter). If CountPagesToConvert > 1, then will converted from Page number to PageNumber + CountPagesToConvert range.
    ImageOptionResult
    new ImageOptions()All pages of document will be converted.
    new ImageOptions() {WithoutAnnotations = true}All pages of document will converted, but without annotations.
    new ImageOptions() {PageNumber = 5}Only 5 page of document will be converted.
    List numberList = new List() { 2, 5, 7};new ImageOptions(){ PageNumbersToConvert = numberList }Only 2nd, 5th and 7th pages of document will be converted.
    new ImageOptions(){PageNumber = 5, CountPagesToConvert = 2}Pages 5,6,7 of document will be converted.

    Following example demonstrates how to use GetPages method:

    using System.Collections.Generic;
    using System.IO;
    using GroupDocs.Annotation.Config;
    using GroupDocs.Annotation.Domain.Image;
    using GroupDocs.Annotation.Domain.Options;
    using GroupDocs.Annotation.Handler;
         
         
    namespace GetPagesSample
    {
        class Program
        {
            static void Main(string[] args)
            {
                Stream document = new FileStream("../../Clear.pdf", FileMode.Open);
                AnnotationConfig cfg = new AnnotationConfig();
                cfg.StoragePath = "StorageFolder";
         
                AnnotationImageHandler annotationHandler = new AnnotationImageHandler(cfg);
         
                List<PageImage> images = annotationHandler.GetPages(document, new ImageOptions());
         
                // Save result stream to file.
                using(FileStream fileStream = new FileStream("../../image.png", FileMode.Create))
                {
                    byte[] buffer = new byte[images[0].Stream.Length];
                    images[0].Stream.Seek(0, SeekOrigin.Begin);
                    images[0].Stream.Read(buffer, 0, buffer.Length);
                    fileStream.Write(buffer, 0, buffer.Length);
                    fileStream.Close();        
                }
            }
        }
    }
    
  2. Enabling caching for opening same document pages

    ImageOptions imageOptions = new ImageOptions();
    imageOptions.CacheStoragePath = AnnotationImageHandler.GetFileDataStore().TempPath;
    imageOptions.EnableCaching = true;