new Alignment(documentViewer, annotationManager)
Subcomponent dedicated to the AnnotationManager's specific functions for annotation alignment.
Parameters:
Name | Type | Description |
---|---|---|
documentViewer |
Core.DocumentViewer | |
annotationManager |
Core.AnnotationManager |
Methods
-
alignAnnotations(annotations, alignment)
-
Aligns a list of annotations based on the requested StandardAlignmentType. Annotations will be oriented based on the computed page rotation (Viewer Rotation + Page Rotation). Annotations from the TextMarkupAnnotation class will be excluded from alignment.
Parameters:
Name Type Description annotations
Array.<Core.Annotations.Annotation> The annotations to align. alignment
Core.AnnotationManager.StandardAlignmentTypes The alignment to perform. Example
WebViewer(...).then(function(instance) { const annotations = instance.Core.annotationManager.getAnnotationsList(); instance.Core.annotationManager.Alignment.alignAnnotations(annotations, instance.Core.AnnotationManager.Alignment.StandardAlignmentTypes.LEFT); });
-
centerAnnotations(annotations, alignment)
-
Centers a list of annotations based on the provided center alignment.
Parameters:
Name Type Description annotations
Array.<Core.Annotations.Annotation> The annotations to align. alignment
Core.AnnotationManager.CenterAlignmentTypes The center alignment to perform. Example
WebViewer(...).then(function(instance) { const annotations = instance.Core.annotationManager.getAnnotationsList(); instance.Core.annotationManager.Alignment.centerAnnotations(annotations, instance.Core.AnnotationManager.Alignment.CenterAlignmentTypes.CENTER_HORIZONTAL); });
-
distributeAnnotations(annotations, distribution)
-
Distributes a list of annotations based on the requested distribution alignment.
Parameters:
Name Type Description annotations
Array.<Core.Annotations.Annotation> The annotations to distribute. distribution
DistributeAlignmentTypes The distribution to perform. Example
WebViewer(...).then(function(instance) { const annotations = instance.Core.annotationManager.getAnnotationsList(); instance.Core.annotationManager.Alignment.distributeAnnotations(annotations, instance.Core.AnnotationManager.Alignment.DistributeAlignmentTypes.DISTRIBUTE_VERTICAL); });