GroupDocs.Annotation for .NET 17.3.0 Release Notes

Major Features

Below the list of  new features and fixed bugs in this regular monthly release of GroupDocs.Annotation for .NET. The most notable are:

Implemented annotations annotating documents of following types:

  • Adding annotations to EMF/WMF documents
  • Added Distance Annotations to image documents
  • Implemented CAD documents annotating 
  • Implemented Arrow annotation for images
  • Fixed replies to annotations for Word documents

Full List of Issues Covering all Changes in this Release

KeySummaryIssue Type
ANNOTATIONNET-368Implement distance annotation for imagesNew Feature
ANNOTATIONNET-367Implement annotating EMF/WMF documentNew Feature
ANNOTATIONNET-365Export to MS-Word exporting the repeated reply commentsBug
ANNOTATIONNET-363Implement CAD documents annotatingNew Feature
ANNOTATIONNET-361Implement adding Arrow annotation to Image documentsNew Feature

Public API and Backward Incompatible Changes

DjVu

DjVu files after the annotation has been added will be saved to PDF file format:

List<AnnotationInfo> annotations = new List<AnnotationInfo>();

AnnotationConfig cfg = new AnnotationConfig();
cfg.StoragePath = "StorageFolder";

AnnotationImageHandler annotator = new AnnotationImageHandler(cfg);
AnnotationInfo pointAnnotation = new AnnotationInfo()
{
	PageNumber = 5,
	Type = AnnotationType.Point,
	Box = new Rectangle(100, 100, 0, 0),
	FieldText = "Hello!",
	CreatorName = "John"
};

annotations.Add(pointAnnotation);

Stream cleanImage = Assembly.GetExecutingAssembly().GetManifestResourceStream("0.djvu");

//result is PDF file
Stream result = annotator.ExportAnnotationsToDocument(cleanImage, annotations, DocumentType.Images);

using (FileStream fileStream = new FileStream("Annotated.pdf"),FileMode.Create))
{
	byte[] buffer = new byte[result.Length];
	result.Seek(0, SeekOrigin.Begin);
	result.Read(buffer, 0, buffer.Length);
	fileStream.Write(buffer, 0, buffer.Length);
}

DICOM

DICOM-files after the annotation has been added will be saved to BMP file:

List<AnnotationInfo> annotations = new List<AnnotationInfo>();


AnnotationConfig cfg = new AnnotationConfig();
cfg.StoragePath = "StorageFolder";


AnnotationImageHandler annotator = new AnnotationImageHandler(cfg);

AnnotationInfo pointAnnotation = new AnnotationInfo()
{
	PageNumber = 0,
	Type = AnnotationType.Point,
	Box = new Rectangle(100, 100, 0, 0),
	FieldText = "Hello!",
	CreatorName = "John"
};

annotations.Add(pointAnnotation);

Stream cleanImage = Assembly.GetExecutingAssembly().GetManifestResourceStream("0.dcm");

//result as bmp file
Stream result = annotator.ExportAnnotationsToDocument(cleanImage, annotations, DocumentType.Images);


using (FileStream fileStream = new FileStream("Annotated.bmp"),FileMode.Create))
{
	byte[] buffer = new byte[result.Length];
	result.Seek(0, SeekOrigin.Begin);
	result.Read(buffer, 0, buffer.Length);
	fileStream.Write(buffer, 0, buffer.Length);
}

CAD-files (DWG)

CAD-files after the annotation has been added will be saved to BMP file:

List<AnnotationInfo> annotations = new List<AnnotationInfo>();


AnnotationConfig cfg = new AnnotationConfig();
cfg.StoragePath = "StorageFolder";


AnnotationImageHandler annotator = new AnnotationImageHandler(cfg);


AnnotationInfo distanceAnnotation = new AnnotationInfo()

{
	CreatedOn = DateTime.Now,
    Type = AnnotationType.Distance,
    Box = new Rectangle(20, 20, 250, 250),
    BackgroundColor = -15988609,
    Text = "500px",
    FontFamily = "Arial"
};
annotations.Add(distanceAnnotation);

Stream cleanImage = Assembly.GetExecutingAssembly().GetManifestResourceStream("0.dwg");

//result as bmp file
Stream result = annotator.ExportAnnotationsToDocument(cleanImage, annotations, DocumentType.Images);


using (FileStream fileStream = new FileStream("Annotated.bmp"),FileMode.Create))
{
	byte[] buffer = new byte[result.Length];
	result.Seek(0, SeekOrigin.Begin);
	result.Read(buffer, 0, buffer.Length);
	fileStream.Write(buffer, 0, buffer.Length);
}

EMF/WMF

EMF/WMF-files after the annotation has been added will be saved to PNG files:

List<AnnotationInfo> annotations = new List<AnnotationInfo>();


AnnotationConfig cfg = new AnnotationConfig();
cfg.StoragePath = "StorageFolder";


AnnotationImageHandler annotator = new AnnotationImageHandler(cfg);


AnnotationInfo distanceAnnotation = new AnnotationInfo()

{
	CreatedOn = DateTime.Now,
    Type = AnnotationType.Distance,
    Box = new Rectangle(20, 20, 250, 250),
    BackgroundColor = -15988609,
    Text = "500px",
    FontFamily = "Arial"
};
annotations.Add(distanceAnnotation);

Stream cleanImage = Assembly.GetExecutingAssembly().GetManifestResourceStream("0.wmf");

//result as bmp file
Stream result = annotator.ExportAnnotationsToDocument(cleanImage, annotations, DocumentType.Images);


using (FileStream fileStream = new FileStream("Annotated.png"),FileMode.Create))
{
	byte[] buffer = new byte[result.Length];
	result.Seek(0, SeekOrigin.Begin);
	result.Read(buffer, 0, buffer.Length);
	fileStream.Write(buffer, 0, buffer.Length);
}

© Aspose Pty Ltd 2001-2022. All Rights Reserved.