diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 49b71f3185..8ebfab18bd 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -687,6 +687,7 @@
  • Text Search
  • Annotation
  • Redaction diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-event.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-event.md index c9fa6baeef..08f84e497b 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-event.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-event.md @@ -1,6 +1,6 @@ --- layout: post -title: Annotations Events | Syncfusion +title: Annotations Events in Angular Pdfviewer Control | Syncfusion description: Learn here all about annotation events in Syncfusion Angular PDF Viewer component of Syncfusion Essential JS 2 and more. platform: document-processing control: PDF Viewer @@ -10,9 +10,7 @@ domainurl: ##DomainURL## # PDF Viewer annotation events in Angular -The PDF Viewer control supports several annotation events that enable applications to respond to user interactions—adding, moving, resizing, selecting, and removing annotations. Examples in this article reference the resource URL shown in the code samples. - -The annotation events supported by the PDF Viewer control are: +The PDF Viewer raises events for annotation and signature interactions (add, remove, move, resize, select, etc.). Handle these events to integrate custom workflows, telemetry, or UI updates. Code samples below demonstrate typical handlers — code blocks are preserved unchanged. | Annotation events | Description | |---------------------------------|--------------------------------------------------------------------| @@ -1538,4 +1536,3 @@ export class AppComponent implements OnInit { } {% endhighlight %} {% endtabs %} - diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-permission.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-permission.md new file mode 100644 index 0000000000..2f17764d8c --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotation-permission.md @@ -0,0 +1,156 @@ +--- +layout: post +title: Annotations Permission in Angular PDF Viewer | Syncfusion +description: Learn here all about how to use annotation permissions in Syncfusion Angular PDF Viewer using programmatic APIs. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Annotation permissions in Angular + +Use [annotationSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationsettings) to control creation-time permissions and default behavior for annotations in the PDF Viewer. These settings establish defaults for annotations created through the UI and programmatic flows. + +## Common permissions + +- `isLock`: Lock an annotation so it cannot be moved, resized, edited, or deleted. +- `skipPrint`: Exclude annotations from the print output when printing from the viewer. +- `skipDownload`: Exclude annotations from the exported/downloaded PDF. + +Example: set default `annotationSettings` on the Angular `ejs-pdfviewer` component. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public annotationSettings: any = { + author: 'XYZ', + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + isLock: false, + skipPrint: false, + skipDownload: false, + allowedInteractions: ['Resize'] + }; +} +{% endhighlight %} +{% endtabs %} + +## Individual permissions + +- `isPrint`: Controls whether a specific annotation participates in printing. Set to `false` to exclude only that annotation from print output. +- `isLock`: Lock or unlock a specific annotation instance programmatically. + +Example: set per-annotation defaults for text markup, shapes, and measurements as component bindings in Angular. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public highlightSettings = { author: 'QA', subject: 'Review', color: '#ffff00', opacity: 0.6 }; + public strikethroughSettings = { author: 'QA', subject: 'Remove', color: '#ff0000', opacity: 0.6 }; + public underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9 }; + public squigglySettings = { author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9 }; + + public lineSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true }; + public arrowSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true }; + public rectangleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, isLock: false, isPrint: true }; + public circleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, isLock: false, isPrint: true }; + public polygonSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, isLock: false, isPrint: true }; + + public distanceSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true }; + public perimeterSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, isLock: false, isPrint: true }; + public areaSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', isLock: false, isPrint: true }; + public radiusSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', isLock: false, isPrint: true }; + public volumeSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', isLock: false, isPrint: true }; + + public freeTextSettings = { borderColor: '#222222', opacity: 1, isLock: false, isPrint: true }; + public inkAnnotationSettings = { strokeColor: '#0000ff', thickness: 3, opacity: 0.8, isLock: false, isPrint: true }; + public stampSettings = { opacity: 0.9, isLock: false, isPrint: true }; + public stickyNotesSettings = { author: 'QA', subject: 'Review', opacity: 1, isLock: false, isPrint: true }; +} +{% endhighlight %} +{% endtabs %} + +Behavior notes +- isLock true: The annotation is locked; users cannot move, resize, or edit it through the UI until it is unlocked. +- skipPrint true: All annotations are omitted from the print output initiated from the viewer. +- skipDownload true: All annotations are omitted from the exported/downloaded PDF from the viewer. +- isPrint on an individual annotation: Use this when you only want to exclude a particular annotation from printing while leaving others printable. + +[View Sample on GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples) + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-api.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-api.md new file mode 100644 index 0000000000..addfac3cf2 --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-api.md @@ -0,0 +1,3053 @@ +--- +layout: post +title: Annotations API in Angular PDF Viewer | Syncfusion +description: Learn here all about how to read and configure annotations using APIs in the Syncfusion Angular PDF Viewer. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Annotations API in Angular + +The PDF Viewer provides APIs to read the loaded annotations and to configure global defaults for creating/editing annotations. + +| API | Description | +|---|---| +| [annotationCollection](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationcollection) | Gets the loaded document annotation collection. | +| [annotationDrawingOptions](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationdrawingoptions) | Options to configure line-type annotation drawing behavior. | +| [annotationSelectorSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationselectorsettings) | Configures the annotation selector (selection UI). | +| [annotationSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationsettings) | Global defaults for all annotations. | +| [areaSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#areasettings) | Defaults for Area annotations. | +| [arrowSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#arrowsettings) | Defaults for Arrow annotations. | +| [circleSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#circlesettings) | Defaults for Circle annotations. | +| [customStamp](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#customstamp) | Defines custom stamp items. | +| [customStampSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#customstampsettings) | Defaults for Custom Stamp annotations. | +| [distanceSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#distancesettings) | Defaults for Distance annotations. | + +## annotationCollection +Read the loaded document annotation collection from the viewer instance. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` +
    + + + + +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + private getViewer(): any { + return (document.getElementById('pdfViewer') as any) + ?.ej2_instances?.[0]; + } + + logAnnotations(): void { + const viewer = this.getViewer(); + if (viewer) { + console.log(viewer.annotationCollection); + } + } +} +{% endhighlight %} +{% endtabs %} + +--- + +## annotationDrawingOptions +Configure line-type annotation drawing behavior. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Annotation drawing constraints (Angular equivalent of React props) */ + public annotationDrawingOptions = { + enableLineAngleConstraints: true, + restrictLineAngleTo: 90 + }; +} + +{% endhighlight %} +{% endtabs %} + +--- + +## annotationSelectorSettings +Configure the annotation selector (selection UI). + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + AnnotationResizerLocation, + CursorType +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Annotation selector customization */ + public annotationSelectorSettings = { + selectionBorderColor: 'blue', + resizerBorderColor: 'red', + resizerFillColor: '#4070ff', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: CursorType.grab + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## annotationSettings +Global defaults for all annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Default annotation settings */ + public annotationSettings = { + author: 'XYZ', + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + isLock: false, + skipPrint: false, + skipDownload: false, + allowedInteractions: [ + AllowedInteraction.Resize + ] + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## areaSettings +Defaults for Area annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + AnnotationResizerLocation, + CursorType, + AllowedInteraction +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Default Area annotation settings */ + public areaSettings = { + opacity: 1, + fillColor: '#ffffff00', + strokeColor: '#ff0000', + author: 'XYZ', + thickness: 1, + + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + + isLock: false, + isPrint: true, + + annotationSelectorSettings: { + selectionBorderColor: 'blue', + resizerBorderColor: 'white', + resizerFillColor: '#4070ff', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: CursorType.grab + }, + + allowedInteractions: [ + AllowedInteraction.Resize + ] + }; +} + +{% endhighlight %} +{% endtabs %} + +--- + +## arrowSettings +Defaults for Arrow annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + AnnotationResizerLocation, + CursorType, + AllowedInteraction +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Default Arrow annotation settings */ + public arrowSettings = { + opacity: 1, + fillColor: '#9c2592', + strokeColor: '#ff0000', + author: 'XYZ', + thickness: 1, + borderDashArray: 1, + lineHeadStartStyle: 'Closed', + lineHeadEndStyle: 'Closed', + + annotationSelectorSettings: { + selectionBorderColor: 'blue', + resizerBorderColor: 'black', + resizerFillColor: '#FF4081', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: CursorType.grab + }, + + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 0, + + isLock: false, + allowedInteractions: [ + AllowedInteraction.Resize + ], + isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## circleSettings +Defaults for Circle annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + AnnotationResizerLocation, + CursorType, + AllowedInteraction +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Default Circle annotation settings */ + public circleSettings = { + opacity: 1, + fillColor: '#9c2592', + strokeColor: '#ff0000', + author: 'XYZ', + thickness: 1, + + annotationSelectorSettings: { + selectionBorderColor: 'blue', + resizerBorderColor: 'black', + resizerFillColor: '#FF4081', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: CursorType.grab + }, + + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + + isLock: false, + allowedInteractions: [ + AllowedInteraction.Resize + ], + isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## customStamp +Define custom stamp items. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Custom stamp collection */ + public customStamp = [ + { + customStampName: 'Sample', + customStampImageSource: 'data:image/png;base64, Syncfusionpdfviewer' + } + ]; +} +{% endhighlight %} +{% endtabs %} + +--- + +## customStampSettings +Defaults for Custom Stamp annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Custom stamp default settings */ + public customStampSettings = { + opacity: 1, + author: 'XYZ', + width: 100, + height: 100, + left: 200, + top: 200, + + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + + isLock: false, + enableCustomStamp: true, + + allowedInteractions: [ + AllowedInteraction.None + ], + + isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## distanceSettings +Defaults for Distance annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + AnnotationResizerLocation, + CursorType, + AllowedInteraction +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Default Distance annotation settings */ + public distanceSettings = { + opacity: 1, + fillColor: '#ffffff00', + strokeColor: '#ff0000', + author: 'Guest', + thickness: 1, + + borderDashArray: 1, + lineHeadStartStyle: 'Closed', + lineHeadEndStyle: 'Closed', + + annotationSelectorSettings: { + selectionBorderColor: 'blue', + resizerBorderColor: 'black', + resizerFillColor: '#FF4081', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: CursorType.grab + }, + + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + + isLock: false, + leaderLength: 40, + resizeCursorType: CursorType.move, + + allowedInteractions: [ + AllowedInteraction.Resize + ], + isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableAnnotation +Enable or disable the Add/Edit Annotations tool in the toolbar. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableAnnotationToolbar +Show or hide the annotation toolbar when the document loads. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableFreeText +Enable or disable Free Text annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableHandwrittenSignature +Enable or disable the handwritten signature feature. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableInkAnnotation +Enable or disable Ink annotations (true by default). + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableMeasureAnnotation +Enable or disable calibrate/measurement annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableMultiPageAnnotation +Enable or disable multi-page text markup selection in UI. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/FormDesigner.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableShapeAnnotation +Enable or disable shape annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableShapeLabel +Enable or disable labels for shape annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} + +{% endhighlight %} +{% endtabs %} + +--- + +## enableStampAnnotations +Enable or disable stamp annotations at load time. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} + +{% endhighlight %} +{% endtabs %} + +--- + +## enableStickyNotesAnnotation +Enable or disable sticky notes annotations at load time. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableTextMarkupAnnotation +Enable or disable text markup annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## enableTextMarkupResizer +Enable or disable the text markup resizer to modify bounds in the UI. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## exportAnnotationFileName +Gets or sets the exported annotations JSON file name. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## freeTextSettings +Defaults for Free Text annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + FontStyle, + AnnotationResizerLocation, + AllowedInteraction +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/PDF_Succinctly.pdf'; + + /** Default Free Text annotation settings */ + public freeTextSettings = { + opacity: 1, + fillColor: '#ffffff00', + borderColor: '#4070ff', + author: 'XYZ', + borderWidth: 1, + width: 151, + height: 24.6, + + fontSize: 16, + fontColor: '#000', + fontFamily: 'Helvetica', + defaultText: 'Type Here', + textAlignment: 'Right', + fontStyle: FontStyle.Italic, + allowTextOnly: false, + + annotationSelectorSettings: { + selectionBorderColor: 'blue', + resizerBorderColor: 'black', + resizerFillColor: '#FF4081', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Circle', + selectorLineDashArray: [], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: null + }, + + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + + isLock: false, + allowedInteractions: [ + AllowedInteraction.None + ], + isPrint: true, + isReadonly: false, + enableAutoFit: false + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## handWrittenSignatureSettings +Defaults for handwritten signatures. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { + DisplayMode, + AnnotationResizerLocation, + CursorType, + AllowedInteraction +} from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + /** Handwritten Signature default settings */ + public handWrittenSignatureSettings = { + signatureItem: ['Signature', 'Initial'], + saveSignatureLimit: 1, + saveInitialLimit: 1, + + opacity: 1, + strokeColor: '#000000', + width: 150, + height: 100, + thickness: 1, + + annotationSelectorSettings: { + selectionBorderColor: 'blue', + resizerBorderColor: 'black', + resizerFillColor: '#FF4081', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [ + AnnotationResizerLocation.Corners, + AnnotationResizerLocation.Edges + ], + resizerCursorType: CursorType.grab + }, + + allowedInteractions: [ + AllowedInteraction.Resize + ], + + signatureDialogSettings: { + displayMode: [ + DisplayMode.Draw, + DisplayMode.Text, + DisplayMode.Upload + ], + hideSaveSignature: false + }, + + initialDialogSettings: { + displayMode: [ + DisplayMode.Draw, + DisplayMode.Text, + DisplayMode.Upload + ], + hideSaveSignature: false + } + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## highlightSettings +Defaults for Highlight annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public highlightSettings = { + opacity: 1, color: '#DAFF56', author: 'XYZ', + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges] + }, + isLock: false, enableMultiPageAnnotation: false, enableTextMarkupResizer: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## inkAnnotationSettings +Defaults for Ink annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public inkAnnotationSettings = { + author: 'XYZ', opacity: 1, strokeColor: '#ff0000', thickness: 1, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + isLock: false, allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## isAnnotationToolbarVisible +Open the annotation toolbar initially and read its visibility state. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/FormDesigner.pdf'; +} +{% endhighlight %} +{% endtabs %} + +--- + +## lineSettings +Defaults for Line annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public lineSettings = { + opacity: 1, color: '#9c2592', fillColor: '#ffffff00', strokeColor: '#ff0000', + author: 'XYZ', thickness: 1, borderDashArray: 1, + lineHeadStartStyle: 'None', lineHeadEndStyle: 'None', + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: null + }, + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## measurementSettings +Defaults for Measurement annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public measurementSettings = { conversionUnit: 'cm', displayUnit: 'cm', scaleRatio: 1, depth: 96 }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## perimeterSettings +Defaults for Perimeter annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public perimeterSettings = { + opacity: 1, fillColor: '#ffffff00', strokeColor: '#ff0000', author: 'XYZ', + thickness: 1, borderDashArray: 1, lineHeadStartStyle: 'Open', lineHeadEndStyle: 'Open', + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#4070ff', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## polygonSettings +Defaults for Polygon annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public polygonSettings = { + opacity: 1, fillColor: '#ffffff00', strokeColor: '#ff0000', author: 'XYZ', thickness: 1, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## radiusSettings +Defaults for Radius annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public radiusSettings = { + opacity: 1, fillColor: '#ffffff00', strokeColor: '#ff0000', author: 'XYZ', + thickness: 1, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'red', resizerFillColor: '#4070ff', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## rectangleSettings +Defaults for Rectangle annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public rectangleSettings = { + opacity: 1, fillColor: '#9c2592', strokeColor: '#ff0000', author: 'XYZ', thickness: 1, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## shapeLabelSettings +Defaults for shape labels (requires `enableShapeLabel`). + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public shapeLabelSettings = { + opacity: 1, fillColor: '#9c2592', borderColor: '#ff0000', fontColor: '#000', + fontSize: 16, labelHeight: 24.6, labelMaxWidth: 151, labelContent: 'XYZ' + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## stampSettings +Defaults for Stamp annotations (dynamic/sign/business). + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, DynamicStampItem, SignStampItem, StandardBusinessStampItem, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public stampSettings = { + opacity: 1, author: 'XYZ', + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'red', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 5, resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + dynamicStamps: [ + DynamicStampItem.Revised, DynamicStampItem.Reviewed, DynamicStampItem.Received, + DynamicStampItem.Confidential, DynamicStampItem.Approved, DynamicStampItem.NotApproved + ], + signStamps: [ + SignStampItem.Witness, SignStampItem.InitialHere, SignStampItem.SignHere, + SignStampItem.Accepted, SignStampItem.Rejected + ], + standardBusinessStamps: [ + StandardBusinessStampItem.Approved, StandardBusinessStampItem.NotApproved, + StandardBusinessStampItem.Draft, StandardBusinessStampItem.Final, + StandardBusinessStampItem.Completed, StandardBusinessStampItem.Confidential, + StandardBusinessStampItem.ForPublicRelease, StandardBusinessStampItem.NotForPublicRelease, + StandardBusinessStampItem.ForComment, StandardBusinessStampItem.Void, + StandardBusinessStampItem.PreliminaryResults, StandardBusinessStampItem.InformationOnly + ], + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## stickyNotesSettings +Defaults for Sticky Notes annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public stickyNotesSettings = { + author: 'XYZ', opacity: 1, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'red', resizerFillColor: '#4070ff', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + isLock: false, allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## strikethroughSettings +Defaults for Strikethrough annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public strikethroughSettings = { + opacity: 1, color: '#DAFF56', author: 'XYZ', + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges] + }, + isLock: false, enableMultiPageAnnotation: false, enableTextMarkupResizer: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## underlineSettings +Defaults for Underline annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public underlineSettings = { + opacity: 1, color: '#9c2592', author: 'XYZ', + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#FF4081', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Square', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges] + }, + isLock: false, enableMultiPageAnnotation: false, enableTextMarkupResizer: false, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +--- + +## volumeSettings +Defaults for Volume annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { AnnotationResizerLocation, CursorType, AllowedInteraction } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` + + + ` +}) +export class AppComponent { + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public volumeSettings = { + opacity: 1, fillColor: '#ffffff00', strokeColor: '#ff0000', author: 'XYZ', thickness: 1, + minHeight: 10, minWidth: 10, maxWidth: 100, maxHeight: 100, isLock: false, + annotationSelectorSettings: { + selectionBorderColor: 'blue', resizerBorderColor: 'black', resizerFillColor: '#4070ff', + resizerSize: 8, selectionBorderThickness: 1, resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: [AnnotationResizerLocation.Corners, AnnotationResizerLocation.Edges], + resizerCursorType: CursorType.grab + }, + allowedInteractions: [AllowedInteraction.Resize], isPrint: true + }; +} +{% endhighlight %} +{% endtabs %} + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../../annotation/create-modify-annotation) +- [Customize Annotation](../../annotation/customize-annotation) +- [Remove Annotation](../../annotation/delete-annotation) +- [Handwritten Signature](../../annotation/signature-annotation) +- [Export and Import Annotation](../../annotation/export-import/export-annotation) +- [Annotation in Mobile View](../../annotation/annotations-in-mobile-view) +- [Annotation Events](../../annotation/annotation-event) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-in-mobile-view.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-in-mobile-view.md index 321e40ab0c..9804a3e0ad 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-in-mobile-view.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-in-mobile-view.md @@ -1,124 +1,138 @@ --- layout: post -title: Annotations mobileView in Angular PDF Viewer control | Syncfusion -description: Learn how to use annotations in mobile view with the Syncfusion Angular PDF Viewer (Essential JS 2). +title: Annotations mobileView in Angular PDF Viewer | Syncfusion +description: Learn here all about how to use annotations in mobile view with the Syncfusion Angular PDF Viewer Component. platform: document-processing control: PDF Viewer documentation: ug domainurl: ##DomainURL## --- -# Annotations in mobile view in Angular PDF Viewer control +# Annotations in mobile view in Angular PDF Viewer -This article describes how to use annotation tools in the Syncfusion Angular PDF Viewer on touch-enabled (mobile) devices. It covers enabling the annotation toolbar, adding common annotation types, adjusting annotation properties, using comments, and removing annotations. +This article describes how to use annotation tools in the Syncfusion Angular PDF Viewer on touch-enabled devices. It covers enabling the annotation toolbar; adding sticky notes, text markups, shapes, measurements, stamps, signatures, and ink; adjusting annotation properties before and after placement; using comments; and removing annotations. ## Open the annotation toolbar -**Step 1:** Tap the Edit Annotation icon on the main toolbar to enable the annotation toolbar. +**Step 1:** Select the Edit Annotation icon on the main toolbar to enable the annotation toolbar. ![Enable the annotation toolbar](../images/edit-annotation.png) -**Step 2:** The annotation toolbar opens below the main toolbar, showing available annotation tools for touch interaction. +**Step 2:** The annotation toolbar appears below the main toolbar and displays tools optimized for touch interaction. ![Annotation toolbar displayed](../images/after-enabling-annotation-toolbar.png) ## Add sticky note annotations -**Step 1:** Tap the Sticky Notes icon to activate the sticky note tool, then tap the target location on the page to place a note. +**Step 1:** Select the Sticky Notes icon to activate the sticky note tool, then tap the desired location on the page to place a note. ![Open sticky note tool](../images/add-sticky-notes.png) -**Step 2:** A sticky note annotation is added at the tapped location; tap the note to open or edit its content. +**Step 2:** A sticky note annotation is added at the selected location; opening the note allows viewing or editing its content. ![Sticky note annotation added on the page](../images/sticky-notes-in-page.png) ## Add text markup annotations -**Step 1:** Tap a text markup tool (for example, highlight or underline), then drag to select the text to be marked. +**Step 1:** Select a text markup icon, highlight the desired text, then confirm the selection to apply the markup. ![Select text for markup](../images/select-text.png) -**Step 2:** Tap the selected area or use the toolbar action to apply the markup; the selected text is then annotated accordingly. +**Step 2:** The text markup annotation is applied to the highlighted text. ![Text markup applied on the page](../images/add-text-markup.png) ## Add shape and measurement annotations -**Step 1:** Tap the Shape or Measure icon to open the shape/measurement toolbar. +**Step 1:** Select the Shape or Measure icon to open the corresponding toolbar. ![Open shape and measurement tools](../images/add-shapes.png) -**Step 2:** Choose a shape or measurement type, then draw the annotation on the page using touch gestures. +**Step 2:** Choose a shape or measurement type and draw it on the page. ![Select measurement type](../images/open-radius.png) -**Step 3:** The shape or measurement annotation is added to the PDF and can be adjusted via its property toolbar. +**Step 3:** The annotation is rendered on the PDF page. ![Measurement annotation placed on the page](../images/radius-annotation.png) ## Add stamp annotations -**Step 1:** Tap the Stamp icon, then choose a stamp type from the presented menu. +**Step 1:** Select the Stamp icon and choose a stamp type from the menu. ![Open stamp tool](../images/open-stamp.png) -**Step 2:** Tap the desired location on the page to place the stamp annotation. +**Step 2:** Tap the page to place the chosen stamp annotation. ![Stamp annotation added on the page](../images/add-revised.png) ## Add signature annotations -**Step 1:** Tap the Signature icon to open the signature canvas. Draw the signature, tap Create, then tap the viewer to place the signature on the page. +**Step 1:** Select the Signature icon to open the signature canvas. Draw the signature, choose Create, then tap the viewer to place it. ![Open signature canvas](../images/add-signature.png) -**Step 2:** The signature annotation is added and can be positioned or resized using standard touch controls. +**Step 2:** The signature annotation is added to the page. ![Signature placed on the page](../images/adding-signature.png) ## Add ink annotations -**Step 1:** Tap the Ink tool and draw directly on the page using a finger or stylus. +**Step 1:** Select the Ink tool and draw directly on the page. ![Open ink tool](../images/open-ink.png) -**Step 2:** The ink strokes are saved as an ink annotation and remain editable until committed. +**Step 2:** The ink annotation is rendered on the page. -![Ink annotation drawn on the page](../images/ink-annotation.png) +![Ink annotation drawn on the page](../../javascript-es6/how-to/images/ink-annotation.png) ## Change annotation properties (before adding) -**Step 1:** Open the annotation property toolbar prior to placing an annotation to set attributes such as color, opacity, stroke thickness, font, or measurement units. +**Step 1:** Adjust annotation properties before placement as required. -**Step 2:** With the desired properties selected in the property toolbar, place the annotation on the page; the chosen settings apply to the new annotation. +**Step 2:** Open the property toolbar for the annotation icon, set the desired properties, and then place the annotation on the page. ![Adjust fill color before adding](../images/open-fillcolor.png) ## Change annotation properties (after adding) -**Step 1:** Select an existing annotation to reveal its property toolbar. +**Step 1:** Modify annotation properties after placement when necessary. -**Step 2:** Adjust properties such as color, opacity, stroke, or edit text; changes are applied immediately to the selected annotation. +**Step 2:** Select the annotation to display the property toolbar, then update the properties as needed. ![Edit annotation properties after adding](../images/change-property.png) ## Delete annotations -**Step 1:** Select the annotation to display its property toolbar, then tap the Delete icon to remove the annotation from the page. +**Step 1:** Select the annotation to display the property toolbar, then choose the Delete icon to remove the annotation. ![Delete icon in the property toolbar](../images/delete-icon.png) ## Open the comment panel -**Step 1:** Tap the comment icon in the property toolbar or the annotation toolbar to open the comment panel for the selected annotation. +**Step 1:** Open the comment panel from the property toolbar or the annotation toolbar. ![Open the comment panel](../images/open-comment.png) -**Step 2:** The comment panel appears, showing existing comments and allowing new comments to be added. +**Step 2:** The comment panel is displayed. ![Comment panel displayed](../images/comment-panel.png) ## Close the comment panel -**Step 1:** Tap the Close button in the comment panel to dismiss it and return to the document view. +**Step 1:** Use the Close button to dismiss the comment panel. ![Close the comment panel](../images/close-comment-panel.png) + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotations/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotations/create-modify-annotation) +- [Customize Annotation](../annotations/customize-annotation) +- [Remove Annotation](../annotations/delete-annotation) +- [Handwritten Signature](../annotations/signature-annotation) +- [Export and Import Annotation](../annotations/export-import/export-annotation) +- [Annotation Permission](../annotations/annotation-permission) +- [Annotation Events](../annotations/annotation-event) +- [Annotation API](../annotations/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-undo-redo.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-undo-redo.md new file mode 100644 index 0000000000..e9b28173ad --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/annotations-undo-redo.md @@ -0,0 +1,79 @@ +--- +layout: post +title: Undo and Redo annotation in Angular PDF Viewer | Syncfusion +description: Learn to undo and redo annotations changes in Syncfusion Angular PDF Viewer, with UI and programmatic examples. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Undo and redo annotations in Angular PDF Viewer + +The PDF Viewer supports undo and redo for annotations. + +![Undo-redo](../../javascript-es6/annotations/annotation-images/annotation-undo-redo.png) + +Undo and redo actions can be performed by using either of the following methods: + +1. Using keyboard shortcuts (desktop): + After performing an annotation action, press `Ctrl+Z` to undo and `Ctrl+Y` to redo on Windows and Linux. On macOS, use `Command+Z` to undo and `Command+Shift+Z` to redo. +2. Using the toolbar: + Use the **Undo** and **Redo** tools in the toolbar. + +Refer to the following code snippet to call undo and redo actions from the client side. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    + + +
    + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + getViewer() { + return (document.getElementById('pdfViewer') as any).ej2_instances[0]; + } + + undoAnnotation() { + this.getViewer().undo(); + } + + redoAnnotation() { + this.getViewer().redo(); + } +} +{% endhighlight %} +{% endtabs %} + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../../annotation/create-modify-annotation) +- [Customize Annotation](../../annotation/customize-annotation) +- [Remove Annotation](../../annotation/delete-annotation) +- [Handwritten Signature](../../annotation/signature-annotation) +- [Export and Import Annotation](../../annotations/export-import/export-annotation) +- [Annotation in Mobile View](../../annotation/annotations-in-mobile-view) +- [Annotation Events](../../annotation/annotation-event) +- [Annotations API](../annotation/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md index 52797becd8..d8c90b3507 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md @@ -1,168 +1,602 @@ --- layout: post -title: Comments in Angular PDF Viewer component | Syncfusion -description: Learn about comments, replies, and status in the Syncfusion Angular PDF Viewer component of Syncfusion Essential JS 2. +title: Comments in Angular PDF Viewer | Syncfusion +description: Learn how to add, reply to, edit, set status for, delete, and read comments for annotations in the Syncfusion Angular PDF Viewer. platform: document-processing -control: Comments +control: PDF Viewer documentation: ug domainurl: ##DomainURL## --- -# Comments in Angular PDF Viewer control +# Comments in Angular PDF Viewer -The PDF Viewer control provides options to add, edit, and delete comments for the following annotations in PDF documents: +The PDF Viewer lets you add, edit, reply to, set status for, and delete comments on the following annotation types: -* Shape annotation -* Stamp annotation -* Sticky note annotation -* Measurement annotation -* Text markup annotation -* Free text annotation -* Ink annotation +* Shape annotation +* Stamp annotation +* Sticky note annotation +* Measurement annotation +* Text markup annotation +* Free text annotation +* Ink annotation -![Comment panel overview](../images/commentannot.png) +![Comments panel overview](../images/commentannot.png) -## Adding a comment to the annotation +## Add a comment to an annotation (UI) -Annotation comments, replies, and status can be managed in the PDF document using the comment panel. +Use the **Comments panel** to manage annotation comments, replies, and status. -### Comment panel +### Open the Comments panel +Open the panel in any of these ways: -Annotation comments can be added to the PDF using the comment panel. The comment panel can be opened in the following ways: +1. **Annotation toolbar** + * Click **Edit Annotation** in the toolbar to show the secondary toolbar. + * Click **Comment Panel** to open the panel. +2. **Context menu** + * Select an annotation and **right‑click** it. + * Choose **Comment** from the context menu. +3. **Double‑click** + * Select the annotation and **double‑click** it to open the panel. -1. Using the annotation menu +If the panel is already open, selecting an annotation highlights its thread so you can view or add comments. - * Click the Edit Annotation button in the PDF Viewer toolbar. A toolbar appears below it. - * Click the Comment Panel button. The comment panel opens. +### Add comments and replies +- Select the annotation in the PDF. +- The corresponding thread is highlighted in the Comments panel. +- Add comments and any number of replies in the panel. -2. Using Context menu +![Add comment to sticky note](../images/stickycomment.png) - * Select the annotation in the PDF document and right-click it. - * Select Comment from the context menu.. +### Set comment or reply status +- Select a comment in the panel. +- Click **More options** on the comment or reply container. +- Choose **Set Status**, then pick a status. -3. Using the Mouse click - - * Select the annotation in the PDF document and double-click it. The comment panel opens. +![Set status for a comment](../images/commentstatus.png) -If the comment panel is already open, select the annotation and add comments using the panel. +### Edit comments and replies +You can edit comments in two ways: -### Adding comments +1. **Context menu** + * Select the comment in the panel and click **More options**. + * Choose **Edit** to switch to an editable text box. +2. **Mouse double‑click** + * Double‑click the comment or reply to edit its content. -* Select the annotation in the PDF document. -* The corresponding comment thread is highlighted in the comment panel. -* Add comments and replies using the comment panel. +![Edit comments and replies](../images/commentsedit.png) -![Adding comments to a sticky note annotation](../images/stickycomment.png) +### Delete comments or replies +- Select the comment in the panel. +- Click **More options** → **Delete**. -### Adding Comment Replies +![Delete comments or replies](../images/commentsdelete.png) -* Multiple replies can be added to a comment. -* After adding a comment, add replies as needed. +> Deleting the **root** comment from the Comments panel also deletes the associated annotation. -### Adding Comment or Reply Status +--- -* Select the annotation comment in the comment panel. -* Click More options in the comment or reply container. -* Select Set Status from the context menu. -* Choose a status for the comment. +## Add Comments to the annotation Programmatically -![Set status for a comment](../images/commentstatus.png) +### Add comments and replies programmatically -### Editing the comments and comments replies of the annotations +Comments can be added to the PDF document programmatically using the `editAnnotation` property. -Comments, replies, and status can be edited using the comment panel. +The following example Shows how to add comments and reply in response to a button click. -### Editing the Comment or Comment Replies +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component, ViewChild } from '@angular/core'; +import { + PdfViewerComponent, + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    +
    + + +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ] +}) +export class AppComponent { + + @ViewChild('pdfViewer') + public pdfViewer!: PdfViewerComponent; + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public addComment(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'add'; + annot.note = 'New Comment'; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } -Edit comments and replies in the following ways: + public addReply(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'add'; + annot.replyComment = ['Reply Comment']; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } +} -1. Using the Context menu +{% endhighlight %} +{% highlight ts tabtitle="Server-Backed" %} + +import { Component, ViewChild } from '@angular/core'; +import { + PdfViewerComponent, + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    +
    + + +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ] +}) +export class AppComponent { + + @ViewChild('pdfViewer') + public pdfViewer!: PdfViewerComponent; + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public serviceUrl: string = 'YOUR_SERVICE_URL'; + + public addComment(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'add'; + annot.note = 'New Comment'; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } - * Select the annotation comment in the comment panel. - * Click More options in the comment or reply container. - * Select Edit from the context menu. - * An editable text box appears. Change the content of the comment or reply. + public addReply(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'add'; + annot.replyComment = ['Reply Comment']; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } +} -2. Using the Mouse Click +{% endhighlight %} +{% endtabs %} - * Select the annotation comment in the comment panel. - * Double-click the comment or reply content. - * An editable text box appears. Change the content of the comment or reply. +### Edit comments and replies programmatically -### Editing Comment or Reply Status +Comments can be edited in the PDF document programmatically using the `editAnnotation` property. -* Select the annotation comment in the comment panel. -* Click More options in the comment or reply container. -* Select Set Status from the context menu. -* Choose a status for the comment. -* None is the default state. Selecting None clears the status indicator; the comment or reply remains visible. +The following example Shows how to edit comments and reply in response to a button click. -![Edit comments and replies](../images/commentsedit.png) +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component, ViewChild } from '@angular/core'; +import { + PdfViewerComponent, + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    +
    + + +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ] +}) +export class AppComponent { + + @ViewChild('pdfViewer') + public pdfViewer!: PdfViewerComponent; + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public editComment(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'edit'; + annot.note = 'Edited Comment'; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } -### Delete Comment or Comment Replies + public editReply(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'edit'; + annot.replyComment = ['Edited Reply Comment']; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } +} -* Select the annotation comment in the comment panel. -* Click More options in the comment or reply container. -* Select Delete from the context menu. +{% endhighlight %} +{% highlight ts tabtitle="Server-Backed" %} + +import { Component, ViewChild } from '@angular/core'; +import { + PdfViewerComponent, + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    +
    + + +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ] +}) +export class AppComponent { + + @ViewChild('pdfViewer') + public pdfViewer!: PdfViewerComponent; + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public serviceUrl: string = 'YOUR_SERVICE_URL'; + + public editComment(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'edit'; + annot.note = 'Edited Comment'; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } -![Delete comments or replies](../images/commentsdelete.png) + public editReply(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + const annot = viewer.annotationCollection?.[0]; + if (annot) { + annot.commentType = 'edit'; + annot.replyComment = ['Edited Reply Comment']; + viewer.annotation.editAnnotation(annot); + console.log(viewer.annotationCollection?.[0]); + } + } +} -N> Deleting the root comment from the comment panel also deletes the associated annotation. +{% endhighlight %} +{% endtabs %} -## How to check the comments added by the user +### Read comments added by users Comments added to the PDF document can be read using the annotation's `comments` property. The following example logs comments in response to a button click. {% tabs %} -{% highlight html tabtitle="Standalone" %} - -```html - - - - +{% highlight ts tabtitle="Standalone" %} + +import { Component, ViewChild } from '@angular/core'; +import { + PdfViewerComponent, + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    +
    + +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ] +}) +export class AppComponent { + + @ViewChild('pdfViewer') + public pdfViewer!: PdfViewerComponent; + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public checkComments(): void { + const viewer = this.pdfViewer; + if (!viewer) return; + + const annotationCollections = viewer.annotationCollection || []; + for (let x = 0; x < annotationCollections.length; x++) { + console.log('annotation Id : ' + annotationCollections[x].annotationId); + const comments = annotationCollections[x].comments || []; + for (let y = 0; y < comments.length; y++) { + const comment = comments[y]; + console.log('comment[' + y + '] : ' + comment.note); + } + const note = annotationCollections[x].note; + console.log('note : ' + note); + } + } +} -``` -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -```html - - - - - -``` {% endhighlight %} {% endtabs %} +## Annotation and Review Workflow Patterns -```typescript -//Method to check the comments added in the PDF document. -checkComments(){ - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - var annotationCollections = pdfviewer.annotationCollection; - for (var x = 0; x < annotationCollections.length; x++) { - //Prints the annotation id in the console window. - console.log(annotationCollections[x].annotationId); - var comments = annotationCollections[x].comments; - for (var y = 0; y < comments.length; y++) { - var comment = comments[y]; - //Prints the PDF document's comments in the console window. - console.log("comment" + "[" + y + "] :" + comment.note); - } - var note = annotationCollections[x].note; - console.log("note : " + note); - } -} +The PDF Viewer supports review workflows by combining [annotations](../annotation/overview), [comments](../annotation/comments), and threaded [replies](../annotation/comments#add-comments-and-replies). These capabilities help reviewers mark content, discuss changes, and navigate feedback efficiently during document review cycles. + +### Understanding Review Workflows + +Annotations act as visual markers during review—such as [highlights](../annotation/annotation-types/highlight-annotation), [shapes](../annotation/annotation-types/area-annotation), [stamps](../annotation/annotation-types/stamp-annotation), or [sticky notes](../annotation/annotation-types/sticky-notes) while [comments](../annotation/comments) provide a communication space attached to each annotation. Multiple reviewers can participate in these annotation threads, making the review process more organized and traceable. + +During a review cycle, users typically: + +- Add annotations to indicate a change, highlight text, or mark an issue. +![Add Annotations](../images/text_markup_annotation.png) +- Use comments to explain the purpose of the annotation. +![Comments](../images/commentsedit.png) +- Reply to comments to maintain a review discussion thread. +- Navigate between comments and related annotations for clarity. +- Finalize review by addressing or resolving each thread. + +### Using Comments in Review Workflows + +Comments are a key part of review workflows. They allow reviewers to communicate directly on annotations without altering the underlying PDF content. + +Key behaviors in review workflows: + +- Comments allow multiple reviewers to discuss changes directly on annotations. + - Replies help maintain a threaded discussion during review. +- Selecting a comment highlights the related annotation, improving navigation. +- Comments can be combined with Sticky Notes, Highlights, Shapes, Stamps, and other annotation types. + +![Comments panel during review workflow](../images/commentsedit.png) + +### Why Review Workflow Patterns Matter + +Review workflows help teams: + +- Centralize feedback inside the PDF document itself. +- Maintain a clear discussion history on each annotation. +- Avoid duplicated or conflicting feedback. +- Navigate long documents quickly using comment threads. + - Improve clarity when multiple reviewers participate. -``` +These review patterns are especially useful in content editing, design review, legal documentation, product validation, and quality control workflows. -[View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/Annotations/How%20to%20check%20the%20comments) \ No newline at end of file +## See also +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotationsannotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/create-modify-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/create-modify-annotation.md new file mode 100644 index 0000000000..c842d7853c --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/create-modify-annotation.md @@ -0,0 +1,199 @@ +--- +layout: post +title: Create and modify annotations in Angular PDF Viewer | Syncfusion +description: Learn how to create and modify annotations in Syncfusion Angular PDF Viewer with UI and programmatic examples, plus quick links to all annotation types. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Create and modify annotations in Angular PDF Viewer + +The PDF Viewer annotation tools add, edit, and manage markups across documents. This page provides an overview with quick navigation to each annotation type and common creation and modification workflows. + +## Quick navigation to annotation types + +Jump directly to a specific annotation type for detailed usage and examples: + +**TextMarkup annotations:** +- Highlight: [Highlight annotation](./annotation-types/highlight-annotation) +- Strikethrough: [Strikethrough annotation](./annotation-types/strikethrough-annotation) +- Underline: [Underline annotation](./annotation-types/underline-annotation) +- Squiggly: [Squiggly annotation](./annotation-types/Squiggly-annotation) + +**Shape annotations:** +- Line: [Line annotation](./annotation-types/line-annotation) +- Arrow: [Arrow annotation](./annotation-types/arrow-annotation) +- Rectangle: [Rectangle annotation](./annotation-types/rectangle-annotation) +- Circle : [Circle annotation](./annotation-types/circle-annotation) +- Polygon: [Polygon annotation](./annotation-types/polygon-annotation) + +**Measurement annotations:** +- Distance: [Distance annotation](./annotation-types/distance-annotation) +- Perimeter: [Perimeter annotation](./annotation-types/perimeter-annotation) +- Area: [Area annotation](./annotation-types/area-annotation) +- Radius: [Radius annotation](./annotation-types/ra) +- Volume: [Volume annotation](./annotation-types/vo) + +**Other annotations:** +- Redaction: [Redaction annotation](./annotation-types/redaction-annotation) +- Free Text: [Free text annotation](./annotation-types/free-text-annotation) +- Ink (Freehand): [Ink annotation](./annotation-types/ink-annotation) +- Stamp: [Stamp annotation](./annotation-types/stamp-annotation) +- Sticky Notes: [Sticky notes annotation](./annotation-types/sticky-notes-annotation) + +N> Each annotation type page includes both UI steps and programmatic examples specific to that type. + +## Create annotations + +### Create via UI +- Open the annotation toolbar in the PDF Viewer. +- Choose the required tool (for example, Shape, Free text, Ink, Stamp, Redaction). +- Click or drag on the page to place the annotation. + +![Annotation toolbar](../images/shape_toolbar.png) + +**Note:** +- When pan mode is active and a shape or stamp tool is selected, the viewer switches to text select mode automatically. +- Property pickers in the annotation toolbar let users choose color, stroke color, thickness, and opacity while drawing + +### Create programmatically + +Creation patterns vary by type. Refer to the individual annotation pages for tailored code. + +Example: creating a Rectangle annotation using [`addAnnotation`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#addannotation). + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService], + template: ` + + + + ` +}) +export class AppComponent { + public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + private getViewer(): any { + return (document.getElementById('pdfViewer') as any).ej2_instances[0]; + } + + addRedactionAnnotation(): void { + const viewer = this.getViewer(); + viewer.annotation.addAnnotation('Redaction', { + bound: { x: 200, y: 480, width: 150, height: 75 }, + pageNumber: 1, + markerFillColor: '#0000FF', + markerBorderColor: 'white', + fillColor: 'red', + overlayText: 'Confidential', + fontColor: 'yellow', + fontFamily: 'Times New Roman', + fontSize: 8, + beforeRedactionsApplied: false + }); + } +} +{% endhighlight %} +{% endtabs %} + +Refer to the individual annotation pages for enabling draw modes from UI buttons and other type-specific creation samples. + +## Modify annotations + +### Modify via UI + +Use the annotation toolbar after selecting an annotation: +- Edit color: change the fill or text color (when applicable) + +![Edit color](../images/edit_color.png) + +- Edit stroke color: change the border or line color (shape and line types) + +![Edit stroke color](../images/shape_strokecolor.png) + +- Edit thickness: adjust the border or line thickness + +![Edit thickness](../images/shape_thickness.png) + +- Edit opacity: change transparency + +![Edit opacity](../images/shape_opacity.png) + +Additional options such as Line Properties (for line/arrow) are available from the context menu (right-click > Properties) where supported. + +### Modify programmatically + +Use `editAnnotation` to apply changes to an existing annotation. Common flow: +- Locate the target annotation from `annotationCollection`. +- Update the desired properties. +- Call `editAnnotation` with the modified object. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService], + template: ` + + + + ` +}) +export class AppComponent { + public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + private getViewer(): any { + return (document.getElementById('pdfViewer') as any).ej2_instances[0]; + } + + bulkEditAnnotations(): void { + const viewer = this.getViewer(); + for (const ann of viewer.annotationCollection) { + if (ann.author === 'Guest User' && ann.subject === 'Corrections') { + ann.color = '#ff0000'; + ann.opacity = 0.8; + viewer.annotation.editAnnotation(ann); + } + } + } +} +{% endhighlight %} +{% endtabs %} + +N> For type-specific edit examples (for example, editing line endings, moving stamps, or updating sticky note bounds), see the corresponding annotation type page linked above. + +## See also +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Customize Annotation](../annotation/customize-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/custom-data.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/custom-data.md new file mode 100644 index 0000000000..7ae0ad551b --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/custom-data.md @@ -0,0 +1,231 @@ +--- +layout: post +title: Custom Data in annotations in Angular PDF Viewer | Syncfusion +description: Learn here all about how to use add custom Data in annotation in Syncfusion Angular PDF Viewer Component. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Custom data in annotations in Angular + +Annotations can include custom key–value data via the `customData` property. This is supported at two levels: + +- Default level via `annotationSettings`: applies to all annotations created through the UI. +- Per-annotation-type level: provide `customData` inside specific annotation-type settings (for example, `highlightSettings`, `rectangleSettings`). + +The `customData` value can be any JSON-serializable object. It is preserved during annotation export/import and is available at runtime on the annotation object. + +## Default custom data (annotationSettings) + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + // Annotation settings with custom data + public annotationSettings = { + author: 'XYZ', + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + // Custom data applied to all newly created annotations + customData: { + appId: 'pdf-review', + tenant: 'northwind', + featureFlags: { allowShare: true, qaStamp: false } + } + }; +} + +{% endhighlight %} +{% endtabs %} + +## Custom data for Individual Annotation + +Provide customData inside individual annotation-type settings when you want specific payloads for different tools. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + // Text markup settings + public highlightSettings = { author: 'QA', subject: 'Review', color: '#ffff00', opacity: 0.6, customData: { tag: 'needs-review', priority: 'high' } }; + public strikethroughSettings = { author: 'QA', subject: 'Remove', color: '#ff0000', opacity: 0.6, customData: { tag: 'remove', priority: 'medium' } }; + public underlineSettings = { author: 'Guest User', subject: 'Notes', color: '#00ffff', opacity: 0.9, customData: { tag: 'note', owner: 'guest' } }; + public squigglySettings = { author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9, customData: { tag: 'typo' } }; + + // Shape settings + public lineSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, customData: { id: 'ln-1', category: 'connector' } }; + public arrowSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, customData: { id: 'ar-1', category: 'direction' } }; + public rectangleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, customData: { id: 'rect-1', zone: 'content' } }; + public circleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, customData: { id: 'circ-1', zone: 'highlight' } }; + public polygonSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1, customData: { id: 'poly-1', group: 'area' } }; + + // Measurement settings + public distanceSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, customData: { units: 'cm', scale: 1 } }; + public perimeterSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, customData: { units: 'cm', calc: 'perimeter' } }; + public areaSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', customData: { units: 'cm^2', calc: 'area' } }; + public radiusSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', customData: { units: 'cm', calc: 'radius' } }; + public volumeSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00', customData: { units: 'cm^3', calc: 'volume' } }; + + // Other annotation settings + public freeTextSettings = { borderColor: '#222222', opacity: 1, customData: { template: 'comment', mentions: ['qa'] } }; + public inkAnnotationSettings = { strokeColor: '#0000ff', thickness: 3, opacity: 0.8, customData: { tool: 'pen', userId: 12345 } }; + public stampSettings = { opacity: 0.9, customData: { stampType: 'Approved', by: 'Manager' } }; + public stickyNotesSettings = { author: 'QA', subject: 'Review', opacity: 1, customData: { channel: 'inbox', unread: true } }; +} + +{% endhighlight %} +{% endtabs %} + +## Retrieve custom data at runtime + +You can access the customData for any annotation through the viewer's annotationCollection. For example, wire a button click to iterate all annotations and read their custom payloads. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` +
    + + + +
    + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public showCustomData(): void { + const pdfViewer = (document.getElementById('pdfViewer') as any).ej2_instances[0]; + pdfViewer.annotationCollection.forEach((a: any) => { + console.log('Annotation', a.id, 'customData:', a.customData); + }); + } +} + +{% endhighlight %} +{% endtabs %} + +### Note +- `customData` can be any JSON-serializable object and is stored with the annotation. +- Use `annotationSettings.customData` for global defaults and override with per-tool settings as needed. + +[View Sample on GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples) + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotations/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotations/create-modify-annotation) +- [Customize Annotation](../annotations/customize-annotation) +- [Remove Annotation](../annotations/delete-annotation) +- [Handwritten Signature](../annotations/signature-annotation) +- [Export and Import Annotation](../annotations/export-import/export-annotation) +- [Annotation Permission](../annotations/annotation-permission) +- [Annotation in Mobile View](../annotations/annotations-in-mobile-view) +- [Annotation Events](../annotations/annotation-event) +- [Annotation API](../annotations/annotations-api) diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/custom-tools.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/custom-tools.md new file mode 100644 index 0000000000..642793f0b0 --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/custom-tools.md @@ -0,0 +1,186 @@ +--- +layout: post +title: Custom annotation tools in Angular PDF Viewer | Syncfusion +description: Learn how to build a custom toolbar for Syncfusion Angular PDF Viewer and switch annotation tools programmatically using setAnnotationMode. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Custom annotation tools in Angular PDF Viewer + +The PDF Viewer supports adding a custom toolbar and toggling annotation tools programmatically using the `setAnnotationMode` method. The viewer can enable tools such as Highlight, Underline, Rectangle, Circle, Arrow, Free Text, Ink, and measurement annotations (Distance, Perimeter, Area, Radius) + +Follow these steps to build a minimal custom annotation toolbar. + +Step 1: Start from a basic PDF Viewer sample + +Refer to the [Getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started) to create a basic sample. + +Step 2: Add a lightweight custom toolbar with Angular buttons + +Add buttons for the tools to expose. The sample below uses plain Angular buttons for simplicity; replace with a Syncfusion ToolbarComponent for a richer UI if desired. + +Step 3: Import and inject modules + +Ensure the `Annotation` module is injected. Include text selection and search modules if those capabilities are required. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService, TextSelectionService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + template: ` +
    + + + + + + + + + + + + + + + + +
    + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + getViewer() { + return (document.getElementById('container') as any).ej2_instances[0]; + } + + setMode(mode: string) { + this.getViewer().annotation.setAnnotationMode(mode); + } +} +{% endhighlight %} +{% endtabs %} + +## Custom tools using Syncfusion Toolbar for a richer UI + +Replace the plain buttons with a Syncfusion `ToolbarComponent` and icons for a richer UI. Add the `@syncfusion/ej2-angular-navigations` package and wire each item's `clicked` handler to `setAnnotationMode`. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService, TextSelectionService } from '@syncfusion/ej2-angular-pdfviewer'; +import { ToolbarModule, ClickEventArgs } from '@syncfusion/ej2-angular-navigations'; + +@Component({ + selector: 'app-root', + standalone: true, + template: ` + + + + + + + + + + + + + + + + + + + + + + + + + + + `, + imports: [PdfViewerModule, ToolbarModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + private modeMap: { [key: string]: string } = { + annHighlight: 'Highlight', + annUnderline: 'Underline', + annStrike: 'Strikethrough', + annRect: 'Rectangle', + annCircle: 'Circle', + annLine: 'Line', + annArrow: 'Arrow', + annPolygon: 'Polygon', + annFreeText: 'FreeText', + annInk: 'Ink', + annSticky: 'StickyNotes', + annDistance: 'Distance', + annPerimeter: 'Perimeter', + annArea: 'Area', + annRadius: 'Radius', + annNone: 'None' + }; + + getViewer() { + return (document.getElementById('container') as any).ej2_instances[0]; + } + + onToolbarClick(args: ClickEventArgs) { + const mode = this.modeMap[args.item.id]; + if (mode) { + this.getViewer().annotation.setAnnotationMode(mode); + } + } +} +{% endhighlight %} +{% endtabs %} + +Note + +- `setAnnotationMode` accepts the annotation type name. Common values include: `Highlight`, `Underline`, `Strikethrough`, `StickyNotes`, `FreeText`, `Ink`, `Rectangle`, `Circle`, `Line`, `Arrow`, `Polygon`, `Polyline`, `Distance`, `Perimeter`, `Area`, `Radius`, and `None` to exit. +- Default annotation styles can be predefined using the corresponding settings properties (for example, `areaSettings`). + +[View Sample on GitHub](https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples/tree/master) + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotations Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/customize-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/customize-annotation.md new file mode 100644 index 0000000000..22ef177845 --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/customize-annotation.md @@ -0,0 +1,287 @@ +--- +layout: post +title: Customize annotations in Angular PDF Viewer | Syncfusion +description: Learn how to customize PDF annotations in Syncfusion Angular PDF Viewer using UI tools and programmatic settings (defaults and runtime edits). +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Customize annotations in Angular + +Annotation appearance and behavior (for example color, stroke color, thickness, and opacity) can be customized using the built‑in UI or programmatically. This page summarizes common customization patterns and shows how to set defaults per annotation type. + +## Customize via UI + +Use the annotation toolbar after selecting an annotation: +- Edit color: changes the annotation fill/text color +![Edit color](../images/edit_color.png) +- Edit stroke color: changes border or line color for shapes and lines types. +![Edit stroke color](../images/shape_strokecolor.png) +- Edit thickness: adjusts border or line thickness +![Edit thickness](../images/shape_thickness.png) +- Edit opacity: adjusts transparency +![Edit opacity](../images/shape_opacity.png) + +Type‑specific options (for example, Line properties) are available from the context menu (right‑click > Properties) where supported. + +## Set default properties during initialization + +Set defaults for specific annotation types when creating the `PdfViewer` instance. Configure properties such as author, subject, color, and opacity using annotation settings. The examples below reference settings used on the annotation type pages. + +Text markup annotations: + +- Highlight: Set default properties before creating the control using [`highlightSettings`](./annotation-types/highlight-annotation#set-properties-while-adding-individual-annotation) +- Strikethrough: Use [`strikethroughSettings`](./annotation-types/strikethrough-annotation#set-properties-while-adding-individual-annotation) +- Underline: Use [`underlineSettings`](./annotation-types/underline-annotation#set-properties-while-adding-individual-annotation) +- Squiggly: Use [`squigglySettings`](./annotation-types/Squiggly-annotation#set-properties-while-adding-individual-annotation) + +Shape annotations: + +- Line: Use [`lineSettings`](./annotation-types/line-annotation#set-properties-while-adding-individual-annotation) +- Arrow: Use [`arrowSettings`](./annotation-types/arrow-annotation#set-properties-while-adding-individual-annotation) +- Rectangle: Use [`rectangleSettings`](./annotation-types/rectangle-annotation#set-properties-while-adding-individual-annotation) +- Circle: Use [`circleSettings`](./annotation-types/circle-annotation#set-properties-while-adding-individual-annotation) +- Polygon: Use [`polygonSettings`](./annotation-types/polygon-annotation#set-properties-while-adding-individual-annotation) + +Measurement annotations: + +- Distance: Use [`distanceSettings`](./annotation-types/distance-annotation#set-default-properties-during-initialization) +- Perimeter: Use [`perimeterSettings`](./annotation-types/perimeter-annotation#set-default-properties-during-initialization) +- Area: Use [`areaSettings`](./annotation-types/area-annotation#set-default-properties-during-initialization) +- Radius: Use [`radiusSettings`](./annotation-types/radius-annotation#set-default-properties-during-initialization) +- Volume: Use [`volumeSettings`](./annotation-types/volume-annotation#set-default-properties-during-initialization) + +Other Annotations: + +- Redaction: Use [`redactionSettings`](./annotation-types/redaction-annotation#default-redaction-settings-during-initialization) +- Free text: Use [`freeTextSettings`](./annotation-types/free-text-annotation#set-default-properties-during-initialization) +- Ink (freehand): Use [`inkAnnotationSettings`](./annotation-types/ink-annotation#customize-ink-appearance) +- Stamp: Use [`stampSettings`](./annotation-types/stamp-annotation#set-properties-while-adding-individual-annotation) +- Sticky notes: Use [`stickyNotesSettings`](./annotation-types/sticky-notes#set-default-properties-during-initialization) + +Set defaults for specific annotation types when creating the `PdfViewerComponent`. Below are examples using settings already used in the annotation type pages. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService, TextSelectionService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + template: ` + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + // Text markup defaults + public highlightSettings = { author: 'QA', subject: 'Review', color: '#ffff00', opacity: 0.6 }; + public strikethroughSettings = { author: 'QA', subject: 'Remove', color: '#ff0000', opacity: 0.6 }; + public underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9 }; + public squigglySettings = { author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9 }; + + // Shapes + public lineSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }; + public arrowSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }; + public rectangleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1 }; + public circleSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1 }; + public polygonSettings = { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1 }; + + // Measurements + public distanceSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }; + public perimeterSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }; + public areaSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00' }; + public radiusSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00' }; + public volumeSettings = { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00' }; + + // Others + public freeTextSettings = { borderColor: '#222222', thickness: 1, opacity: 1 }; + public inkAnnotationSettings = { color: '#0000ff', thickness: 3, opacity: 0.8 }; + public stampSettings = { opacity: 0.9 }; + public stickyNotesSettings = { author: 'QA', subject: 'Review', color: '#ffcc00', opacity: 1 }; +} +{% endhighlight %} +{% endtabs %} + +N> After changing defaults using UI tools (for example, Edit color or Edit opacity), the updated values apply to subsequent annotations within the same session. + +## Customize programmatically at runtime + +To update an existing annotation from code, modify its properties and call editAnnotation. + +Example: bulk‑update matching annotations. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService, TextSelectionService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + template: ` + + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + getViewer() { + return (document.getElementById('container') as any).ej2_instances[0]; + } + + bulkUpdateAnnotations() { + const viewer = this.getViewer(); + for (const ann of viewer.annotationCollection) { + // Example criteria; customize as needed + if (ann.author === 'Guest' || ann.subject === 'Rectangle') { + ann.color = '#ff0000'; + ann.opacity = 0.8; + // For shapes/lines you can also change strokeColor/thickness when applicable + // ann.strokeColor = '#222222'; + // ann.thickness = 2; + viewer.annotation.editAnnotation(ann); + } + } + } +} +{% endhighlight %} +{% endtabs %} + +## Customize Annotation Settings + +Defines the settings of the annotations. You can change annotation settings like author name, height, width etc., using the [`annotationSettings`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationsettings) property. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService, TextSelectionService, AllowedInteraction } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + template: ` + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public annotationSettings = { + author: 'XYZ', + minHeight: 10, + minWidth: 10, + maxWidth: 100, + maxHeight: 100, + isLock: false, + skipPrint: false, + skipDownload: false, + allowedInteractions: [AllowedInteraction.Select, AllowedInteraction.Move] + }; +} +{% endhighlight %} +{% endtabs %} +## Customize Annotation SelectorSettings + +Defines the settings of annotation selector. You can customize the annotation selector using the [`annotationSelectorSettings`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#annotationselectorsettings) property. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService, TextSelectionService, AnnotationResizerLocation, CursorType } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + template: ` + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public annotationSelectorSettings = { + selectionBorderColor: 'blue', + resizerBorderColor: 'red', + resizerFillColor: '#4070ff', + resizerSize: 8, + selectionBorderThickness: 1, + resizerShape: 'Circle', + selectorLineDashArray: [5, 6], + resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges, + resizerCursorType: CursorType.grab + }; +} +{% endhighlight %} +{% endtabs %} + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/delete-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/delete-annotation.md new file mode 100644 index 0000000000..dab2af2cfe --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/delete-annotation.md @@ -0,0 +1,89 @@ +--- +layout: post +title: Remove annotations in Angular PDF Viewer | Syncfusion +description: Learn how to remove/delete PDF annotations in Syncfusion Angular PDF Viewer using UI options (context menu, toolbar, Delete key) and programmatic APIs. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Remove annotations in Angular + +Annotations can be removed using the built-in UI or programmatically. This page shows common methods to delete annotations in the viewer. + +## Delete via UI + +A selected annotation can be deleted in three ways: + +- Context menu: right-click the annotation and choose Delete. +![Delete via context menu](../../javascript-es6/annotations/annotation-images/delete-annot-context-menu.png) +- Annotation toolbar: select the annotation and click the Delete button on the annotation toolbar. +![Delete via annotation toolbar](../../javascript-es6/annotations/annotation-images/delete-annot.png) +- Keyboard: select the annotation and press the `Delete` key. + +## Delete programmatically + +Annotations can be deleted programmatically either by removing the currently selected annotation or by specifying an annotation id. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { PdfViewerModule, ToolbarService, AnnotationService } from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + template: ` + + + + + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService] +}) +export class AppComponent { + public documentPath: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resourceUrl: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + getViewer() { + return (document.getElementById('pdfViewer') as any).ej2_instances[0]; + } + + deleteAnnotation() { + // Delete the selected annotation + this.getViewer().annotation.deleteAnnotation(); + } + + deleteAnnotationById() { + const viewer = this.getViewer(); + // Delete the first annotation using its id from the annotation collection + if (viewer.annotationCollection.length > 0) { + viewer.annotation.deleteAnnotationById(viewer.annotationCollection[0].id); + } + } +} +{% endhighlight %} +{% endtabs %} + +N> Deleting via the API requires the annotation to exist in the current document. Ensure an annotation is selected when using `deleteAnnotation()`, or pass a valid id to `deleteAnnotationById()`. + +[View Sample on GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples) + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/export-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/export-annotation.md new file mode 100644 index 0000000000..be82c318a1 --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/export-annotation.md @@ -0,0 +1,128 @@ +--- +layout: post +title: Export annotations in Angular PDF Viewer | Syncfusion +description: Learn how to Export annotations in Syncfusion Angular PDF Viewer using UI options and programmatic APIs. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Export annotations in Angular PDF Viewer + +PDF Viewer provides support to export annotations. You can export annotations from the PDF Viewer in two ways: + +- Using the built-in UI in the Comments panel (JSON or XFDF file) +- Programmatically (JSON, XFDF, or as an object for custom handling) + +## Export using the UI (Comments panel) + +The Comments panel provides export actions in its overflow menu: + +- Export annotation to JSON file +- Export annotation to XFDF file + +Follow the steps to export annotations: + +1. Open the Comments panel in the PDF Viewer. +2. Click the overflow menu (three dots) at the top of the panel. +3. Choose Export annotation to JSON file or Export annotation to XFDF file. + +This generates and downloads the selected format containing all annotations in the current document. + +![Export Annotation](../../../javascript-es6/annotations/annotation-images/export-annot.png) + +## Export programmatically + +You can export annotations from code using +[exportAnnotation](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#exportannotation), +[exportAnnotationsAsObject](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#exportannotationsasobject) +and +[exportAnnotationsAsBase64String](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#exportannotationsasbase64string) +APIs. + +Use the following example to initialize the viewer and export annotations as JSON, XFDF, or as an object. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService, + AnnotationDataFormat +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService], + template: ` +
    + + + + +
    + + + ` +}) +export class AppComponent { + public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + private getViewer(): any { + return (document.getElementById('pdfViewer') as any).ej2_instances[0]; + } + + exportAsJSON(): void { + this.getViewer().exportAnnotation(AnnotationDataFormat.Json); + } + + exportAsXFDF(): void { + this.getViewer().exportAnnotation(AnnotationDataFormat.Xfdf); + } + + exportAsObject(): void { + this.getViewer().exportAnnotationsAsObject().then((value: any) => { + console.log('Exported annotation object:', value); + }); + } + + exportAsBase64(): void { + this.getViewer() + .exportAnnotationsAsBase64String(AnnotationDataFormat.Json) + .then((value: string) => { + console.log('Exported Base64:', value); + }); + } +} +{% endhighlight %} +{% endtabs %} + +## Common use cases +- Archive or share annotations as portable JSON/XFDF files +- Save annotations alongside a document in your storage layer +- Send annotations to a backend for collaboration or review workflows +- Export as object for custom serialization and re-import later + +## See also +- [Annotation Overview](../../overview) +- [Annotation Types](../../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../../annotation/create-modify-annotation) +- [Customize Annotation](../../annotation/customize-annotation) +- [Remove Annotation](../../annotation/delete-annotation) +- [Handwritten Signature](../../annotation/signature-annotation) +- [Import Annotation](../export-import/import-annotation) +- [Import Export Events](../export-import/export-import-events) +- [Annotation Permission](../../annotation/annotation-permission) +- [Annotation in Mobile View](../../annotation/annotations-in-mobile-view) +- [Annotation Events](../../annotation/annotation-event) +- [Annotation API](../../annotation/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/export-import-events.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/export-import-events.md new file mode 100644 index 0000000000..7f51b3dbb5 --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/export-import-events.md @@ -0,0 +1,143 @@ +--- +layout: post +title: Import/Export events in Angular PDF Viewer | Syncfusion +description: Learn how to handle Import/Export events for PDF Annotations in the Syncfusion Angular PDF Viewer component. +platform: document-processing +control: PDF Viewer +documentation: ug +--- + +# Import/Export events in Angular PDF Viewer + +Import/export events let developers monitor and control annotation data as it flows into and out of the PDF Viewer. These events enable validation, progress reporting, audit logging, and conditional blocking of import/export operations. + +Common use cases: +- Progress UI and user feedback +- Validation and sanitization of imported annotation data +- Audit logging and telemetry +- Blocking or altering operations based on business rules + +Each event exposes typed event-args: `ImportStartEventArgs`, `ImportSuccessEventArgs`, `ImportFailureEventArgs`, `ExportStartEventArgs`, `ExportSuccessEventArgs`, and `ExportFailureEventArgs` that describe the operation context. + +## Import events +- [`importStart`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#importstart): Triggers when an import operation starts. +- [`importSuccess`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#importsuccess): Triggers when annotations are successfully imported. +- [`importFailed`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#importfailed): Triggers when importing annotations fails. + +## Handle import events + +Example: handle import events by wiring event bindings on the Angular PDF Viewer component. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService], + template: ` + + + ` +}) +export class AppComponent { + public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + onImportStart(args: any): void { + console.log('Import started', args); + } + + onImportSuccess(args: any): void { + console.log('Import success', args); + } + + onImportFailed(args: any): void { + console.error('Import failed', args); + } +} +{% endhighlight %} +{% endtabs %} + +## Export events +- [`exportStart`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#exportstart): Triggers when an export operation starts. +- [`exportSuccess`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#exportsuccess): Triggers when annotations are successfully exported. +- [`exportFailed`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#exportfailed): Triggers when exporting annotations fails. + +## Handle export events + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService], + template: ` + + + ` +}) +export class AppComponent { + public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + onExportStart(args: any): void { + console.log('Export started', args); + } + + onExportSuccess(args: any): void { + console.log('Export success', args); + } + + onExportFailed(args: any): void { + console.error('Export failed', args); + } +} +{% endhighlight %} +{% endtabs %} + +N> `importStart`, `importSuccess`, and `importFailed` cover the lifecycle of annotation imports; `exportStart`, `exportSuccess`, and `exportFailed` cover the lifecycle of annotation exports. + +## See also +- [Annotation Overview](../../overview) +- [Annotation Types](../../annotations/annotation-types/area-annotation) +- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../../annotations/create-modify-annotation) +- [Customize Annotation](../../annotations/customize-annotation) +- [Remove Annotation](../../annotations/delete-annotation) +- [Handwritten Signature](../../annotations/signature-annotation) +- [Export Annotation](../export-import/export-annotation) +- [Import Annotation](../export-import/import-annotation) +- [Annotation Permission](../../annotations/annotation-permission) +- [Annotation in Mobile View](../../annotations/annotations-in-mobile-view) +- [Annotation Events](../../annotations/annotation-event) +- [Annotation API](../../annotations/annotations-api) diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/import-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/import-annotation.md new file mode 100644 index 0000000000..d622bab52b --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/export-import/import-annotation.md @@ -0,0 +1,113 @@ +--- +layout: post +title: Import annotations in Angular PDF Viewer | Syncfusion +description: Learn how to import annotations in Syncfusion Angular PDF Viewer using UI options and programmatic APIs. +platform: document-processing +control: PDF Viewer +documentation: ug +--- + +# Import annotations in Angular PDF Viewer + +Annotations can be imported into the PDF Viewer using the built-in UI or programmatically. +The UI accepts JSON and XFDF files from the Comments panel; programmatic import accepts an annotation object previously exported by the viewer. + +## Import using the UI (Comments panel) + +The Comments panel provides import options in its overflow menu: + +- Import annotations from JSON file +- Import annotations from XFDF file + +Steps: +1. Open the Comments panel in the PDF Viewer. +2. Click the overflow menu (three dots) at the top of the panel. +3. Choose the appropriate import option and select the file. + +All annotations in the selected file are applied to the current document. + +![Import Annotation](../../../javascript-es6/annotations/annotation-images/import-annot.png) + +## Import programmatically (from object) + +Import annotations from an object previously exported using `exportAnnotationsAsObject()`. +Only objects produced by the viewer can be re-imported with the +[`importAnnotation`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#importannotation) +API. + +Example: export annotations as an object and import them back into the viewer. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService], + template: ` + + + + + + ` +}) +export class AppComponent { + public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + private exportedObject: any = null; + + private getViewer(): any { + return (document.getElementById('pdfViewer') as any).ej2_instances[0]; + } + + exportAsObject(): void { + this.getViewer().exportAnnotationsAsObject().then((value: any) => { + console.log('Exported annotation object:', value); + this.exportedObject = value; + }); + } + + importFromObject(): void { + if (this.exportedObject) { + this.getViewer().importAnnotation(JSON.parse(this.exportedObject)); + } + } +} +{% endhighlight %} +{% endtabs %} + +N> Only objects produced by the viewer (for example, by `exportAnnotationsAsObject()`) are compatible with `importAnnotation`. Persist exported objects in a safe storage location (database or API) and validate them before import. + +## Common use cases +- Restore annotations saved earlier (for example, from a database or API) +- Apply reviewer annotations shared as JSON/XFDF files via the Comments panel +- Migrate or merge annotations between documents or sessions +- Support collaborative workflows by reloading team annotations + +## See also +- [Annotation Overview](../../overview) +- [Annotation Types](../../annotations/annotation-types/area-annotation) +- [Annotation Toolbar](../../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../../annotations/create-modify-annotation) +- [Customize Annotation](../../annotations/customize-annotation) +- [Remove Annotation](../../annotations/delete-annotation) +- [Handwritten Signature](../../annotations/signature-annotation) +- [Export Annotation](../export-import/export-annotation) +- [Import Export Events](../export-import/export-import-events) +- [Annotation Permission](../../annotations/annotation-permission) +- [Annotation in Mobile View](../../annotations/annotations-in-mobile-view) +- [Annotation Events](../../annotations/annotation-event) +- [Annotation API](../../annotations/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/flatten-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/flatten-annotation.md new file mode 100644 index 0000000000..b84c075ef1 --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/flatten-annotation.md @@ -0,0 +1,138 @@ +--- +layout: post +title: Flatten Annotations in the Syncfusion Angular PDF Viewer +description: Learn how all about how to flatten annotations and formfields before saving a PDF in the Syncfusion Angular PDF Viewer. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Flatten Annotations in Angular PDF Viewer + +Flattening takes the visual appearance of annotations and embeds them into each page's content stream. The visual result remains visible, but the annotation objects and interactive form field structures are removed or converted so they can no longer be selected, edited, or filled. + +Flattening annotations permanently merges them into the PDF content. Once flattened: +- Annotations are **no longer editable** in any PDF viewer. +- Useful for **secure sharing**, preventing modifications. +- Ideal when **finalizing markup** before distribution. + +## How to Flatten Annotations + +You can flatten annotations either when a document is loaded (preprocessing) or when exporting/saving the file. Flattening on load makes the viewer display a flattened version immediately; flattening on export preserves the original viewer session while producing a flattened output file. + +Typical export-time steps: +- Save the viewer contents to a Blob. +- Create a `PdfDocument` from the saved bytes. +- Enable `document.flatten = true` to merge annotations and form field appearances. +- Save the resulting PDF. + +Use the example below to flatten at export time (on download). + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component, ViewChild } from '@angular/core'; +import { + PdfViewerComponent, + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + AnnotationService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; +import { PdfDocument } from '@syncfusion/ej2-pdf'; + +@Component({ + selector: 'app-root', + template: ` +
    + + + +
    + `, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + AnnotationService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ] +}) +export class AppComponent { + + @ViewChild('pdfViewer') + public pdfViewer!: PdfViewerComponent; + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public flattenPdf(): void { + this.pdfViewer.saveAsBlob().then((value: Blob) => { + const reader = new FileReader(); + reader.onloadend = () => { + const arrayBuffer = reader.result as ArrayBuffer; + const byteArray = new Uint8Array(arrayBuffer); + const document = new PdfDocument(byteArray); + // Flatten all annotations and form fields: this embeds appearances + // into the page content so annotations are no longer interactive. + document.flatten = true; + document.save('flattened.pdf'); + }; + reader.readAsArrayBuffer(value); + }); + } +} + +{% endhighlight %} +{% endtabs %} + +N> To flatten documents when they are uploaded/loaded into the viewer, see [Flatten on Load](../document-handling/preprocess-pdf#flatten-on-load). + + +## Notes + +- Flattening applies to **all annotation types**: text markup, shapes, stamps, notes, ink, and form fields. +- Once flattened, annotations **cannot be edited or removed**. +- Use flattening **only at export time**, not during regular document interactions. + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/line-angle-constraints.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/line-angle-constraints.md index 9c058dab7c..8d1c13acad 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/line-angle-constraints.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/line-angle-constraints.md @@ -1,146 +1,144 @@ --- layout: post title: Line angle constraints in Angular PDF Viewer | Syncfusion -description: Programmatically manage text markup annotations like highlight, underline, strikethrough, and squiggly in your PDF documents. -description: Learn all about Line Angle Constraints Annotation in the Syncfusion Angular PDF Viewer component of Essential JS 2 and more. +description: Learn how to enable and configure line angle constraints for line-type annotations in the Syncfusion Angular PDF Viewer. platform: document-processing -control: Line Angle Constraints +control: PDF Viewer documentation: ug +domainurl: ##DomainURL## --- # Line angle constraints in Angular PDF Viewer -The PDF Viewer control provides angle-constraint functionality for line-type annotations. When enabled, drawing operations snap to configured angle increments, improving accuracy and consistency for technical drawings and measurements. +The PDF Viewer provides line angle constraints functionality that allows drawing line-type annotations with controlled angle snapping. This improves precision for technical drawings and measurements in PDF documents. + +![Line angle constraint](../../javascript-es6/annotations/annotation-images/line-angle-constraint.gif) ## Enable line angle constraints -Configure the `enableLineAngleConstraints` property within `annotationDrawingOptions`. When enabled, supported line-type annotations snap to fixed angles. - -The following code demonstrates how to enable line angle constraints: - -```html - -
    -
    - -
    -
    -``` - -```typescript -import { Component, ViewEncapsulation, OnInit,ViewChild} from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, MagnificationService, ThumbnailViewService, ToolbarService, NavigationService, TextSearchService, TextSelectionService, PrintService, AnnotationService, FormFieldsService, FormDesignerService, PageOrganizerService,PdfViewerModule, TextSelectionStartEventArgs, AnnotationSelectEventArgs } from '@syncfusion/ej2-angular-pdfviewer'; -import { SwitchComponent, SwitchModule } from '@syncfusion/ej2-angular-buttons'; -import { ClickEventArgs } from '@syncfusion/ej2-buttons'; - - -/** -* Default PdfViewer Controller -*/ + +Set the `enableLineAngleConstraints` property within `annotationDrawingOptions` to enable angle snapping for supported line-type annotations. + +The following code demonstrates enabling line angle constraints: + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} + +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + TextSelectionService +} from '@syncfusion/ej2-angular-pdfviewer'; + @Component({ - selector: 'app-root', - templateUrl: 'app.html', - encapsulation: ViewEncapsulation.None, - // tslint:disable-next-line:max-line-length - providers: [LinkAnnotationService, BookmarkViewService, MagnificationService, ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, AnnotationService, FormFieldsService, FormDesignerService,PageOrganizerService], - styleUrls: ['app.css'], - standalone: true, - imports: [ - - SwitchModule, - PdfViewerModule, - - ], + selector: 'app-root', + template: ` +
    + + +
    + `, + imports: [PdfViewerModule], + providers: [ToolbarService, AnnotationService, TextSelectionService] }) - export class AppComponent { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent | undefined; - - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource:string = "https://cdn.syncfusion.com/ej2/31.1.17/dist/ej2-pdfviewer-lib"; - public annotationDrawingOptions = { - enableLineAngleConstraints: true, - restrictLineAngleTo: 90 + + public document: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resource: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + public annotationDrawingOptions = { + enableLineAngleConstraints: true, + restrictLineAngleTo: 90 }; - ngOnInit(): void { - // ngOnInit function - } } -``` -## Configuration Properties +{% endhighlight %} +{% endtabs %} -### enableLineAngleConstraints - -The `enableLineAngleConstraints` property activates angle snapping for line-based annotations. When set to `true`, the following annotation types snap to fixed angles as defined by `restrictLineAngleTo`: +## Work with constrained annotations -- Lines -- Arrows -- Polygon -- Distance measurements -- Perimeter measurements -- Area measurements -- Volume measurements +### Drawing behavior -**Key benefits:** +When line angle constraints are enabled: -- Automatic angle snapping while drawing -- Improved precision for technical drawings and measurements -- Desktop behavior: hold Shift while drawing to toggle constraints (if constraints are disabled, Shift temporarily enables snapping; if enabled, Shift enforces snapping) -- Real-time visual feedback during drawing +- Start drawing a supported annotation (Line, Arrow, Polyline, Distance, or Perimeter). +- The segment snaps to the nearest allowed angle. +- A visual indicator reflects snapping in real time. +- Release to complete the annotation. -### restrictLineAngleTo +### Keyboard shortcuts -Specifies the angle increment (in degrees) used for snapping. The default increment is 45°. +- `Shift` + drag: toggles snapping. If constraints are disabled, `Shift` temporarily enables them; if enabled, `Shift` enforces snapping. -Angle snapping behavior: +### Selector-based modifications -- The initial drawing direction is treated as the 0° reference point. -- Snapped angles are calculated by adding the increment to the reference direction. -- If the increment does not divide 360 evenly, angles continue wrapping after 360°. +When modifying existing line annotations using selectors: -Examples: +- Constraints apply based on the original line direction. +- The reference angle (0°) is determined by the line’s current orientation. +- Constraint snapping during modification is supported for Line and Arrow. +- Adjustments snap to the configured angle increment. -- `restrictLineAngleTo: 45` → snapped angles: 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°, 360° -- `restrictLineAngleTo: 100` → snapped angles: 0°, 100°, 200°, 300°, 360° +[View a sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to) -## Work with constrained annotations +## Configuration properties -### Drawing behavior +### enableLineAngleConstraints -When angle constraints are enabled: +The `enableLineAngleConstraints` property activates angle snapping for line-based annotations. When set to `true`, the following annotation types will snap to fixed angles as defined by the `restrictLineAngleTo` property: -- Begin drawing a supported annotation (Line, Arrow, Polyline, Distance, or Perimeter). -- The segment snaps to the nearest allowed angle according to `restrictLineAngleTo`. -- A visual indicator displays the current snapping angle in real time. -- Release to finalize the annotation. +- Lines +- Arrows +- Polygon +- Distance measurements +- Perimeter measurements +- Area measurements +- Volume measurements -### Keyboard shortcuts +Key Benefits: -Desktop platforms: +- Automatic angle snapping during drawing +- Enhanced precision for technical drawings and measurements +- Desktop behavior: hold `Shift` while drawing to toggle constraints (when disabled, `Shift` temporarily enables; when enabled, `Shift` enforces snapping) +- Real-time visual feedback showing angle snapping behavior -- `Shift` + drag: toggles snapping during the drag operation. If constraints are disabled, `Shift` temporarily enables snapping; if enabled, `Shift` enforces snapping. +### restrictLineAngleTo -### Modifying constrained annotations +Defines the angle increment (in degrees) used to constrain supported annotations. The default is 45. -When editing existing line annotations with selectors: +Angle snapping rules: -- Constraints apply relative to the annotation's current orientation (the line's direction is the 0° reference). -- Constraint snapping during modification is supported for Line and Arrow annotations. -- Adjustments snap according to the configured `restrictLineAngleTo` increment. +- The initial drawing direction is treated as the 0° reference point. +- Snapped angles are calculated based on the increment. +- If the increment does not divide 360 evenly, angles reset after 360°. -[View a sample in GitHub] https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to +Examples: -N> Refer to the Angular PDF Viewer [feature tour](https://www.syncfusion.com/pdf-viewer-sdk/angular-pdf-viewer) for highlights. See additional [Angular PDF Viewer examples](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples) +- `restrictLineAngleTo: 45` → Snapped angles: 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°, 360° +- `restrictLineAngleTo: 100` → Snapped angles: 0°, 100°, 200°, 300°, 360° + +N> Refer to the Angular PDF Viewer [feature tour](https://www.syncfusion.com/pdf-viewer-sdk/angular-pdf-viewer) for feature highlights, and to the [Angular PDF Viewer examples](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples) for rendering and configuration examples. + +## See also + +- [Annotation Overview](../overview) +- [Annotation Types](../annotations/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotations/create-modify-annotation) +- [Customize Annotation](../annotations/customize-annotation) +- [Remove Annotation](../annotations/delete-annotation) +- [Handwritten Signature](../annotations/signature-annotation) +- [Export and Import Annotation](../annotations/export-import/export-annotation) +- [Annotation Permission](../annotations/annotation-permission) +- [Annotation in Mobile View](../annotations/annotations-in-mobile-view) +- [Annotation Events](../annotations/annotation-event) +- [Annotation API](../annotations/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/overview.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/overview.md new file mode 100644 index 0000000000..5be550069c --- /dev/null +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/overview.md @@ -0,0 +1,51 @@ +--- +layout: post +title: Overview of Annotation in Angular PDF Viewer | Syncfusion +description: Learn about Annotations and how to add, edit, delete, and configure Annotations in the Syncfusion Angular PDF Viewer. +platform: document-processing +control: PDF Viewer +documentation: ug +domainurl: ##DomainURL## +--- + +# Annotations overview in Angular + +Annotations in the PDF Viewer are interactive elements that allow users to add notes, highlights, or text boxes directly to a PDF document. These annotations add context and feedback to PDF files, simplifying collaboration during document reviews. + +The PDF Viewer provides a complete set of annotation tools for reviewing, measuring, and marking up PDFs in Angular. + +## Supported annotations + +- Text markup: [Highlight](../annotation/annotation-types/highlight-annotation), [Underline](../annotation/annotation-types/underline-annotation), [Squiggly](../annotation/annotation-types/Squiggly-annotation), [Strikethrough](../annotation/annotation-types/strikethrough-annotation) +- Shapes: [Line](../annotation/annotation-types/line-annotation), [Arrow](../annotation/annotation-types/arrow-annotation), [Rectangle](../annotation/annotation-types/rectangle-annotation), [Circle](../annotation/annotation-types/circle-annotation), [Polygon](../annotation/annotation-types/polygon-annotation) +- Text boxes: [Free Text](../annotation/annotation-types/free-text-annotation) +- Drawing: [Ink](../annotation/annotation-types/ink-annotation) (freehand) +- Stamps: [Standard and custom stamps](../annotation/annotation-types/stamp-annotation) +- Notes: [Sticky Notes](../annotation/annotation-types/sticky-notes-annotation) (comments) +- Redaction: Mark and apply [redactions](../annotation/annotation-types/redaction-annotation) +- Measurement: [Distance](../annotation/annotation-types/distance-annotation), [Perimeter](../annotation/annotation-types/perimeter-annotation), [Area](../annotation/annotation-types/area-annotation), [Radius](../annotation/annotation-types/radius-annotation), [Volume](../annotation/annotation-types/volume-annotation) + +## Annotation manipulation capabilities + +- [Create annotations](../annotation/create-modify-annotation): Use the toolbar, context menu, or APIs to add highlights, notes, shapes, and more directly onto the PDF document. +- [Edit annotations](../annotation/create-modify-annotation.md): Modify existing annotations by moving, resizing, or updating text and style properties like color, opacity, and thickness. +- [Customize annotations](../annotation/customize-annotation): Adjust appearance and behavior—such as fonts, fill colors, and opacity—through the UI or configuration options. +- [Undo and redo annotations](../annotation/annotations-undo-redo): Revert or reapply annotation actions (add, edit, delete) using toolbar buttons or corresponding APIs. +- [Import and export annotations](../annotation/export-import/export-annotation): Save and load annotations in JSON or XFDF formats to persist markups across sessions or share them with others. +- Set [Permissions](../annotation/annotation-permission): Enable or disable annotation permission, ensuring compliance with document permissions. +- Add and manage [comments](../annotation/comments): Insert, edit, and delete comments or sticky notes attached to annotations for clearer feedback and collaboration. + +## See also + +- [Annotation Types](../annotation/annotation-types) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Handwritten Signature](../annotation/signature-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation Undo Redo](../annotation/annotations-undo-redo) +- [Annotation API](../annotation/annotations-api) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/signature-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/signature-annotation.md index f6c948d14f..225a6e233f 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/signature-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/signature-annotation.md @@ -12,28 +12,183 @@ domainurl: ##DomainURL## The PDF Viewer control supports adding handwritten signatures to a PDF document. Handwritten signatures reduce paperwork and enable digital verification. -## Adding a handwritten signature to the PDF document +## Add signature annotation -Add a handwritten signature using the annotation toolbar. +### Adding a handwritten signature in UI -* Open the annotation toolbar by clicking the **Edit Annotation** button on the PDF Viewer toolbar. -* Select the **HandWritten Signature** button in the annotation toolbar to open the signature panel. +The handwritten signature can be added to the PDF document using the annotation toolbar. -![Handwritten signature button and panel](../images/handwritten_sign.png) +- Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. +- Select the **Handwritten signature** button in the annotation toolbar. The signature panel appears. -* Draw the signature in the panel. +![Open the handwritten signature panel](../../react/images/select_sign.png) -![Draw a signature in the signature panel](../images/signature_panel.png) +- Draw the signature in the panel. -* Click **Create**, move the signature, and place it at the desired location. +![Draw the handwritten signature](../../react/images/add_sign.png) -![Place the handwritten signature on the page](../images/signature_added.png) +- Click **Create**, move the signature, and place it at the desired location. -## Adding a handwritten signature to the PDF document Programmatically +![Place the handwritten signature on the page](../../react/images/create_sign.png) -With the PDF Viewer library, you can programmatically add a handwritten signature to the PDF Viewer control using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotation) method. +Refer to the following code sample to switch to the handwritten signature mode programmatically. -Here is an example of using the `addAnnotation()` method to add a handwritten signature programmatically +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ], + template: ` +
    + + +
    + + +
    +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + /** Switch to Handwritten Signature annotation mode */ + handWrittenSignature(): void { + const viewer = (document.getElementById('pdfViewer') as any) + ?.ej2_instances?.[0]; + + if (viewer) { + viewer.annotation.setAnnotationMode('HandWrittenSignature'); + } + } +} +{% endhighlight %} +{% highlight ts tabtitle="Server-Backed" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ], + template: ` +
    + + +
    + + +
    +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public serviceUrl: string = + 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; + + /** Switch to Handwritten Signature annotation mode */ + handWrittenSignature(): void { + const viewer = (document.getElementById('pdfViewer') as any) + ?.ej2_instances?.[0]; + + if (viewer) { + viewer.annotation.setAnnotationMode('HandWrittenSignature'); + } + } +} +{% endhighlight %} +{% endtabs %} + +### Add a handwritten signature programmatically + +With the PDF Viewer library, you can programmatically add a handwritten signature to the PDF Viewer control using the [**addAnnotation()**](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotation) method. + +Here is an example of adding a handwritten signature programmatically using the `addAnnotation()` method: {% tabs %} {% highlight ts tabtitle="Standalone" %} @@ -78,7 +233,7 @@ export class AppComponent implements OnInit { displayMode: DisplayMode.Draw }, canSave: true, - path: '[{\"command\":\"M\",\"x\":244.83334350585938,\"y\":982.0000305175781},{\"command\":\"L\",\"x\":244.83334350585938,\"y\":982.0000305175781},{\"command\":\"L\",\"x\":250.83334350585938,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":946.0000305175781},{\"command\":\"L\",\"x\":254.16668701171875,\"y\":940.6667175292969},{\"command\":\"L\",\"x\":256.8333435058594,\"y\":931.3333435058594},{\"command\":\"L\",\"x\":257.5,\"y\":929.3333435058594},{\"command\":\"L\",\"x\":258.8333435058594,\"y\":926.6667175292969},{\"command\":\"L\",\"x\":259.5,\"y\":924.0000305175781},{\"command\":\"L\",\"x\":259.5,\"y\":922.6667175292969},{\"command\":\"L\",\"x\":258.8333435058594,\"y\":922.0000305175781},{\"command\":\"L\",\"x\":258.16668701171875,\"y\":922.0000305175781},{\"command\":\"L\",\"x\":256.8333435058594,\"y\":922.0000305175781},{\"command\":\"L\",\"x\":256.16668701171875,\"y\":922.6667175292969},{\"command\":\"L\",\"x\":254.83334350585938,\"y\":923.3333435058594},{\"command\":\"L\",\"x\":254.16668701171875,\"y\":923.3333435058594},{\"command\":\"L\",\"x\":253.5,\"y\":923.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":925.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":927.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":936.0000305175781},{\"command\":\"L\",\"x\":253.5,\"y\":940.6667175292969},{\"command\":\"L\",\"x\":254.83334350585938,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":260.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":264.16668701171875,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":274.16668701171875,\"y\":958.6667175292969},{\"command\":\"L\",\"x\":278.16668701171875,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":281.5,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":285.5,\"y\":964.6667175292969},{\"command\":\"L\",\"x\":286.8333740234375,\"y\":967.3333435058594},{\"command\":\"L\",\"x\":286.8333740234375,\"y\":970.0000305175781},{\"command\":\"L\",\"x\":282.8333740234375,\"y\":978.6667175292969},{\"command\":\"L\",\"x\":278.16668701171875,\"y\":983.3333435058594},{\"command\":\"L\",\"x\":266.16668701171875,\"y\":991.3333435058594},{\"command\":\"L\",\"x\":259.5,\"y\":993.3333435058594},{\"command\":\"L\",\"x\":252.16668701171875,\"y\":994.0000305175781},{\"command\":\"L\",\"x\":240.83334350585938,\"y\":991.3333435058594},{\"command\":\"L\",\"x\":236.16668701171875,\"y\":988.6667175292969},{\"command\":\"L\",\"x\":230.16668701171875,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":228.83334350585938,\"y\":980.6667175292969},{\"command\":\"L\",\"x\":228.16668701171875,\"y\":978.6667175292969},{\"command\":\"L\",\"x\":228.83334350585938,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":230.16668701171875,\"y\":973.3333435058594},{\"command\":\"L\",\"x\":236.16668701171875,\"y\":971.3333435058594},{\"command\":\"L\",\"x\":240.83334350585938,\"y\":971.3333435058594},{\"command\":\"L\",\"x\":246.16668701171875,\"y\":972.0000305175781},{\"command\":\"L\",\"x\":257.5,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":262.8333435058594,\"y\":976.0000305175781},{\"command\":\"L\",\"x\":269.5,\"y\":977.3333435058594},{\"command\":\"L\",\"x\":276.16668701171875,\"y\":978.6667175292969},{\"command\":\"L\",\"x\":279.5,\"y\":978.0000305175781},{\"command\":\"L\",\"x\":285.5,\"y\":976.6667175292969},{\"command\":\"L\",\"x\":288.16668701171875,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":292.8333740234375,\"y\":969.3333435058594},{\"command\":\"L\",\"x\":293.5,\"y\":966.6667175292969},{\"command\":\"L\",\"x\":294.16668701171875,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":293.5,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":293.5,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":292.8333740234375,\"y\":956.6667175292969},{\"command\":\"L\",\"x\":291.5,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":291.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":291.5,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":291.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":292.16668701171875,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":292.8333740234375,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":294.16668701171875,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":295.5,\"y\":964.6667175292969},{\"command\":\"L\",\"x\":297.5,\"y\":969.3333435058594},{\"command\":\"L\",\"x\":298.8333740234375,\"y\":970.6667175292969},{\"command\":\"L\",\"x\":301.5,\"y\":970.0000305175781},{\"command\":\"L\",\"x\":304.16668701171875,\"y\":968.6667175292969},{\"command\":\"L\",\"x\":305.5,\"y\":966.0000305175781},{\"command\":\"L\",\"x\":308.8333740234375,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":310.16668701171875,\"y\":957.3333435058594},{\"command\":\"L\",\"x\":310.8333740234375,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":310.8333740234375,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":310.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":311.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":312.8333740234375,\"y\":959.3333435058594},{\"command\":\"L\",\"x\":316.16668701171875,\"y\":968.0000305175781},{\"command\":\"L\",\"x\":317.5,\"y\":972.6667175292969},{\"command\":\"L\",\"x\":318.16668701171875,\"y\":977.3333435058594},{\"command\":\"L\",\"x\":319.5,\"y\":983.3333435058594},{\"command\":\"L\",\"x\":319.5,\"y\":986.0000305175781},{\"command\":\"L\",\"x\":319.5,\"y\":988.0000305175781},{\"command\":\"L\",\"x\":318.8333740234375,\"y\":988.0000305175781},{\"command\":\"L\",\"x\":318.16668701171875,\"y\":988.6667175292969},{\"command\":\"L\",\"x\":316.16668701171875,\"y\":987.3333435058594},{\"command\":\"L\",\"x\":314.8333740234375,\"y\":985.3333435058594},{\"command\":\"L\",\"x\":314.16668701171875,\"y\":980.6667175292969},{\"command\":\"L\",\"x\":314.8333740234375,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":316.16668701171875,\"y\":969.3333435058594},{\"command\":\"L\",\"x\":319.5,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":320.16668701171875,\"y\":957.3333435058594},{\"command\":\"L\",\"x\":321.5,\"y\":955.3333435058594},{\"command\":\"L\",\"x\":322.16668701171875,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":322.8333740234375,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":324.16668701171875,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":324.8333740234375,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":326.8333740234375,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":328.16668701171875,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":328.8333740234375,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":329.5,\"y\":962.0000305175781},{\"command\":\"L\",\"x\":330.16668701171875,\"y\":962.0000305175781},{\"command\":\"L\",\"x\":330.16668701171875,\"y\":962.6667175292969},{\"command\":\"L\",\"x\":330.16668701171875,\"y\":962.0000305175781},{\"command\":\"L\",\"x\":330.8333740234375,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":331.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":332.8333740234375,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":333.5,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":334.8333740234375,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":335.5,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":336.16668701171875,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":337.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":338.8333740234375,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":340.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":341.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":342.8333740234375,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":344.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":346.8333740234375,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":349.5,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":350.8333740234375,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":351.5,\"y\":946.6667175292969},{\"command\":\"L\",\"x\":352.8333740234375,\"y\":944.0000305175781},{\"command\":\"L\",\"x\":352.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":354.8333740234375,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":354.8333740234375,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":946.6667175292969},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":355.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":356.16668701171875,\"y\":957.3333435058594},{\"command\":\"L\",\"x\":358.16668701171875,\"y\":959.3333435058594},{\"command\":\"L\",\"x\":360.16668701171875,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":364.16668701171875,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":370.8333740234375,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":373.5,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":375.5,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":376.16668701171875,\"y\":933.3333435058594},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":931.3333435058594},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":930.0000305175781},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":929.3333435058594},{\"command\":\"L\",\"x\":376.16668701171875,\"y\":930.0000305175781},{\"command\":\"L\",\"x\":375.5,\"y\":932.0000305175781},{\"command\":\"L\",\"x\":375.5,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":374.8333740234375,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":374.8333740234375,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":375.5,\"y\":966.0000305175781},{\"command\":\"L\",\"x\":377.5,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":378.16668701171875,\"y\":977.3333435058594},{\"command\":\"L\",\"x\":380.8333740234375,\"y\":981.3333435058594},{\"command\":\"L\",\"x\":382.16668701171875,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":383.5,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":387.5,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":389.5,\"y\":980.6667175292969},{\"command\":\"L\",\"x\":392.16668701171875,\"y\":976.6667175292969},{\"command\":\"L\",\"x\":392.8333740234375,\"y\":973.3333435058594},{\"command\":\"L\",\"x\":392.16668701171875,\"y\":970.0000305175781},{\"command\":\"L\",\"x\":388.8333740234375,\"y\":965.3333435058594},{\"command\":\"L\",\"x\":385.5,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":382.8333740234375,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":377.5,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":375.5,\"y\":964.6667175292969},{\"command\":\"L\",\"x\":373.5,\"y\":965.3333435058594},{\"command\":\"L\",\"x\":374.8333740234375,\"y\":963.3333435058594},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":382.16668701171875,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":384.16668701171875,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":387.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":388.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":388.16668701171875,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":388.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":388.8333740234375,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":389.5,\"y\":959.3333435058594},{\"command\":\"L\",\"x\":389.5,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":390.16668701171875,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":390.8333740234375,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":393.5,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":396.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":398.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":400.16668701171875,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":400.16668701171875,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":400.8333740234375,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":400.8333740234375,\"y\":947.3333435058594},{\"command\":\"L\",\"x\":401.5,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":402.16668701171875,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":403.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":404.8333740234375,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":406.16668701171875,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":407.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":410.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":412.16668701171875,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":940.6667175292969},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":938.0000305175781},{\"command\":\"L\",\"x\":415.5,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":418.8333740234375,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":420.16668701171875,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":421.5,\"y\":946.6667175292969},{\"command\":\"L\",\"x\":422.8333740234375,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":423.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":423.5,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":422.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":421.5,\"y\":955.3333435058594},{\"command\":\"L\",\"x\":421.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":422.16668701171875,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":422.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":424.8333740234375,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":425.5,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":428.16668701171875,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":429.5,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":430.16668701171875,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":432.8333740234375,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":434.8333740234375,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":437.5,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":440.16668701171875,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":441.5,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":442.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":941.3333435058594},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":946.0000305175781},{\"command\":\"L\",\"x\":443.5,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":444.16668701171875,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":445.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":447.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":450.16668701171875,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":452.16668701171875,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":453.5,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":452.8333740234375,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":452.16668701171875,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":450.8333740234375,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":448.8333740234375,\"y\":936.0000305175781},{\"command\":\"L\",\"x\":447.5,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":446.16668701171875,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":445.5,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":445.5,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":446.16668701171875,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":446.8333740234375,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":452.16668701171875,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":454.8333740234375,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":456.8333740234375,\"y\":936.0000305175781},{\"command\":\"L\",\"x\":459.5,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":460.8333740234375,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":461.5,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":944.0000305175781},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":941.3333435058594},{\"command\":\"L\",\"x\":462.8333740234375,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":464.16668701171875,\"y\":935.3333435058594},{\"command\":\"L\",\"x\":465.5,\"y\":933.3333435058594},{\"command\":\"L\",\"x\":466.16668701171875,\"y\":932.6667175292969},{\"command\":\"L\",\"x\":467.5,\"y\":933.3333435058594},{\"command\":\"L\",\"x\":469.5,\"y\":935.3333435058594},{\"command\":\"L\",\"x\":470.16668701171875,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":472.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":472.8333740234375,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":474.16668701171875,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":475.5,\"y\":944.0000305175781},{\"command\":\"L\",\"x\":478.16668701171875,\"y\":941.3333435058594},{\"command\":\"L\",\"x\":481.5,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":484.8333740234375,\"y\":934.0000305175781},{\"command\":\"L\",\"x\":488.8333740234375,\"y\":929.3333435058594},{\"command\":\"L\",\"x\":489.5,\"y\":928.0000305175781}]' + path: '[{\"command\":\"M\",\"x\":244.83334350585938,\"y\":982.0000305175781}]' } as HandWrittenSignatureSettings ); pdfviewer.annotation.addAnnotation("HandWrittenSignature", { offset: { x: 200, y: 310 }, @@ -103,7 +258,7 @@ export class AppComponent implements OnInit { displayMode: DisplayMode.Upload, hideSaveSignature: false }, canSave: true, - path: "data:image/jpeg;base64,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" + path: "data:image/jpeg;base64,/9j/4AAQSkZ..." } as HandWrittenSignatureSettings ); } } @@ -151,7 +306,7 @@ export class AppComponent implements OnInit { displayMode: DisplayMode.Draw }, canSave: true, - path: '[{\"command\":\"M\",\"x\":244.83334350585938,\"y\":982.0000305175781},{\"command\":\"L\",\"x\":244.83334350585938,\"y\":982.0000305175781},{\"command\":\"L\",\"x\":250.83334350585938,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":946.0000305175781},{\"command\":\"L\",\"x\":254.16668701171875,\"y\":940.6667175292969},{\"command\":\"L\",\"x\":256.8333435058594,\"y\":931.3333435058594},{\"command\":\"L\",\"x\":257.5,\"y\":929.3333435058594},{\"command\":\"L\",\"x\":258.8333435058594,\"y\":926.6667175292969},{\"command\":\"L\",\"x\":259.5,\"y\":924.0000305175781},{\"command\":\"L\",\"x\":259.5,\"y\":922.6667175292969},{\"command\":\"L\",\"x\":258.8333435058594,\"y\":922.0000305175781},{\"command\":\"L\",\"x\":258.16668701171875,\"y\":922.0000305175781},{\"command\":\"L\",\"x\":256.8333435058594,\"y\":922.0000305175781},{\"command\":\"L\",\"x\":256.16668701171875,\"y\":922.6667175292969},{\"command\":\"L\",\"x\":254.83334350585938,\"y\":923.3333435058594},{\"command\":\"L\",\"x\":254.16668701171875,\"y\":923.3333435058594},{\"command\":\"L\",\"x\":253.5,\"y\":923.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":925.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":927.3333435058594},{\"command\":\"L\",\"x\":252.83334350585938,\"y\":936.0000305175781},{\"command\":\"L\",\"x\":253.5,\"y\":940.6667175292969},{\"command\":\"L\",\"x\":254.83334350585938,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":260.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":264.16668701171875,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":274.16668701171875,\"y\":958.6667175292969},{\"command\":\"L\",\"x\":278.16668701171875,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":281.5,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":285.5,\"y\":964.6667175292969},{\"command\":\"L\",\"x\":286.8333740234375,\"y\":967.3333435058594},{\"command\":\"L\",\"x\":286.8333740234375,\"y\":970.0000305175781},{\"command\":\"L\",\"x\":282.8333740234375,\"y\":978.6667175292969},{\"command\":\"L\",\"x\":278.16668701171875,\"y\":983.3333435058594},{\"command\":\"L\",\"x\":266.16668701171875,\"y\":991.3333435058594},{\"command\":\"L\",\"x\":259.5,\"y\":993.3333435058594},{\"command\":\"L\",\"x\":252.16668701171875,\"y\":994.0000305175781},{\"command\":\"L\",\"x\":240.83334350585938,\"y\":991.3333435058594},{\"command\":\"L\",\"x\":236.16668701171875,\"y\":988.6667175292969},{\"command\":\"L\",\"x\":230.16668701171875,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":228.83334350585938,\"y\":980.6667175292969},{\"command\":\"L\",\"x\":228.16668701171875,\"y\":978.6667175292969},{\"command\":\"L\",\"x\":228.83334350585938,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":230.16668701171875,\"y\":973.3333435058594},{\"command\":\"L\",\"x\":236.16668701171875,\"y\":971.3333435058594},{\"command\":\"L\",\"x\":240.83334350585938,\"y\":971.3333435058594},{\"command\":\"L\",\"x\":246.16668701171875,\"y\":972.0000305175781},{\"command\":\"L\",\"x\":257.5,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":262.8333435058594,\"y\":976.0000305175781},{\"command\":\"L\",\"x\":269.5,\"y\":977.3333435058594},{\"command\":\"L\",\"x\":276.16668701171875,\"y\":978.6667175292969},{\"command\":\"L\",\"x\":279.5,\"y\":978.0000305175781},{\"command\":\"L\",\"x\":285.5,\"y\":976.6667175292969},{\"command\":\"L\",\"x\":288.16668701171875,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":292.8333740234375,\"y\":969.3333435058594},{\"command\":\"L\",\"x\":293.5,\"y\":966.6667175292969},{\"command\":\"L\",\"x\":294.16668701171875,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":293.5,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":293.5,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":292.8333740234375,\"y\":956.6667175292969},{\"command\":\"L\",\"x\":291.5,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":291.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":291.5,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":291.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":292.16668701171875,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":292.8333740234375,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":294.16668701171875,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":295.5,\"y\":964.6667175292969},{\"command\":\"L\",\"x\":297.5,\"y\":969.3333435058594},{\"command\":\"L\",\"x\":298.8333740234375,\"y\":970.6667175292969},{\"command\":\"L\",\"x\":301.5,\"y\":970.0000305175781},{\"command\":\"L\",\"x\":304.16668701171875,\"y\":968.6667175292969},{\"command\":\"L\",\"x\":305.5,\"y\":966.0000305175781},{\"command\":\"L\",\"x\":308.8333740234375,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":310.16668701171875,\"y\":957.3333435058594},{\"command\":\"L\",\"x\":310.8333740234375,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":310.8333740234375,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":310.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":311.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":312.8333740234375,\"y\":959.3333435058594},{\"command\":\"L\",\"x\":316.16668701171875,\"y\":968.0000305175781},{\"command\":\"L\",\"x\":317.5,\"y\":972.6667175292969},{\"command\":\"L\",\"x\":318.16668701171875,\"y\":977.3333435058594},{\"command\":\"L\",\"x\":319.5,\"y\":983.3333435058594},{\"command\":\"L\",\"x\":319.5,\"y\":986.0000305175781},{\"command\":\"L\",\"x\":319.5,\"y\":988.0000305175781},{\"command\":\"L\",\"x\":318.8333740234375,\"y\":988.0000305175781},{\"command\":\"L\",\"x\":318.16668701171875,\"y\":988.6667175292969},{\"command\":\"L\",\"x\":316.16668701171875,\"y\":987.3333435058594},{\"command\":\"L\",\"x\":314.8333740234375,\"y\":985.3333435058594},{\"command\":\"L\",\"x\":314.16668701171875,\"y\":980.6667175292969},{\"command\":\"L\",\"x\":314.8333740234375,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":316.16668701171875,\"y\":969.3333435058594},{\"command\":\"L\",\"x\":319.5,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":320.16668701171875,\"y\":957.3333435058594},{\"command\":\"L\",\"x\":321.5,\"y\":955.3333435058594},{\"command\":\"L\",\"x\":322.16668701171875,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":322.8333740234375,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":324.16668701171875,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":324.8333740234375,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":326.8333740234375,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":328.16668701171875,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":328.8333740234375,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":329.5,\"y\":962.0000305175781},{\"command\":\"L\",\"x\":330.16668701171875,\"y\":962.0000305175781},{\"command\":\"L\",\"x\":330.16668701171875,\"y\":962.6667175292969},{\"command\":\"L\",\"x\":330.16668701171875,\"y\":962.0000305175781},{\"command\":\"L\",\"x\":330.8333740234375,\"y\":960.0000305175781},{\"command\":\"L\",\"x\":331.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":332.8333740234375,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":333.5,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":334.8333740234375,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":335.5,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":336.16668701171875,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":337.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":338.8333740234375,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":340.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":341.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":342.8333740234375,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":344.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":346.8333740234375,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":349.5,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":350.8333740234375,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":351.5,\"y\":946.6667175292969},{\"command\":\"L\",\"x\":352.8333740234375,\"y\":944.0000305175781},{\"command\":\"L\",\"x\":352.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":354.8333740234375,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":354.8333740234375,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":946.6667175292969},{\"command\":\"L\",\"x\":354.16668701171875,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":355.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":356.16668701171875,\"y\":957.3333435058594},{\"command\":\"L\",\"x\":358.16668701171875,\"y\":959.3333435058594},{\"command\":\"L\",\"x\":360.16668701171875,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":364.16668701171875,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":370.8333740234375,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":373.5,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":375.5,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":376.16668701171875,\"y\":933.3333435058594},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":931.3333435058594},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":930.0000305175781},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":929.3333435058594},{\"command\":\"L\",\"x\":376.16668701171875,\"y\":930.0000305175781},{\"command\":\"L\",\"x\":375.5,\"y\":932.0000305175781},{\"command\":\"L\",\"x\":375.5,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":374.8333740234375,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":374.8333740234375,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":375.5,\"y\":966.0000305175781},{\"command\":\"L\",\"x\":377.5,\"y\":974.6667175292969},{\"command\":\"L\",\"x\":378.16668701171875,\"y\":977.3333435058594},{\"command\":\"L\",\"x\":380.8333740234375,\"y\":981.3333435058594},{\"command\":\"L\",\"x\":382.16668701171875,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":383.5,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":387.5,\"y\":982.6667175292969},{\"command\":\"L\",\"x\":389.5,\"y\":980.6667175292969},{\"command\":\"L\",\"x\":392.16668701171875,\"y\":976.6667175292969},{\"command\":\"L\",\"x\":392.8333740234375,\"y\":973.3333435058594},{\"command\":\"L\",\"x\":392.16668701171875,\"y\":970.0000305175781},{\"command\":\"L\",\"x\":388.8333740234375,\"y\":965.3333435058594},{\"command\":\"L\",\"x\":385.5,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":382.8333740234375,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":377.5,\"y\":964.0000305175781},{\"command\":\"L\",\"x\":375.5,\"y\":964.6667175292969},{\"command\":\"L\",\"x\":373.5,\"y\":965.3333435058594},{\"command\":\"L\",\"x\":374.8333740234375,\"y\":963.3333435058594},{\"command\":\"L\",\"x\":376.8333740234375,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":382.16668701171875,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":384.16668701171875,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":387.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":388.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":388.16668701171875,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":388.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":388.8333740234375,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":389.5,\"y\":959.3333435058594},{\"command\":\"L\",\"x\":389.5,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":390.16668701171875,\"y\":961.3333435058594},{\"command\":\"L\",\"x\":390.8333740234375,\"y\":960.6667175292969},{\"command\":\"L\",\"x\":393.5,\"y\":958.0000305175781},{\"command\":\"L\",\"x\":396.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":398.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":400.16668701171875,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":400.16668701171875,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":400.8333740234375,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":400.8333740234375,\"y\":947.3333435058594},{\"command\":\"L\",\"x\":401.5,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":402.16668701171875,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":403.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":404.8333740234375,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":406.16668701171875,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":407.5,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":410.16668701171875,\"y\":952.0000305175781},{\"command\":\"L\",\"x\":412.16668701171875,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":940.6667175292969},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":414.16668701171875,\"y\":938.0000305175781},{\"command\":\"L\",\"x\":415.5,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":418.8333740234375,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":420.16668701171875,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":421.5,\"y\":946.6667175292969},{\"command\":\"L\",\"x\":422.8333740234375,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":423.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":423.5,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":422.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":421.5,\"y\":955.3333435058594},{\"command\":\"L\",\"x\":421.5,\"y\":956.0000305175781},{\"command\":\"L\",\"x\":422.16668701171875,\"y\":954.6667175292969},{\"command\":\"L\",\"x\":422.8333740234375,\"y\":954.0000305175781},{\"command\":\"L\",\"x\":424.8333740234375,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":425.5,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":428.16668701171875,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":948.0000305175781},{\"command\":\"L\",\"x\":428.8333740234375,\"y\":950.0000305175781},{\"command\":\"L\",\"x\":429.5,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":430.16668701171875,\"y\":953.3333435058594},{\"command\":\"L\",\"x\":432.8333740234375,\"y\":952.6667175292969},{\"command\":\"L\",\"x\":434.8333740234375,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":437.5,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":440.16668701171875,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":441.5,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":442.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":941.3333435058594},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":442.8333740234375,\"y\":946.0000305175781},{\"command\":\"L\",\"x\":443.5,\"y\":949.3333435058594},{\"command\":\"L\",\"x\":444.16668701171875,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":445.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":447.5,\"y\":950.6667175292969},{\"command\":\"L\",\"x\":450.16668701171875,\"y\":948.6667175292969},{\"command\":\"L\",\"x\":452.16668701171875,\"y\":945.3333435058594},{\"command\":\"L\",\"x\":453.5,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":452.8333740234375,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":452.16668701171875,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":450.8333740234375,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":448.8333740234375,\"y\":936.0000305175781},{\"command\":\"L\",\"x\":447.5,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":446.16668701171875,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":445.5,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":445.5,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":446.16668701171875,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":446.8333740234375,\"y\":939.3333435058594},{\"command\":\"L\",\"x\":452.16668701171875,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":454.8333740234375,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":456.8333740234375,\"y\":936.0000305175781},{\"command\":\"L\",\"x\":459.5,\"y\":936.6667175292969},{\"command\":\"L\",\"x\":460.8333740234375,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":461.5,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":942.0000305175781},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":944.0000305175781},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":942.6667175292969},{\"command\":\"L\",\"x\":462.16668701171875,\"y\":941.3333435058594},{\"command\":\"L\",\"x\":462.8333740234375,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":464.16668701171875,\"y\":935.3333435058594},{\"command\":\"L\",\"x\":465.5,\"y\":933.3333435058594},{\"command\":\"L\",\"x\":466.16668701171875,\"y\":932.6667175292969},{\"command\":\"L\",\"x\":467.5,\"y\":933.3333435058594},{\"command\":\"L\",\"x\":469.5,\"y\":935.3333435058594},{\"command\":\"L\",\"x\":470.16668701171875,\"y\":938.6667175292969},{\"command\":\"L\",\"x\":472.8333740234375,\"y\":943.3333435058594},{\"command\":\"L\",\"x\":472.8333740234375,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":474.16668701171875,\"y\":944.6667175292969},{\"command\":\"L\",\"x\":475.5,\"y\":944.0000305175781},{\"command\":\"L\",\"x\":478.16668701171875,\"y\":941.3333435058594},{\"command\":\"L\",\"x\":481.5,\"y\":937.3333435058594},{\"command\":\"L\",\"x\":484.8333740234375,\"y\":934.0000305175781},{\"command\":\"L\",\"x\":488.8333740234375,\"y\":929.3333435058594},{\"command\":\"L\",\"x\":489.5,\"y\":928.0000305175781}]' + path: '[{\"command\":\"M\",\"x\...}]' } as HandWrittenSignatureSettings ); pdfviewer.annotation.addAnnotation("Initial", { offset: { x: 200, y: 310 }, @@ -176,7 +331,7 @@ export class AppComponent implements OnInit { displayMode: DisplayMode.Upload, hideSaveSignature: false }, canSave: true, - path: "data:image/jpeg;base64,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" + path: "data:image/jpeg;base64,/9j/4AAQSkZJRgAB..." } as HandWrittenSignatureSettings ); } } @@ -185,8 +340,392 @@ export class AppComponent implements OnInit { [View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to/Add%20Handwritten%20Signature%20Programmatically) -## Editing the properties of handwritten signature +## Edit signature annotation + +### Edit signature annotation in UI + +Stroke color, border thickness, and opacity can be edited using the Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar. + +#### Edit stroke color + +Edit the stroke color using the color palette in the Edit Stroke Color tool. + +![Change signature stroke color](../../react/images/change_stroke.png) + +#### Edit thickness + +Edit border thickness using the range slider in the Edit Thickness tool. + +![Change signature border thickness](../../react/images/change_thickness.png) + +#### Edit opacity + +Edit opacity using the range slider in the Edit Opacity tool. + +![Change signature opacity](../../react/images/change_opacity.png) + +### Edit Signature Annotation Programmatically + +With the PDF Viewer library, you can programmatically edit a handwritten signature in the PDF Viewer control using the `editSignature()` method. + +Here is an example of editing a handwritten signature programmatically using the `editSignature()` method: + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { DisplayMode } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` +
    +
    + + +
    + + + +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; + + /** Get PDF Viewer instance */ + private getViewer(): any { + return (document.getElementById('pdfViewer') as any) + ?.ej2_instances?.[0]; + } + + /** Add Handwritten Signature (Text mode) */ + addSignature(): void { + const viewer = this.getViewer(); + if (!viewer) { return; } + + viewer.annotation.addAnnotation('HandWrittenSignature', { + offset: { x: 200, y: 310 }, + pageNumber: 1, + width: 200, + height: 65, + signatureItem: ['Signature'], + signatureDialogSettings: { + displayMode: DisplayMode.Text, + hideSaveSignature: false + }, + canSave: false, + path: 'Syncfusion', + fontFamily: 'Helvetica' + }); + } + + /** Edit existing Signature annotation */ + editSignature(): void { + const viewer = this.getViewer(); + if (!viewer || !viewer.signatureCollection) { return; } + + for (const signature of viewer.signatureCollection) { + if (signature.shapeAnnotationType === 'SignatureText') { + signature.fontSize = 12; + signature.thickness = 2; + signature.strokeColor = '#0000FF'; + signature.opacity = 0.8; + + viewer.annotationModule.editSignature(signature); + } + } + } +} +{% endhighlight %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +import { DisplayMode } from '@syncfusion/ej2-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + MagnificationService, + NavigationService, + AnnotationService, + LinkAnnotationService, + ThumbnailViewService, + BookmarkViewService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService + ], + template: ` +
    +
    + + +
    + + + +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; + + public serviceUrl: string = + 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; + + /** Get PDF Viewer instance */ + private getViewer(): any { + return (document.getElementById('pdfViewer') as any) + ?.ej2_instances?.[0]; + } + + /** Add Handwritten Signature (Text mode) */ + addSignature(): void { + const viewer = this.getViewer(); + if (!viewer) { return; } + + viewer.annotation.addAnnotation('HandWrittenSignature', { + offset: { x: 200, y: 310 }, + pageNumber: 1, + width: 200, + height: 65, + signatureItem: ['Signature'], + signatureDialogSettings: { + displayMode: DisplayMode.Text, + hideSaveSignature: false + }, + canSave: false, + path: 'Syncfusion', + fontFamily: 'Helvetica' + }); + } + + /** Edit existing Signature annotation */ + editSignature(): void { + const viewer = this.getViewer(); + if (!viewer || !viewer.signatureCollection) { return; } + + for (const signature of viewer.signatureCollection) { + if (signature.shapeAnnotationType === 'SignatureText') { + signature.fontSize = 12; + signature.thickness = 2; + signature.strokeColor = '#0000FF'; + signature.opacity = 0.8; + + viewer.annotationModule.editSignature(signature); + } + } + } +} +{% endhighlight %} +{% endtabs %} + +## Enable or disable handwritten signature + +The following example enables or disables the handwritten signature in the PDF Viewer. Setting the value to `false` disables the feature. + +{% tabs %} +{% highlight ts tabtitle="Standalone" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ], + template: ` +
    +
    + + + +
    +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public serviceUrl: string = + 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; +} +{% endhighlight %} +{% highlight ts tabtitle="Server-Backed" %} +import { Component } from '@angular/core'; +import { + PdfViewerModule, + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService +} from '@syncfusion/ej2-angular-pdfviewer'; + +@Component({ + selector: 'app-root', + standalone: true, + imports: [PdfViewerModule], + providers: [ + ToolbarService, + AnnotationService, + MagnificationService, + NavigationService, + LinkAnnotationService, + BookmarkViewService, + ThumbnailViewService, + PrintService, + TextSelectionService, + TextSearchService, + FormFieldsService, + FormDesignerService, + PageOrganizerService + ], + template: ` +
    +
    + + + +
    +
    + ` +}) +export class AppComponent { + + public documentPath: string = + 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; + + public resourceUrl: string = + 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; +} +{% endhighlight %} +{% endtabs %} + +N> When `enableHandwrittenSignature` is set to `false`, the handwritten signature toolbar and related UI are disabled; existing handwritten signature annotations remain in the document unless removed. The `canSave` option in annotation examples controls whether a signature can be saved for reuse; when `canSave` is `false`, signatures are not persisted in the signature collection for later reuse. -Edit the stroke color, border thickness, and opacity of a handwritten signature using the annotation toolbar's edit stroke color, thickness, and opacity tools. +## See also -![Signature properties in the annotation toolbar](../images/signature_properties.png) +- [Annotation Overview](../overview) +- [Annotation Types](../annotation/annotation-types/area-annotation) +- [Annotation Toolbar](../toolbar-customization/annotation-toolbar) +- [Create and Modify Annotation](../annotation/create-modify-annotation) +- [Customize Annotation](../annotation/customize-annotation) +- [Remove Annotation](../annotation/delete-annotation) +- [Export and Import Annotation](../annotation/export-import/export-annotation) +- [Annotation Permission](../annotation/annotation-permission) +- [Annotation in Mobile View](../annotation/annotations-in-mobile-view) +- [Annotation Events](../annotation/annotation-event) +- [Annotation API](../annotation/annotations-api) \ No newline at end of file