GroupDocs.Annotation for .NET 21.5 Release Notes

Major Features

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

  • Added an ability to load custom fonts for documents
  • Added an ability to specify ZIndex for image annotations for Word formats
  • Added an ability to set up quality of image representation of documents pages
  • Fixed wrong space appearance in annotations list for html
  • Fixed issues met with TextHighlight/TextUnderline annotations while adding to image
  • Fixed issue during adding watermark annotation on multi-page PDF-file without license

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
ANNOTATIONNET-1711Implement ability to set up image of document qualityFeature
ANNOTATIONNET-1689Put image annotation top over or add ZIndex propertyFeature
ANNOTATIONNET-1683Add an ability to load custom fonts for documentsFeature
ANNOTATIONNET-1688NullReferenceException while saving jpeg, jpg fileBug
ANNOTATIONNET-1685Wrong space in annotations list for htmlBug
ANNOTATIONNET-1675Exception during adding watermark annotation on multi-page PDF-file without licenseBug
ANNOTATIONNET-1677Issues met with TextHighlight/TextUnderline annotations while adding to imageBug
ANNOTATIONNET-1686GetDocumentInfo cause exception when open emlx fileBug

Public API and Backward Incompatible Changes

1. Loading custom fonts for documents.

Since 21.5 you are now able to generate preview for documents using custom fonts. In order to realize this opportunity FontDirectories option has been added to LoadOptions class.

You can now try this feature by using code sample given below:

using (Annotator annotator = new Annotator(fs, new LoadOptions { FontDirectories = new List<string> { $"D:/fonts" } }))
{
    PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
    {
        var pagePath = $"D:/result_{pageNumber}.png";
        return File.Create(pagePath);
    });

    annotator.Document.GeneratePreview(previewOptions);
}

2. Put image annotation top over or add ZIndex property.

Since 21.5 you are now able to specify images placing order for file formats linked to Word. For this purpose a new ZIndex property has been added to ImageAnnotation class. You may now try in addition to other properties:

ImageAnnotation area = new ImageAnnotation
{
    Box = new Rectangle(100, 100, 100, 100),
    Opacity = 0.7,
    PageNumber = 0,
    ImagePath = "www.google.com.ua/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png",
    Angle = 100,
    ZIndex = 3
};

3. Configure resolution for generated preview images

Since 21.5 you are now able to generate preview for documents with custom resolution. This value is measured on points per inch, default value is 96. In order to use this feature Resolution property has been added to PreviewOptions class.

using (Annotator annotator = new Annotator("input.pdf"))
{
    PreviewOptions previewOptions = new PreviewOptions(pageNumber =>
    {
        var pagePath = $"result_{pageNumber}.png";
        return File.Create(pagePath);
    })
    {
        Resolution = 144
    };

    annotator.Document.GeneratePreview(previewOptions);
}