diff --git a/Document-Processing-toc.html b/Document-Processing-toc.html index 1d11488941..0986cfba49 100644 --- a/Document-Processing-toc.html +++ b/Document-Processing-toc.html @@ -1029,6 +1029,7 @@
  • Customize context menu
  • PageRenderInitiate and PageRenderComplete event
  • Open and Close Bookmark pane programmatically
  • +
  • Locking Annotation in a PDF document
  • Locking Form Fields in a PDF document
  • SignatureSelect and SignatureUnselect event
  • Controlling File Downloads
  • diff --git a/Document-Processing/PDF/PDF-Viewer/angular/accessibility.md b/Document-Processing/PDF/PDF-Viewer/angular/accessibility.md index 52c2c49f12..656a6d501e 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/accessibility.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/accessibility.md @@ -170,70 +170,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService,ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { - } - public commandManager = { - keyboardCommand: [{ - name: 'customCopy', - gesture: { - pdfKeys: PdfKeys.G, - modifierKeys: ModifierKeys.Shift | ModifierKeys.Alt - } - }, - { - name: 'customPaste', - gesture: { - pdfKeys: PdfKeys.H, - modifierKeys: ModifierKeys.Shift | ModifierKeys.Alt - } - }, - { - name: 'customCut', - gesture: { - pdfKeys: PdfKeys.Z, - modifierKeys: ModifierKeys.Control - } - }, - { - name: 'customSelectAll', - gesture: { - pdfKeys: PdfKeys.E, - modifierKeys: ModifierKeys.Control - } - }, - ] - } - } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md index d8c90b3507..c3267529c4 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/comments.md @@ -173,95 +173,6 @@ export class AppComponent { } } -{% 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]); - } - } - - 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]); - } - } -} - {% endhighlight %} {% endtabs %} @@ -361,95 +272,6 @@ export class AppComponent { } } -{% 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]); - } - } - - 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]); - } - } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/free-text-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/free-text-annotation.md deleted file mode 100644 index b2855aa7d8..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/free-text-annotation.md +++ /dev/null @@ -1,542 +0,0 @@ ---- -layout: post -title: Free text annotation in Angular PDF Viewer component | Syncfusion -description: Learn about free text annotations in the Syncfusion Angular PDF Viewer (Essential JS 2): add, edit, delete, and default settings. -platform: document-processing -control: Free text annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Free text annotation in Angular PDF Viewer control - -The PDF Viewer control supports adding, editing, and deleting free text annotations. This article explains how to add free text annotations using the toolbar and programmatically, modify their properties, and manage selection and focus. - -## Add a free text annotation to the PDF document - -Free text annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. The annotation toolbar appears below it. -* Select the **Free Text Annotation** button to enable free text annotation mode. -* Add text anywhere on the pages of the PDF document. - -When in pan mode, selecting free text annotation switches the PDF Viewer to text-selection mode. - -![Free text tool in the annotation toolbar](../images/freetext_tool.png) - -The following example switches to free text annotation mode using a button click. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, FormDesignerService, - FormFieldsService, AnnotationService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("FreeText"); - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, FormDesignerService, - FormFieldsService, AnnotationService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("FreeText"); - } - } -{% endhighlight %} -{% endtabs %} - -## Clear selection focus from free text annotation - -Clear the selection focus for free text annotations by calling the [setAnnotationMode](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation) API on the `annotationModule`. - -The following sample removes the selection from the currently selected annotation using a button click. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - - - - - - -//Event triggers while clicking the RemoveSelection button. -RemoveSelection() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - // API to remove selection from the free text annotation. - pdfviewer.annotationModule.setAnnotationMode('None'); -} - -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - - - - - - -//Event triggers while clicking the RemoveSelection button. -RemoveSelection() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - //API to remove the selection from the free text annotation. - pdfviewer.annotationModule.setAnnotationMode('None'); -} - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/Annotations/How%20to%20clear%20the%20selection%20from%20annotation) - -## Add a free text annotation programmatically to the PDF document - -Add a free text annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) method. The example below demonstrates adding a FreeText annotation with styling and position properties. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, FreeTextSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("FreeText", { - offset: { x: 100, y: 150 }, - fontSize: 16, - fontFamily: "Helvetica", - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - textAlignment : 'Center', - borderStyle : 'solid', - borderWidth : 2, - borderColor : 'red', - fillColor : 'blue', - fontColor: 'white', - defaultText: "Syncfusion" - } as FreeTextSettings); - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, FreeTextSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("FreeText", { - offset: { x: 100, y: 150 }, - fontSize: 16, - fontFamily: "Helvetica", - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - textAlignment : 'Center', - borderStyle : 'solid', - borderWidth : 2, - borderColor : 'red', - fillColor : 'blue', - fontColor: 'white', - defaultText: "Syncfusion" - } as FreeTextSettings); - } -} - -{% endhighlight %} -{% endtabs %} - - -## Edit free text annotation properties - -Free text annotation properties that can be modified using the annotation toolbar include font family, font size, font styles, font color, text alignment, fill color, stroke color, border thickness, and opacity. The toolbar provides dedicated controls for each of these settings. - -### Font family - -Choose a font family from the Font Family tool to update the annotation text. - -![Change font family](../images/fontfamily.png) - -### Font size - -Choose a size from the Font Size tool to update the annotation text size. - -![Change font size](../images/fontsize.png) - -### Font color - -Select a color from the Font Color palette to change the font color. - -![Change font color](../images/fontcolor.png) - -### Text alignment - -Use the Text Align tool to set the annotation text alignment. - -![Set text alignment](../images/textalign.png) - -### Font styles - -Enable bold, italic, or underline using the Font Style tool. - -![Change text styles](../images/fontstyle.png) - -### Fill color - -Set the annotation background using the Edit Color tool. - -![Change fill color](../images/fillcolor.png) - -### Stroke color - -Set the annotation border color using the Edit Stroke Color tool. - -![change stroke color](../images/fontstroke.png) - -### Thickness - -Adjust border thickness with the Edit Thickness slider. - -![FontThickness](../images/fontthickness.png) - -### Opacity - -Adjust annotation opacity with the Edit Opacity slider. - -![Change opacity](../images/fontopacity.png) - -## Move free text annotation programmatically - -Move a free text annotation programmatically by updating its `bounds` and calling `editAnnotation()` on the annotation module. - -```html - -``` - -```typescript - - moveFreeText() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].subject === "Text Box") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - -``` - -Find the sample: how to move the free text annotation programmatically (https://stackblitz.com/edit/angular-dxub1a-qjbisb?file=app.component.ts) - - -## Get the ID of a newly added free text annotation - -Use the `annotationAdd` event to obtain the ID of a newly added free text annotation. The event handler receives an argument with the `annotationId` property for the created annotation. - -```typescript - -public annotationAddEventHandler(args) { - if (args.annotationType === 'FreeText') { - console.log('annotationId:' + args.annotationId); - } -} - -``` - -Find the sample: how to get the newly added free text annotation id (https://stackblitz.com/edit/angular-dxub1a-utuefq?file=app.component.ts) - - -## Change the content of an existing free text annotation programmatically - -Change the text content of an existing free text annotation by updating its `dynamicText` property and calling `editAnnotation()`. - -```html - -``` - -```typescript - -changeContent() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === 'Text Box') { - viewer.annotationCollection[i].dynamicText = 'syncfusion'; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } -} - -``` - -N> The PDF Viewer cannot edit existing static PDF document text. It supports adding and modifying free text annotations only. - - -## Set default properties during control initialization - -Default free text annotation properties can be configured before initializing the control by supplying `freeTextSettings`. - -The example below shows how to set default free text annotation settings before the PDF Viewer is created. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, FormDesignerService, FormFieldsService, - PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public freeTextSettings = { fillColor: 'green', borderColor: 'blue', fontColor: 'yellow' }; - ngOnInit(): void { - } - } - -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, FormDesignerService, FormFieldsService, - PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public freeTextSettings = { fillColor: 'green', borderColor: 'blue', fontColor: 'yellow' }; - ngOnInit(): void { - } - } - -{% endhighlight %} -{% endtabs %} - -You can also enable the autofit support for free text annotation by using the enableAutoFit boolean property in freeTextSettings as below. The width of the free text rectangle box will be increased based on the text added to it. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, FormDesignerService, FormFieldsService, - PageOrganizerService -} from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // Specify the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public freeTextSettings = { enableAutoFit: true }; - ngOnInit(): void { - } -} - -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, FormDesignerService, FormFieldsService, - PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // Specify the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public freeTextSettings = { enableAutoFit: true }; - ngOnInit(): void { - } -} - -{% endhighlight %} -{% endtabs %} - -[View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/Annotations/How%20to%20change%20the%20properties%20of%20free%20text%20annotation) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/import-export-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/import-export-annotation.md deleted file mode 100644 index 516443c7ea..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/import-export-annotation.md +++ /dev/null @@ -1,1001 +0,0 @@ ---- -layout: post -title: Import export annotation in Angular PDF Viewer component | Syncfusion -description: Learn here all about Import export annotation in Syncfusion Angular PDF Viewer component of Syncfusion Essential JS 2 and more. -platform: document-processing -control: Import export annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Import and export annotations - -The PDF Viewer control supports importing and exporting annotations as JSON or XFDF. Use the annotation toolbar to add, edit, import, or export annotations for the loaded PDF document. - -Using the annotation toolbar: - -* Click the Add or Edit annotation button in the PDF Viewer toolbar. - -![EditButton](../images/edittool.png) - -* In the annotation toolbar, open the Comment Panel. - -![CommentPanel](../images/commentPanel.png) - -* In the Comment Panel, use the More Options menu to choose import or export actions. - -![MoreOption](../images/Importandexport.png) - -## Importing annotation to the PDF document - -* Click the Add or Edit annotation button in the PDF Viewer toolbar. -* The annotation toolbar will appear. -* Click the Comment Panel button in the annotation toolbar. -* The comments panel will displayed. -* Click the **More Option** button in the comment panel container. -* Select the Import annotations from JSON file option to import annotations from a JSON file. - -![ImportAnnotationFromJSON](../images/Import_annotation_from_JSON.png) - -* Select the Import annotations from XFDF file option to import annotations from an XFDF file. - -![ImportAnnotationFromXFDF](../images/Import_annotation_from_XFDF.png) - -* Then the file explorer dialog will be opened. Choose the JSON file or the XFDF file to be imported into the loaded PDF document. - -![ImportedAnnotation](../images/importedannotation.png) - -## Importing annotation using PDF Viewer API - -You can import annotations using JSON object or JSON file in code behind like the below code snippet. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService], - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - //Local file path - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - OnImportAnnotationsClick() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.importAnnotation({ - pdfAnnotation: { - '0': { - shapeAnnotation: [ - { - ShapeAnnotationType: 'Square', - Author: 'Guest', - AnnotationSelectorSettings: { - selectionBorderColor: '', - resizerBorderColor: 'black', - resizerFillColor: '#FF4081', - resizerSize: 8, - selectionBorderThickness: 1, - resizerShape: 'Square', - selectorLineDashArray: [], - resizerLocation: 3, - resizerCursorType: null, - }, - ModifiedDate: '5/19/2021, 11:44:51 AM', - Subject: 'Rectangle', - Note: '', - IsCommentLock: false, - StrokeColor: 'rgba(255,0,0,1)', - FillColor: 'rgba(255,255,255,0)', - Opacity: 1, - Bounds: { - X: 154, - Y: 71, - Width: 299, - Height: 173, - Location: { X: 154, Y: 71 }, - Size: { IsEmpty: false, Width: 299, Height: 173 }, - Left: 154, - Top: 71, - Right: 453, - Bottom: 244, - }, - Thickness: 1, - BorderStyle: 'Solid', - BorderDashArray: 0, - RotateAngle: 'RotateAngle0', - IsCloudShape: false, - CloudIntensity: 0, - RectangleDifference: null, - VertexPoints: null, - LineHeadStart: null, - LineHeadEnd: null, - IsLocked: false, - AnnotName: 'e9ba2384-a202-45ff-0146-444fa0424dc5', - Comments: null, - State: '', - StateModel: '', - AnnotType: 'shape', - EnableShapeLabel: false, - LabelContent: null, - LabelFillColor: null, - LabelBorderColor: null, - FontColor: null, - FontSize: 0, - CustomData: null, - LabelBounds: { - X: 0, - Y: 0, - Width: 0, - Height: 0, - Location: { X: 0, Y: 0 }, - Size: { IsEmpty: true, Width: 0, Height: 0 }, - Left: 0, - Top: 0, - Right: 0, - Bottom: 0, - }, - LabelSettings: null, - AnnotationSettings: { - minWidth: 0, - maxWidth: 0, - minHeight: 0, - maxHeight: 0, - isLock: false, - isPrint: true, - }, - AllowedInteractions: ['None'], - IsPrint: true, - ExistingCustomData: null, - }, - { - ShapeAnnotationType: 'Circle', - Author: 'Guest', - AnnotationSelectorSettings: { - selectionBorderColor: '', - resizerBorderColor: 'black', - resizerFillColor: '#FF4081', - resizerSize: 8, - selectionBorderThickness: 1, - resizerShape: 'Square', - selectorLineDashArray: [], - resizerLocation: 3, - resizerCursorType: null, - }, - ModifiedDate: '5/19/2021, 11:44:53 AM', - Subject: 'Circle', - Note: '', - IsCommentLock: false, - StrokeColor: 'rgba(255,0,0,1)', - FillColor: 'rgba(255,255,255,0)', - Opacity: 1, - Bounds: { - X: 591, - Y: 104, - Width: 100, - Height: 144, - Location: { X: 591, Y: 104 }, - Size: { IsEmpty: false, Width: 100, Height: 144 }, - Left: 591, - Top: 104, - Right: 691, - Bottom: 248, - }, - Thickness: 1, - BorderStyle: 'Solid', - BorderDashArray: 0, - RotateAngle: 'RotateAngle0', - IsCloudShape: false, - CloudIntensity: 0, - RectangleDifference: null, - VertexPoints: null, - LineHeadStart: null, - LineHeadEnd: null, - IsLocked: false, - AnnotName: '317e203f-e078-4ca1-2125-b86a806dbea5', - Comments: null, - State: '', - StateModel: '', - AnnotType: 'shape', - EnableShapeLabel: false, - LabelContent: null, - LabelFillColor: null, - LabelBorderColor: null, - FontColor: null, - FontSize: 0, - CustomData: null, - LabelBounds: { - X: 0, - Y: 0, - Width: 0, - Height: 0, - Location: { X: 0, Y: 0 }, - Size: { IsEmpty: true, Width: 0, Height: 0 }, - Left: 0, - Top: 0, - Right: 0, - Bottom: 0, - }, - LabelSettings: null, - AnnotationSettings: { - minWidth: 0, - maxWidth: 0, - minHeight: 0, - maxHeight: 0, - isLock: false, - isPrint: true, - }, - AllowedInteractions: ['None'], - IsPrint: true, - ExistingCustomData: null, - }, - ], - }, - }, - }); - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService], - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - //The service must be running in the local - public service: string = - 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - //Local file path - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - OnImportAnnotationsClick() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.importAnnotation({ - pdfAnnotation: { - '0': { - shapeAnnotation: [ - { - ShapeAnnotationType: 'Square', - Author: 'Guest', - AnnotationSelectorSettings: { - selectionBorderColor: '', - resizerBorderColor: 'black', - resizerFillColor: '#FF4081', - resizerSize: 8, - selectionBorderThickness: 1, - resizerShape: 'Square', - selectorLineDashArray: [], - resizerLocation: 3, - resizerCursorType: null, - }, - ModifiedDate: '5/19/2021, 11:44:51 AM', - Subject: 'Rectangle', - Note: '', - IsCommentLock: false, - StrokeColor: 'rgba(255,0,0,1)', - FillColor: 'rgba(255,255,255,0)', - Opacity: 1, - Bounds: { - X: 154, - Y: 71, - Width: 299, - Height: 173, - Location: { X: 154, Y: 71 }, - Size: { IsEmpty: false, Width: 299, Height: 173 }, - Left: 154, - Top: 71, - Right: 453, - Bottom: 244, - }, - Thickness: 1, - BorderStyle: 'Solid', - BorderDashArray: 0, - RotateAngle: 'RotateAngle0', - IsCloudShape: false, - CloudIntensity: 0, - RectangleDifference: null, - VertexPoints: null, - LineHeadStart: null, - LineHeadEnd: null, - IsLocked: false, - AnnotName: 'e9ba2384-a202-45ff-0146-444fa0424dc5', - Comments: null, - State: '', - StateModel: '', - AnnotType: 'shape', - EnableShapeLabel: false, - LabelContent: null, - LabelFillColor: null, - LabelBorderColor: null, - FontColor: null, - FontSize: 0, - CustomData: null, - LabelBounds: { - X: 0, - Y: 0, - Width: 0, - Height: 0, - Location: { X: 0, Y: 0 }, - Size: { IsEmpty: true, Width: 0, Height: 0 }, - Left: 0, - Top: 0, - Right: 0, - Bottom: 0, - }, - LabelSettings: null, - AnnotationSettings: { - minWidth: 0, - maxWidth: 0, - minHeight: 0, - maxHeight: 0, - isLock: false, - isPrint: true, - }, - AllowedInteractions: ['None'], - IsPrint: true, - ExistingCustomData: null, - }, - { - ShapeAnnotationType: 'Circle', - Author: 'Guest', - AnnotationSelectorSettings: { - selectionBorderColor: '', - resizerBorderColor: 'black', - resizerFillColor: '#FF4081', - resizerSize: 8, - selectionBorderThickness: 1, - resizerShape: 'Square', - selectorLineDashArray: [], - resizerLocation: 3, - resizerCursorType: null, - }, - ModifiedDate: '5/19/2021, 11:44:53 AM', - Subject: 'Circle', - Note: '', - IsCommentLock: false, - StrokeColor: 'rgba(255,0,0,1)', - FillColor: 'rgba(255,255,255,0)', - Opacity: 1, - Bounds: { - X: 591, - Y: 104, - Width: 100, - Height: 144, - Location: { X: 591, Y: 104 }, - Size: { IsEmpty: false, Width: 100, Height: 144 }, - Left: 591, - Top: 104, - Right: 691, - Bottom: 248, - }, - Thickness: 1, - BorderStyle: 'Solid', - BorderDashArray: 0, - RotateAngle: 'RotateAngle0', - IsCloudShape: false, - CloudIntensity: 0, - RectangleDifference: null, - VertexPoints: null, - LineHeadStart: null, - LineHeadEnd: null, - IsLocked: false, - AnnotName: '317e203f-e078-4ca1-2125-b86a806dbea5', - Comments: null, - State: '', - StateModel: '', - AnnotType: 'shape', - EnableShapeLabel: false, - LabelContent: null, - LabelFillColor: null, - LabelBorderColor: null, - FontColor: null, - FontSize: 0, - CustomData: null, - LabelBounds: { - X: 0, - Y: 0, - Width: 0, - Height: 0, - Location: { X: 0, Y: 0 }, - Size: { IsEmpty: true, Width: 0, Height: 0 }, - Left: 0, - Top: 0, - Right: 0, - Bottom: 0, - }, - LabelSettings: null, - AnnotationSettings: { - minWidth: 0, - maxWidth: 0, - minHeight: 0, - maxHeight: 0, - isLock: false, - isPrint: true, - }, - AllowedInteractions: ['None'], - IsPrint: true, - ExistingCustomData: null, - }, - ], - }, - }, - }); - } - } - -{% endhighlight %} -{% endtabs %} - -Refer to the following code snippet to import annotations from a JSON file. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService,TextSelectionService, PrintService, - AnnotationService], - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - onImportAnnotationsClick() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.importAnnotation('PDF_Succinctly.json', AnnotationDataFormat.Json); - } -} - -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService,TextSelectionService, PrintService, - AnnotationService], - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public service: string = 'https://localhost:44347/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - onImportAnnotationsClick() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.importAnnotation('PDF_Succinctly.json', AnnotationDataFormat.Json); - } -} - -{% endhighlight %} -{% endtabs %} - ->Run the [web service](https://github.com/SyncfusionExamples/EJ2-PDFViewer-WebServices/tree/main/ASP.NET%20Core/PdfViewerWebService_8.0) and then the angular code. Also note that, the JSON file for importing the annotation should be placed in the location as specified in the GetDocumentPath method of the PdfViewerController. - -Refer to the following code snippet to import annotations from an XFDF file. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; - - @Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService ] - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - OnImportAnnotationsClick() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.importAnnotation('PDF_Succinctly.xfdf', AnnotationDataFormat.xfdf); - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; - - @Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService ] - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - public service: string = 'https://localhost:44347/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - OnImportAnnotationsClick() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.importAnnotation('PDF_Succinctly.xfdf', AnnotationDataFormat.xfdf); - } - } - -{% endhighlight %} -{% endtabs %} - ->Run the [web service](https://github.com/SyncfusionExamples/EJ2-PDFViewer-WebServices/tree/main/ASP.NET%20Core/PdfViewerWebService_8.0) and then the angular code. Also note that, the XFDF file for importing the annotation should be placed in the location as specified in the GetDocumentPath method of the PdfViewerController. - -## Importing Annotation Using Base64 Data - -You can import annotations into the Syncfusion Angular PDF Viewer by decoding Base64-encoded JSON annotation data at runtime and passing the parsed object to the importAnnotation API, as shown in the following code snippet. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { - LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - FormDesignerService, FormFieldsService, AnnotationService, - PageOrganizerService -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - template: ` - - - - - - - -
    - - -
    - `, - // Register all necessary PDF viewer services - providers: [ - LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService - ] -}) -export class AppComponent implements OnInit { - // URL of the sample PDF document - public document: string = 'https://cdn.syncfusion.com/content/pdf/handwritten-signature.pdf'; - - // Syncfusion PDF viewer resource URL - public resource: string = 'https://cdn.syncfusion.com/ej2/28.1.33/dist/ej2-pdfviewer-lib'; - - ngOnInit(): void {} - - /** - * Triggered when a file is selected from the input. - * Handles reading and importing the JSON annotation file. - */ - onFileSelected(event: any): void { - const file = event.target.files[0]; - - // Validate that the selected file is a .json file - if (!file || !file.name.endsWith('.json')) { - alert('Please select a valid JSON file.'); - return; - } - - const reader = new FileReader(); - - // When file reading is done - reader.onload = (e: any) => { - // Extract Base64 string (after the "data:application/json;base64," part) - const base64String = e.target.result.split(',')[1]; - - // Decode Base64 to original JSON string - const decodedJsonString = atob(base64String); - - try { - // Parse the JSON string into a JavaScript object - const annotationData = JSON.parse(decodedJsonString); - - // Get reference to the PDF viewer instance - const viewer = (document.getElementById('pdfViewer') as any).ej2_instances[0]; - - // Import the parsed annotation data into the viewer - viewer.importAnnotation(annotationData); - } catch (err) { - // Handle errors (e.g., invalid JSON) - console.error('Invalid JSON file:', err); - alert('Failed to parse JSON.'); - } - }; - - // Start reading the file as a data URL (Base64 encoded) - reader.readAsDataURL(file); - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - FormDesignerService, FormFieldsService, AnnotationService, - PageOrganizerService -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - template: ` - - - - - - - -
    - - -
    - `, - // Register all necessary PDF viewer services - providers: [ - LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService - ] -}) -export class AppComponent implements OnInit { - // URL of the sample PDF document - public document: string = 'https://cdn.syncfusion.com/content/pdf/handwritten-signature.pdf'; - - // Syncfusion PDF viewer resource URL - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - - ngOnInit(): void {} - - /** - * Triggered when a file is selected from the input. - * Handles reading and importing the JSON annotation file. - */ - onFileSelected(event: any): void { - const file = event.target.files[0]; - - // Validate that the selected file is a .json file - if (!file || !file.name.endsWith('.json')) { - alert('Please select a valid JSON file.'); - return; - } - - const reader = new FileReader(); - - // When file reading is done - reader.onload = (e: any) => { - // Extract Base64 string (after the "data:application/json;base64," part) - const base64String = e.target.result.split(',')[1]; - - // Decode Base64 to original JSON string - const decodedJsonString = atob(base64String); - - try { - // Parse the JSON string into a JavaScript object - const annotationData = JSON.parse(decodedJsonString); - - // Get reference to the PDF viewer instance - const viewer = (document.getElementById('pdfViewer') as any).ej2_instances[0]; - - // Import the parsed annotation data into the viewer - viewer.importAnnotation(annotationData); - } catch (err) { - // Handle errors (e.g., invalid JSON) - console.error('Invalid JSON file:', err); - alert('Failed to parse JSON.'); - } - }; - - // Start reading the file as a data URL (Base64 encoded) - reader.readAsDataURL(file); - } -} -{% endhighlight %} -{% endtabs %} - -## Exporting annotation from the PDF document - -The PDF Viewer control provides the support to export the annotations as JSON file or JSON object and XFDF file using annotation toolbar. - -* Click the Add or Edit annotation button in the PDF Viewer toolbar. -* The annotation toolbar will appear. -* Click the Comment Panel button in the annotation toolbar. -* The comments panel will displayed. -* Click the **More Option** button in the comment panel container. -* Select the Export annotation to JSON file option to export annotations to a JSON file. - -![ExportAnnotation](../images/export_annotation_to_JSON.png) - -* Select the Export annotation to XFDF file option to export annotations to an XFDF file. - -![ExportAnnotation](../images/export_annotation_to_XFDF.png) - ->Export annotations will be in the disabled state when the loaded PDF document does not contain any annotations. - -## Exporting annotation using PDF Viewer API - -You can export annotations as JSON file in code behind like the following code snippet. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent,LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public exportAnnotationFileName: string = 'ExportedAnnotations.json'; - OnExportAnnotationsClick() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.exportAnnotation(AnnotationDataFormat.Json); - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent,LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public exportAnnotationFileName: string = 'ExportedAnnotations.json'; - OnExportAnnotationsClick() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.exportAnnotation(AnnotationDataFormat.Json); - } - } - -{% endhighlight %} -{% endtabs %} - -Refer to the following code snippet to export annotations as XFDF file. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] -}) -export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public exportAnnotationFileName: string = 'ExportedAnnotations.xfdf'; - OnExportAnnotationsClick() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.exportAnnotation(AnnotationDataFormat.Xfdf); - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - -import { ViewChild } from '@angular/core'; -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, AnnotationDataFormat - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] -}) -export class AppComponent implements OnInit { - @ViewChild('pdfviewer') - public pdfviewerControl: PdfViewerComponent; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public exportAnnotationFileName: string = 'ExportedAnnotations.xfdf'; - OnExportAnnotationsClick() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.exportAnnotation(AnnotationDataFormat.Xfdf); - } -} - -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/ink-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/ink-annotation.md deleted file mode 100644 index 8613935eb9..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/ink-annotation.md +++ /dev/null @@ -1,403 +0,0 @@ ---- -layout: post -title: Ink annotation in Angular PDF Viewer component | Syncfusion -description: Learn about ink annotations in the Syncfusion Angular PDF Viewer (Essential JS 2): add, edit, delete, and default settings. -platform: document-processing -control: Ink annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Ink annotation in Angular PDF Viewer component - -The PDF Viewer control provides options to add, edit, and delete ink annotations. - -![Ink annotations overview](../images/ink_annotation.png) - -## Add an ink annotation to the PDF document - -Ink annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. The annotation toolbar appears below it. -* Select the **Draw Ink** button to enable ink annotation mode. -* Draw on any page of the PDF document. - -![Ink tool in the annotation toolbar](../images/ink_tool.png) - -Ink tool in the annotation toolbar - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, FormDesignerService, - FormFieldsService, AnnotationService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("Ink"); - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, FormDesignerService, - FormFieldsService, AnnotationService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("Ink"); - } - } - -{% endhighlight %} -{% endtabs %} - -## Add an ink annotation programmatically to the PDF document - -The PDF Viewer library allows adding an ink annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) method. - -Here is an example of adding an ink annotation programmatically using addAnnotation(): - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, InkAnnotationSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Ink", { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width: 200, - height: 60, - 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}]' - } as InkAnnotationSettings); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, InkAnnotationSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Ink", { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width: 200, - height: 60, - 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}]' - } as InkAnnotationSettings); - } -} -{% endhighlight %} -{% endtabs %} - -## Edit an existing ink annotation programmatically - -To modify an existing ink annotation programmatically, use the editAnnotation() method. - -Here is an example of using editAnnotation(): - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - editAnnotation() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "Ink") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - editAnnotation() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "Ink") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } -} - - - -{% endhighlight %} -{% endtabs %} - -## Edit the properties of ink annotations - -Stroke color, 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 ink stroke color](../images/ink_strokecolor.png) - -### Edit thickness - -Edit thickness using the range slider in the Edit Thickness tool. - -![InkThickness](../images/ink_thickness.png) - -### Edit opacity - -Edit opacity using the range slider in the Edit Opacity tool. - -![Change ink opacity](../images/ink_opacity.png) - -## Set default properties during control initialization - -Default properties for ink annotations can be set before creating the control using InkAnnotationSettings. - -After changing default values, the new defaults are applied to subsequently created ink annotations. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public inkAnnotationSettings = { author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6 } - ngOnInit(): void { - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - import { Component, OnInit } from '@angular/core'; - import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public inkAnnotationSettings = { author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6 } - ngOnInit(): void { - } - } - -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/measurement-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/measurement-annotation.md deleted file mode 100644 index d1e19edc52..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/measurement-annotation.md +++ /dev/null @@ -1,722 +0,0 @@ ---- -layout: post -title: Measurement annotation in Angular PDF Viewer control | Syncfusion -description: Learn about measurement annotations in the Syncfusion Angular PDF Viewer (Essential JS 2): distance, perimeter, area, radius, and volume. -platform: document-processing -control: Measurement annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Measurement Annotation in Angular PDF Viewer component - -The PDF Viewer provides options to add measurement annotations. The supported measurement annotations are: - -* Distance -* Perimeter -* Area -* Radius -* Volume - -![PDF Viewer measurement annotations toolbar overview](../images/calibrate_annotation.png) - -## Adding measurement annotations to the PDF document - -Measurement annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Measurement Annotation** drop-down button. The pop-up lists available measurement annotation types. -* Select a measurement type to enable its annotation mode. -* Measure and add annotations on the pages of the PDF document. - -When the viewer is in pan mode, selecting a measurement annotation switches it to text selection mode. - -![Annotation toolbar showing measurement tools](../images/calibrate_tool.png) - -The following example switches to distance annotation mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Distance'); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Distance'); - } -} -{% endhighlight %} -{% endtabs %} - -## Add a measurement annotation to the PDF document Programmatically - -The PDF Viewer library allows adding measurement annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotation) method. - -Here is an example showing how to add measurement annotations programmatically using addAnnotation(): - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, DistanceSettings, PerimeterSettings, - AreaSettings, RadiusSettings, VolumeSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - - addDistanceAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Distance", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - } as DistanceSettings); - } - - addPerimeterAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Perimeter", { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 350 }, { x: 285, y: 350 }, { x: 286, y: 412 }] - } as PerimeterSettings); - } - - addAreaAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Area", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - } as AreaSettings); - } - - addRadiusAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Radius", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - } as RadiusSettings); - } - addVolumeAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Volume", { - offset: { x: 200, y: 810 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 810 }, { x: 200, y: 919 }, { x: 320, y: 919 }, { x: 320, y: 809 }, { x: 200, y: 810 }] - } as VolumeSettings); - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, DistanceSettings, PerimeterSettings, - AreaSettings, RadiusSettings, VolumeSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - - addDistanceAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Distance", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - } as DistanceSettings); - } - - addPerimeterAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Perimeter", { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 350 }, { x: 285, y: 350 }, { x: 286, y: 412 }] - } as PerimeterSettings); - } - - addAreaAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Area", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - } as AreaSettings); - } - - addRadiusAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Radius", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - } as RadiusSettings); - } - addVolumeAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Volume", { - offset: { x: 200, y: 810 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 810 }, { x: 200, y: 919 }, { x: 320, y: 919 }, { x: 320, y: 809 }, { x: 200, y: 810 }] - } as VolumeSettings); - } -} - -{% endhighlight %} -{% endtabs %} - -## Edit an existing measurement annotation programmatically - -To modify an existing measurement annotation programmatically, use the editAnnotation() method. - -Here is an example of using editAnnotation(): - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - - editDistanceAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Distance calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - - editPerimeterAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Perimeter calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - - editAreaAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Area calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - - editRadiusAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Radius calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editVolumeAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Volume calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } -} - - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - - editDistanceAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Distance calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - - editPerimeterAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Perimeter calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - - editAreaAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Area calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - - editRadiusAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Radius calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editVolumeAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Volume calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } -} - -{% endhighlight %} -{% endtabs %} - -## Edit the properties of measurement annotations - -The fill color, stroke color, thickness, and opacity can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar. - -### Edit fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![Edit Color palette for measurement annotations](../images/calibrate_fillcolor.png) - -### Edit stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![Edit Stroke Color palette for measurement annotations](../images/calibrate_stroke.png) - -### Edit thickness - -Edit border thickness using the range slider provided in the Edit Thickness tool. - -![Thickness slider in the Edit Thickness tool](../images/calibrate_thickness.png) - -### Edit opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![Opacity slider in the Edit Opacity tool](../images/calibarte_opacity.png) - -### Editing the line properties - -Line-based measurement annotations (distance and perimeter) have additional options in the Line Properties window. Open it by right-clicking the annotation and selecting Properties from the context menu. - -![Line properties dialog for measurement annotations](../images/calibrate_lineprop.png) - -## Set default properties during control initialization - -Default properties for measurement annotations can be set before creating the control using `distanceSettings`, `perimeterSettings`, `areaSettings`, `radiusSettings`, and `volumeSettings`. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public distanceSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; - public perimeterSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; - public areaSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; - public radiusSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; - public volumeSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public distanceSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; - public perimeterSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; - public areaSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; - public radiusSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; - public volumeSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} - - -## Editing scale ratio and unit of the measurement annotation - -The scale ratio and unit of measurement can be modified using the scale ratio option provided in the context menu of the PDF Viewer control. - -![Scale ratio option in the context menu](../images/calibrate_scaleratio.png) - -The PDF Viewer supports the following measurement units: - -* Inch -* Millimeter -* Centimeter -* Point -* Pica -* Feet - -![Scale ratio settings dialog for measurement annotations](../images/calibrate_scaledialog.png) - -## Setting default scale ratio settings during control initialization - -The properties of scale ratio for measurement annotation can be set before creating the control using ScaleRatioSettings as shown in the following code snippet, - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/shape-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/shape-annotation.md deleted file mode 100644 index 555ea47f12..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/shape-annotation.md +++ /dev/null @@ -1,607 +0,0 @@ ---- -layout: post -title: Shape annotation in Angular PDF Viewer control | Syncfusion -description: Learn about shape annotations in the Syncfusion Angular PDF Viewer (Essential JS 2), including add, edit, delete, and default settings. -platform: document-processing -control: Shape annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Shape Annotation in Angular PDF Viewer component - -The PDF Viewer provides options to add, edit, and delete shape annotations. Supported shape annotation types include: - -* Line -* Arrow -* Rectangle -* Circle -* Polygon - -![Shape annotations overview](../images/shape_annot.png) - -## Adding a shape annotation to the PDF document - -Shape annotations can be added to the PDF document using the annotation toolbar. - -* Select the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. -* Open the **Shape Annotation** drop-down to view available shape types. -* Select a shape type to enable its annotation mode, then draw the shape on the page. - -N> When the PDF Viewer is in pan mode and a shape annotation tool is selected, the viewer automatically switches to text select mode to ensure a smooth interaction experience. - -![Shape annotation toolbar](../images/shape_toolbar.png) - -Use the following sample to switch the viewer to circle annotation mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("Circle"); - } - } - -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - ngOnInit(): void { - } - - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("Circle"); - } - } - -{% endhighlight %} -{% endtabs %} - -## Add a shape annotation to the PDF document programmatically - -The PDF Viewer library allows adding a shape annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotation) method. - -Here is an example showing how to add shape annotations programmatically using addAnnotation(): - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, LineSettings, ArrowSettings, - RectangleSettings, CircleSettings, PolygonSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addLineAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Line", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - } as LineSettings); - } - addArrowAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Arrow", { - offset: { x: 200, y: 370 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 370 }, { x: 350, y: 370 }] - } as ArrowSettings); - } - addRectangleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Rectangle", { - offset: { x: 200, y: 480 }, - pageNumber: 1, - width: 150, - height: 75 - } as RectangleSettings); - } - addCircleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Circle", { - offset: { x: 200, y: 620 }, - pageNumber: 1, - width: 90, - height: 90 - } as CircleSettings); - } - addPolygonAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Polygon", { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 }] - } as PolygonSettings); - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, LineSettings, ArrowSettings, - RectangleSettings, CircleSettings, PolygonSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addLineAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Line", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - } as LineSettings); - } - addArrowAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Arrow", { - offset: { x: 200, y: 370 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 370 }, { x: 350, y: 370 }] - } as ArrowSettings); - } - addRectangleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Rectangle", { - offset: { x: 200, y: 480 }, - pageNumber: 1, - width: 150, - height: 75 - } as RectangleSettings); - } - addCircleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Circle", { - offset: { x: 200, y: 620 }, - pageNumber: 1, - width: 90, - height: 90 - } as CircleSettings); - } - addPolygonAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Polygon", { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 }] - } as PolygonSettings); - } -} - - -{% endhighlight %} -{% endtabs %} - -## Edit an existing shape annotation programmatically - -To modify an existing shape annotation programmatically, use the editAnnotation() method. - -Here is an example of using editAnnotation():: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - editLineAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Line") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editArrowAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Arrow") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editRectangleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Rectangle") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editCircleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Circle") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editPolygonAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Polygon") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - editLineAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Line") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editArrowAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Arrow") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editRectangleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Rectangle") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editCircleAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Circle") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - editPolygonAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Polygon") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2 ; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } -} -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the shape annotation - -The fill color, stroke color, thickness, and opacity of shape annotations can be edited using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar. - -### Editing fill color - -The fill color of the annotation can be edited using the color palette provided in the Edit Color tool. - -![Edit fill color for shapes](../images/shape_fillColor.png) - -### Editing stroke color - -The stroke color of the annotation can be edited using the color palette provided in the Edit Stroke Color tool. - -![Edit stroke color for shapes](../images/shape_strokecolor.png) - -### Editing thickness - -The thickness of the border of the annotation can be edited using the range slider provided in the Edit Thickness tool. - -![Edit thickness for shapes](../images/shape_thickness.png) - -### Editing opacity - -The opacity of the annotation can be edited using the range slider provided in the Edit Opacity tool. - -![Edit opacity for shapes](../images/shape_opacity.png) - -### Editing the line properties - -Line and arrow annotations have additional options in the Line Properties window. Open it by right-clicking a line or arrow annotation and selecting Properties from the context menu. - -Refer to the following code sample to set the default annotation settings. - -![Line properties dialog](../images/shape_lineprty.png) - -## Set default properties during control initialization - -Default properties for shape annotations can be set before creating the control using LineSettings, ArrowSettings, RectangleSettings, CircleSettings, and PolygonSettings. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - - - import { Component, OnInit } from '@angular/core'; - import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public lineSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; - public arrowSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; - public rectangleSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; - public circleSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; - public polygonSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - - import { Component, OnInit } from '@angular/core'; - import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public lineSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; - public arrowSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; - public rectangleSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; - public circleSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; - public polygonSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; - } - -{% endhighlight %} -{% endtabs %} \ 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 225a6e233f..385ae398f1 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/signature-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/annotation/signature-annotation.md @@ -108,80 +108,6 @@ export class AppComponent { } } {% 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 @@ -263,79 +189,6 @@ export class AppComponent implements OnInit { } } {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, HandWrittenSignatureSettings, DisplayMode } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Initial", { - offset: { x: 220, y: 180 }, - pageNumber: 1, - width: 150, - height: 60, - signatureItem: ['Initial'], - initialDialogSettings: { - displayMode: DisplayMode.Draw - }, - canSave: true, - path: '[{\"command\":\"M\",\"x\...}]' - } as HandWrittenSignatureSettings ); - pdfviewer.annotation.addAnnotation("Initial", { - offset: { x: 200, y: 310 }, - pageNumber: 1, - width: 200, - height: 65, - signatureItem: ['Initial'], - initialDialogSettings: { - displayMode: DisplayMode.Text, hideSaveSignature: false - }, - canSave: false, - path: 'Syncfusion', - fontFamily: "Helvetica", - } as HandWrittenSignatureSettings ); - pdfviewer.annotation.addAnnotation("HandWrittenSignature", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - width: 200, - height: 80, - signatureItem: ['Signature'], - signatureDialogSettings: { - displayMode: DisplayMode.Upload, hideSaveSignature: false - }, - canSave: true, - path: "data:image/jpeg;base64,/9j/4AAQSkZJRgAB..." - } as HandWrittenSignatureSettings ); - } -} -{% endhighlight %} {% endtabs %} [View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to/Add%20Handwritten%20Signature%20Programmatically) @@ -476,111 +329,6 @@ export class AppComponent { } } {% 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 @@ -589,68 +337,7 @@ The following example enables or disables the handwritten signature in the PDF V {% 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, diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/stamp-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/stamp-annotation.md deleted file mode 100644 index 0e20580543..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/stamp-annotation.md +++ /dev/null @@ -1,465 +0,0 @@ ---- -layout: post -title: Stamp annotation in Angular PDF Viewer control | Syncfusion -description: Learn about stamp annotations in the Syncfusion Angular PDF Viewer (Essential JS 2): dynamic, sign here, standard business, and custom stamps. -platform: document-processing -control: Stamp annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Stamp Annotation in Angular PDF Viewer component - -The PDF Viewer control provides options to add, edit, delete, and rotate the following stamp annotations in PDF documents: - -* Dynamic -* Sign Here -* Standard Business -* Custom Stamp - -![Stamp annotations example showing dynamic, sign here, standard business, and custom stamps](../images/stamp_annot.png) - -## Add stamp annotations to the PDF document - -The stamp annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Stamp Annotation** drop-down button. The pop-up lists available stamp annotation types. - -![Stamp annotation tool in the PDF Viewer toolbar](../images/stamp_tool.png) - -* Select a stamp type to enable its annotation mode. - -![Stamp type popup listing available stamps](../images/selectstamp_annot.png) - -* Place the stamp on the pages of the PDF document. - -N> When in pan mode and a stamp annotation tool is selected, the PDF Viewer switches to text select mode automatically for a smooth interaction experience. - -The following examples switch to stamp annotation modes. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - - import { Component, OnInit } from '@angular/core'; - import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, SignStampItem - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("Stamp", null, SignStampItem.Witness); - } - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - - import { Component, OnInit } from '@angular/core'; - import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService, SignStampItem - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: ` -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("Stamp", null, SignStampItem.Witness); - } - } - -{% endhighlight %} -{% endtabs %} - -## Add a stamp annotation to the PDF document programmatically -The PDF Viewer library allows adding a stamp annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotation) method. - -Here are examples showing how to add stamp annotations programmatically using addAnnotation(): - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, StampSettings, DynamicStampItem , - SignStampItem, StandardBusinessStampItem, CustomStampSettings} from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addDynamicStamp() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 140 }, - pageNumber: 1 - } as StampSettings, DynamicStampItem.Approved); - } - addSignStamp() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 240 }, - pageNumber: 1 - } as StampSettings, undefined, SignStampItem.Witness); - } - addStandardBusinessStamp() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 340 }, - pageNumber: 1 - } as StampSettings, undefined, undefined, StandardBusinessStampItem.Approved); - } - addCustomStamp() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - viewer.annotation.addAnnotation('Stamp', - { - offset: { x: 100, y: 440 }, - width: 46, - author: 'Guest', - height: 100, - isLock: true, - pageNumber: 1, - customStamps: [ - { - customStampName: "Image", - customStampImageSource: - "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - } - ] - } as CustomStampSettings); - } -} - - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, StampSettings, DynamicStampItem , - SignStampItem, StandardBusinessStampItem, CustomStampSettings} from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addDynamicStamp() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 140 }, - pageNumber: 1 - } as StampSettings, DynamicStampItem.Approved); - } - addSignStamp() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 240 }, - pageNumber: 1 - } as StampSettings, undefined, SignStampItem.Witness); - } - addStandardBusinessStamp() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 340 }, - pageNumber: 1 - } as StampSettings, undefined, undefined, StandardBusinessStampItem.Approved); - } - addCustomStamp() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - viewer.annotation.addAnnotation('Stamp', - { - offset: { x: 100, y: 440 }, - width: 46, - author: 'Guest', - height: 100, - isLock: true, - pageNumber: 1, - customStamps: [ - { - customStampName: "Image", - customStampImageSource: - "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - } - ] - } as CustomStampSettings); - } -} - - -{% endhighlight %} -{% endtabs %} - -## Edit the existing stamp annotation programmatically - -To modify an existing stamp annotation in the Syncfusion® PDF Viewer programmatically, use the **editAnnotation()** method. - -Here is an example of how you can use the **editAnnotation()** method: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - editAnnotation() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "stamp") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].annotationSettings.isLock = true; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - editAnnotation() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "stamp") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].annotationSettings.isLock = true; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } -} - -{% endhighlight %} -{% endtabs %} - -## Add a custom stamp to the PDF document - -* Click the **Edit Annotation** button in the PDF Viewer toolbar. A toolbar appears below it. -* Click the **Stamp Annotation** drop-down button. The pop-up lists available stamp annotation types. -* Click the Custom Stamp button. - -![Add a custom stamp using the file picker dialog](../images/customStamp.png) - -* In the file explorer dialog, choose an image and add it to the PDF page. - -N> Only JPG and JPEG image formats are supported for custom stamp annotations. - -## Setting default properties during control initialization - -Default properties for stamp annotations can be set before creating the control using StampSettings. - -After changing the default opacity using the Edit Opacity tool, the selected value is applied to subsequent stamps. The following example shows how to set default stamp annotation settings. - - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public stampSettings = { opacity: 0.3, author: 'Guest User' }; - } - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, AnnotationService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-root', - // Specifies the template string for the PDF Viewer component. - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService] - }) - export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public stampSettings = { opacity: 0.3, author: 'Guest User' }; - } - -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/sticky-notes-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/sticky-notes-annotation.md deleted file mode 100644 index 814353baee..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/sticky-notes-annotation.md +++ /dev/null @@ -1,397 +0,0 @@ ---- -layout: post -title: Sticky notes in Angular PDF Viewer control | Syncfusion -description: Learn about sticky note annotations in the Syncfusion Angular PDF Viewer (Essential JS 2): add, edit, delete, and default settings. -platform: document-processing -control: Sticky notes annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Sticky notes in Angular PDF Viewer control - -The PDF Viewer control provides options to add, edit, and delete sticky note annotations in the PDF document. - -![Sticky note annotation added to a PDF page](../images/stickynotes_annotation.png) - -## Add a sticky note annotation to the PDF document - -Sticky note annotations can be added to the PDF document using the annotation toolbar. - -* Click the **Comments** button in the PDF Viewer toolbar to open the annotation toolbar. -* Click the position where the sticky note annotation should be added. -* The sticky note annotation appears at the selected position. - -![Sticky notes tool in the PDF Viewer annotation toolbar](../images/stickynotes_tool.png) - -Annotation comments can be added using the comment panel. - -* Select a sticky note annotation in the PDF document and right-click it. -* Choose Comment from the context menu. -* Add comments, replies, and status using the comment panel. - -![Open the comment panel to add or view comments for a sticky note annotation](../images/stickynotes_comment.png) - -## Add a sticky note annotation to the PDF document programmatically - -The PDF Viewer library allows adding a sticky note annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) method. - -The following example shows how to add a sticky note annotation programmatically using `addAnnotation()`: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, StickyNotesSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("StickyNotes", { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false - } as StickyNotesSettings); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, StickyNotesSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("StickyNotes", { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false - } as StickyNotesSettings); - } -} - -{% endhighlight %} -{% endtabs %} - -## Edit an existing sticky note annotation programmatically - -To modify an existing sticky note annotation programmatically, use the editAnnotation() method. - -The following example shows how to modify an existing sticky note annotation using `editAnnotation()`: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - editAnnotation() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "sticky") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - editAnnotation() { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "sticky") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } -} - -{% endhighlight %} -{% endtabs %} - -## Edit the properties of the sticky note annotations - -### Editing opacity - -Edit opacity using the range slider in the Edit Opacity tool. - -![Adjust opacity for a sticky note annotation using the Edit Opacity slider](../images/sticky_opacity.png) - -### Editing comments - -Comment text, replies, and status can be edited in the comment panel. - -* Open the comment panel using the Comment Panel button in the annotation toolbar. - -![Comment panel showing comments and replies for sticky note annotations](../images/commentPanel.png) - -Modify or delete comments or replies, and change status using the menu options in the comment panel. - -![Options to edit or delete comments and replies in the comment panel](../images/sticky_editbtn.png) - -## Set default properties during the control initialization - -Default properties for sticky note annotations can be set before creating the control using `StickyNotesSettings`. - -After changing default opacity with the Edit Opacity tool, the selected value is applied to new sticky note annotations. The following example sets default sticky note annotation properties. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public stickyNotesSettings = { author: 'Syncfusion' }; - ngOnInit(): void { - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - - import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public stickyNotesSettings = { author: 'Syncfusion' }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} - -## Disable sticky note annotations - -The PDF Viewer control provides an option to disable sticky note annotations. The following example shows how to disable the feature. - - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/annotation/text-markup-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/annotation/text-markup-annotation.md deleted file mode 100644 index 6a10a98bcf..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/angular/annotation/text-markup-annotation.md +++ /dev/null @@ -1,1435 +0,0 @@ ---- -layout: post -title: Text markup annotation in Angular PDF Viewer | Syncfusion -description: Learn to add, edit, delete, and customize text markup annotations like highlight, underline, and squiggly in Syncfusion Angular PDF Viewer. -platform: document-processing -control: Text Markup Annotation -documentation: ug -domainurl: ##DomainURL## ---- - -# Text markup annotation in Angular PDF Viewer - -The PDF Viewer provides options to add, edit, and delete text markup annotations, including highlight, underline, strikethrough, and squiggly. - -![Text markup annotations](../images/text_markup_annotation.png) - -## Highlight text - -There are two ways to highlight text: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Highlight** in the context menu. - -![Context menu option to highlight selected text](../images/highlight_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. - * Select **Highlight** to enable highlight mode. - * Select text to add the highlight annotation. - * Alternatively, select text first and then click **Highlight**. - -![Highlight button in the annotation toolbar](../images/highlight_button.PNG) - -When pan mode is active and a text markup mode is entered, the PDF Viewer switches to text selection mode to enable selection. - -Refer to the following code sample to switch to the highlight mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Highlight'); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Highlight'); - } -} -{% endhighlight %} -{% endtabs %} - -Refer to the following code sample to switch back to normal mode from the highlight mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Highlight'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Highlight'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% endtabs %} - -## Highlight text programmatically - -Programmatically add highlights using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) method. - -Example: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, HighlightSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Highlight", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - } as HighlightSettings); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, HighlightSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Highlight", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - } as HighlightSettings); - } -} - -{% endhighlight %} -{% endtabs %} - -## Underline text - -There are two ways to underline text: - -1. Using the context menu - *Select text in the PDF document and right-click it. - * Select **Underline** in the context menu. - -![Context menu option to underline selected text](../images/underline_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. - * Select **Underline** to enable underline mode. - * Select text to add the underline annotation. - * Alternatively, select text first and then click **Underline**. - -![Underline button in the annotation toolbar](../images/underline_button.png) - -In the pan mode, if the underline mode is entered, the PDF Viewer control will switch to text select mode to enable the text selection for underlining the text. - -Refer to the following code sample to switch to the underline mode. - - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Underline'); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Underline'); - } -} -{% endhighlight %} -{% endtabs %} - - -Refer to the following code sample to switch back to normal mode from the underline mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Underline'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Underline'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% endtabs %} - -## Underline text programmatically - -Programmatically add underlines using the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) method. - -Example: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, UnderlineSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Underline", { - bounds: [{ x: 250, y: 148, width: 345, height: 14 }], - pageNumber: 2 - } as HighlightSettings); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, UnderlineSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Underline", { - bounds: [{ x: 250, y: 148, width: 345, height: 14 }], - pageNumber: 2 - } as HighlightSettings); - } -} - -{% endhighlight %} -{% endtabs %} - -## Strikethrough text - -There are two ways to strikethrough text: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Strikethrough** in the context menu. - -![Context menu option to strikethrough selected text](../images/strikethrough_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. - * Select **Strikethrough** to enable strikethrough mode. - * Select text to add the strikethrough annotation. - * Alternatively, select text first and then click **Strikethrough**. - -![Strikethrough button in the annotation toolbar](../images/strikethrough_button.png) - -N> While in pan mode, clicking the strikethrough button switches the viewer to text select mode so text can be selected for annotation. - -Refer to the following code sample to switch to strikethrough mode. - - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Strikethrough'); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Strikethrough'); - } -} -{% endhighlight %} -{% endtabs %} - - -Refer to the following code sample to switch back to normal mode from the strikethrough mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Strikethrough'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Strikethrough'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% endtabs %} - -## Strikethrough text programmatically - -Programmatically add strikethrough using the [addAnnotation](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) method. - -Example: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, StrikethroughSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Strikethrough", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - } as StrikethroughSettings); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, StrikethroughSettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Strikethrough", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - } as StrikethroughSettings); - } -} - -{% endhighlight %} -{% endtabs %} - -## Add Squiggly to text - -There are two ways to add squiggly to text: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Squiggly** in the context menu. - -![Context menu option to add a squiggly underline to selected text](../images/squiggly_context.png) - - -2. Using the annotation toolbar - * Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. - * Select **Squiggly** to enable squiggly mode. - * Select text to add the squiggly annotation. - * Alternatively, select text first and then click **Squiggly**. - -![Squiggly button in the annotation toolbar](../images/squiggly_button.png) - -N> While in pan mode, clicking the squiggly button switches the viewer to text select mode so text can be selected for annotation. - -Refer to the following code sample to switch to squiggly mode. - - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/30.1.37/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Squiggly'); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Squiggly'); - } -} -{% endhighlight %} -{% endtabs %} - - -Refer to the following code sample to switch back to normal mode from the squiggly mode. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/30.1.37/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Squiggly'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode('Squiggly'); - } - setNone() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.annotationModule.setAnnotationMode("None"); - } -} -{% endhighlight %} -{% endtabs %} - -## Squiggly text programmatically - -Refer to the following code snippet to switch back to normal mode from squiggly mode. Use the [addAnnotation()](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotation#addannotationn) API to add squiggly annotations. - -Example: - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, SquigglySettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/30.1.37/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Squiggly", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - } as SquigglySettings); - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, SquigglySettings } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - addAnnotation() { - var pdfviewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - pdfviewer.annotation.addAnnotation("Squiggly", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - } as SquigglySettings); - } -} - -{% endhighlight %} -{% endtabs %} - -## Deleting a text markup annotation - -The selected annotation can be deleted in the following ways: - -1. Using the Delete/Backspace key - * Select the annotation. - * Press Delete (or Backspace). The selected annotation is removed. - -2. Using the annotation toolbar - * Select the annotation. - * Click **Delete Annotation** in the annotation toolbar. The selected annotation is removed. - -![Delete annotation button in the annotation toolbar](../images/delete_button.png) - -## Edit text markup annotation properties - -The color and opacity of text markup annotations can be edited using the Edit Color and Edit Opacity tools in the annotation toolbar. - -### Edit color - -Use the color palette in the Edit Color tool to change the annotation color. - -![Color palette in the Edit Color tool for text markup annotations](../images/edit_color.png) - -### Edit opacity - -Use the range slider in the Edit Opacity tool to change annotation opacity. - -![Range slider in the Edit Opacity tool for text markup annotations](../images/edit_opacity.png) - -## Set default properties during control initialization - -Set default properties before creating the control using `highlightSettings`, `underlineSettings`, `strikethroughSettings`, and `squigglySettings`. - -N> After editing default color and opacity with the Edit Color and Edit Opacity tools, the default values update to the selected settings. - -Refer to the following code sample to set the default annotation settings. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - public highlightSettings = { author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: '' }; - public underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9, modifiedDate: '' }; - public strikethroughSettings = { author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9, modifiedDate: '' }; - public squigglySettings = { author: 'Guest User', subject: 'Confidential', color: '#0000ff', opacity: 0.9, modifiedDate: '' }; - ngOnInit(): void { - } -} -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public highlightSettings = { author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: '' }; - public underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9, modifiedDate: '' }; - public strikethroughSettings = { author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9, modifiedDate: '' }; - public squigglySettings = { author: 'Guest User', subject: 'Confidential', color: '#0000ff', opacity: 0.9, modifiedDate: '' }; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} - -## Perform undo and redo - -The PDF Viewer supports undo and redo for changes. For text markup annotations, undo and redo are provided for: - -* Inclusion of the text markup annotations. -* Deletion of the text markup annotations. -* Change of either color or opacity of the text markup annotations. - -Undo and redo actions can be performed in the following ways: - -1. Using keyboard shortcuts: - After performing a text markup annotation action, press Ctrl+Z to undo and Ctrl+Y 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, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } - Undo() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.undo(); - } - Redo() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.redo(); - } -} - -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } - Undo() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.undo(); - } - Redo() { - var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfviewer.redo(); - } -} -{% endhighlight %} -{% endtabs %} - -## Save text markup annotations - -Click the download tool in the toolbar to save text markup annotations to the PDF document. The original document is not modified. - -## Print text markup annotations - -Click the print tool in the toolbar to print the PDF document with text markup annotations. The original document is not modified. - -## Disable text markup annotation - -Disable text markup annotations using the `enableTextMarkupAnnotation` property. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = "https://cdn.syncfusion.com/ej2/25.1.35/dist/ej2-pdfviewer-lib"; - ngOnInit(): void { - } -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } -} -{% endhighlight %} -{% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/download.md b/Document-Processing/PDF/PDF-Viewer/angular/download.md index d88c541d6c..0eb947c76a 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/download.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/download.md @@ -39,39 +39,9 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} + ![PDF Viewer toolbar with download button](images/download.png) To invoke download programmatically, use the following snippet: diff --git a/Document-Processing/PDF/PDF-Viewer/angular/forms/import-export-form-fields/import-form-fields.md b/Document-Processing/PDF/PDF-Viewer/angular/forms/import-export-form-fields/import-form-fields.md index 49d907a7cb..74ecc17762 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/forms/import-export-form-fields/import-form-fields.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/forms/import-export-form-fields/import-form-fields.md @@ -17,7 +17,7 @@ This guide shows how to import form field values into an already loaded PDF in t 2. Call [`importFormFields(data, format)`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#importformfields) where `format` is one of `FormFieldDataFormat.Fdf`, `FormFieldDataFormat.Xfdf`, or `FormFieldDataFormat.Json`. `data` may be a file path (for server/file-based imports) / base64 string or a JavaScript object mapping field names to values. -3. Verify the form fields are populated after the import completes. For server-backed imports, ensure [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) is configured and the import file is accessible by the server. +3. Verify the form fields are populated after the import completes. ## Example diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-author-name-using-annotation-settings.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-author-name-using-annotation-settings.md index ed278ae55b..08041e64ce 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-author-name-using-annotation-settings.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-author-name-using-annotation-settings.md @@ -60,35 +60,4 @@ export class AppComponent { } ``` {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -```ts -// app.ts -import { Component } from '@angular/core'; -import { AnnotationService, AnnotationSettingsModel, BookmarkViewService, FormFieldsService, FreeTextSettingsModel, LinkAnnotationService, MagnificationService, NavigationService, PageOrganizerService, PdfViewerModule, PrintService, TextSearchService, TextSelectionService, ThumbnailViewService, ToolbarService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - imports: [ PdfViewerModule ], - providers: [ToolbarService, MagnificationService, NavigationService, LinkAnnotationService, ThumbnailViewService, BookmarkViewService, TextSelectionService, TextSearchService, PrintService, AnnotationService, FormFieldsService, PageOrganizerService], - template: ` - - - ` -}) -export class AppComponent { - public serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; - public docPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public annotationSettings: AnnotationSettingsModel = { - author: 'syncfusion', minHeight: 30, maxHeight: 500, minWidth: 30, maxWidth: 500, isLock: false, skipPrint: false, skipDownload: false - }; - public freeTextSettings: FreeTextSettingsModel = { - allowEditTextOnly: true - }; -} -``` -{% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-selection-border.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-selection-border.md index 11c1f08ba3..f594f53f3f 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-selection-border.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/change-selection-border.md @@ -28,19 +28,6 @@ Recommended steps style="height:640px;display:block"> -{% endhighlight %} - -{% highlight html tabtitle="Server-Backed" %} - - - - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/configure-annotation-selector-setting.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/configure-annotation-selector-setting.md index 98263b74c1..6f49aa5e22 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/configure-annotation-selector-setting.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/configure-annotation-selector-setting.md @@ -1,6 +1,6 @@ --- layout: post -title: Configure annotation selector settings in Angular PDF Viewer | Syncfusion +title: Configure annotation selector setting Angular PDF Viewer | Syncfusion description: Learn how to configure annotation selector settings in the Angular PDF Viewer using annotationSelectorSettings and related options. platform: document-processing control: PDF Viewer @@ -8,15 +8,15 @@ documentation: ug domainurl: ##DomainURL## --- -# Configure Annotation Selector Settings +# Configure Annotation Selector Settings in Angular ### Annotation Selector Settings -Use the [annotationSelectorSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotationSelectorSettings/) property to customize the appearance and interaction behavior of the annotation selector in the Angular PDF Viewer UI. +Use the [annotationSelectorSettings](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotationSelectorSettings) property to customize the appearance and interaction behavior of the annotation selector in the Angular PDF Viewer UI. ### AnnotationSelectorSettingsModel -The [AnnotationSelectorSettingsModel](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotationSelectorSettingsModel/) defines selector appearance and behavior settings—such as border colors, resizer appearance, and selector line style—providing fine-grained control over how annotations are displayed and manipulated. +The [AnnotationSelectorSettingsModel](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/annotationSelectorSettingsModel) defines selector appearance and behavior settings—such as border colors, resizer appearance, and selector line style—providing fine-grained control over how annotations are displayed and manipulated. Steps to configure annotation selector settings @@ -87,69 +87,6 @@ export class AppComponent implements OnInit { } } {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - AnnotationService, - TextSearchService, - TextSelectionService, - FormFieldsService, - FormDesignerService, - PrintService, - AnnotationResizerLocation, - CursorType -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - AnnotationService, - TextSearchService, - TextSelectionService, - FormFieldsService, - FormDesignerService, - PrintService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public resource: string = 'https://cdn.syncfusion.com/ej2/27.1.48/dist/ej2-pdfviewer-lib'; - public annotationSelection = { - selectionBorderColor: 'blue', - resizerBorderColor: 'red', - resizerFillColor: '#4070ff', - resizerSize: 8, - selectionBorderThickness: 1, - resizerShape: 'Circle', - selectorLineDashArray: [5, 6], - resizerLocation: AnnotationResizerLocation.Corners | AnnotationResizerLocation.Edges, - resizerCursorType: CursorType.grab - }; - ngOnInit(): void { - } -} -{% endhighlight %} {% endtabs %} #### Key properties @@ -161,7 +98,7 @@ export class AppComponent implements OnInit { - selectionBorderThickness: Specifies the thickness of the selection border. - resizerShape: Sets the shape of the resizer handles (for example, Circle or Square). - selectorLineDashArray: Specifies the dash pattern for the selector line. -- resizerLocation: Determines where the resizers appear relative to the annotation (for example, Corners or Edges). +- resizerLocation: Determines where the resizer appear relative to the annotation (for example, Corners or Edges). - resizerCursorType: Sets the cursor style when hovering over a resizer. [View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md index 550cc565d6..caafcf67ed 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md @@ -1,6 +1,6 @@ --- layout: post -title: Convert PDF Library bounds to PDF Viewer bounds | Syncfusion +title: Convert PDF Library bounds to PDF Viewer bounds Angular | Syncfusion description: Learn how to convert PDF Library bounds into PDF Viewer bounds when exporting annotations, ensuring accurate placement in the Angular PDF Viewer. platform: document-processing control: PDF Viewer @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Convert PDF Library bounds to PDF Viewer bounds +# Convert PDF Library bounds to PDF Viewer bounds in Angular When exporting annotations from the PDF Library, convert the annotation bounds into the PDF Viewer coordinate system so exported annotations appear at the correct position and scale in the viewer. @@ -22,7 +22,7 @@ Create an instance of the PDF Viewer and configure it with the required services diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/custom-context-menu.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/custom-context-menu.md index 9eeb11d33e..867645bc54 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/custom-context-menu.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/custom-context-menu.md @@ -221,11 +221,6 @@ The following is the output of the custom context menu with customization. {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below serviceUrl in the `app.ts` file -`public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'`; -Within the template, configure the PDF Viewer by adding the `[serviceUrl]='service'` attribute inside the div element. - {% previewsample "/document-processing/samples/pdfviewer/angular/custom-context-menu" %} [View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to/Custom%20Context%20Menu) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/download-start-event.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/download-start-event.md index 4e66bf9ac3..609baaaeb8 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/download-start-event.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/download-start-event.md @@ -1,6 +1,6 @@ --- layout: post -title: Controlling File Downloads in Angular PDF Viewer component | Syncfusion +title: Controlling File Downloads Angular PDF Viewer component | Syncfusion description: Learn here how to Controlling File Downloads in Syncfusion Angular PDF Viewer component of Syncfusion Essential JS 2 and more. platform: document-processing control: PDF Viewer @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Controlling File Downloads in Syncfusion® PDF Viewer +# Controlling File Downloads in Angular PDF Viewer The PDF Viewer exposes a `downloadStart` event that enables interception of a document download before it begins. Use this event to apply custom logic and, if needed, cancel the download by setting the event's `cancel` flag. @@ -51,44 +51,6 @@ import { PdfViewerModule, LinkAnnotationService, BookmarkViewService, } } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerModule, LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService, DownloadStartEventArgs } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { - } - public downloadStart(args: DownloadStartEventArgs): void { - // Your custom logic here - args.cancel = true; // Prevent download action - } -} - {% endhighlight %} {% endtabs %} @@ -96,4 +58,4 @@ By default, the `cancel` argument is `false`, so the download proceeds unless th ### Enhanced Flexibility -Using the [downloadStart](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/downloadStartEventArgs/) event enables conditional control over downloads—for example, to enforce authentication, restrict downloads for certain documents, or prompt users for confirmation. When using server-backed viewers, confirm whether server-side behavior requires additional handling; canceling the client-side event prevents the local download but may not affect server workflows. \ No newline at end of file +Using the [downloadStart](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/downloadStartEventArgs) event enables conditional control over downloads—for example, to enforce authentication, restrict downloads for certain documents, or prompt users for confirmation. When using server-backed viewers, confirm whether server-side behavior requires additional handling; canceling the client-side event prevents the local download but may not affect server workflows. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-disable-annotation.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-disable-annotation.md index a1e896ea2e..0de8bfa863 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-disable-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-disable-annotation.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# How to enable and disable the delete button based on annotation selection and unselection events +# How to enable and disable the delete button This article demonstrates how to enable and disable a toolbar delete button in response to annotation selection and unselection events using `annotationSelect` and `annotationUnSelect`. @@ -27,19 +27,6 @@ Example: style="height:640px; display: block"> -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-local-storage.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-local-storage.md index d66566f03d..cf73aa5e1a 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-local-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/enable-local-storage.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Managing Local Storage in Syncfusion® PDF Viewer +# Managing Local Storage in Syncfusion PDF Viewer The Syncfusion® PDF Viewer exposes the `enableLocalStorage` property to control how session-specific viewer data is stored. Configure this property to choose between the viewer's internal storage mechanism (in-memory collection) and the browser's session storage. @@ -41,7 +41,7 @@ import {
    @@ -65,7 +65,7 @@ import { }) export class AppComponent implements OnInit { public document: string = 'PDF_Succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; + public resource: string='https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; ngOnInit(): void { } diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/extract-text-completed.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/extract-text-completed.md index 2386d8fc27..b055ab32e0 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/extract-text-completed.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/extract-text-completed.md @@ -1,6 +1,6 @@ --- layout: post -title: extractTextCompleted Event in Angular PDF Viewer component | Syncfusion +title: extractTextCompleted Event Angular PDF Viewer component | Syncfusion description: Learn here all about extractTextCompleted Event in Syncfusion Angular PDF Viewer component of Syncfusion Essential JS 2 and more. platform: document-processing control: extractTextCompleted @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -## Extract text using the extractTextCompleted event in the PDF Viewer +# Extract text using the extractTextCompleted event in the PDF Viewer The PDF Viewer can extract page text along with bounding information. Enable text extraction using the `isExtractText` property and handle the `extractTextCompleted` event to receive extracted text and bounds for the document. @@ -20,7 +20,7 @@ The following steps are used to extract the text from the page. ```html - - - -
    - `, - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - AnnotationService, - TextSearchService, - TextSelectionService, - FormFieldsService, - FormDesignerService, - PrintService - ] -}) -export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - - ngOnInit(): void { } - - getBase64() { - const viewer = (document.getElementById('pdfViewer') as any).ej2_instances[0]; - viewer.saveAsBlob().then((blobData: Blob) => { - const reader = new FileReader(); - reader.onload = () => { - const base64data = reader.result as string; - console.log(base64data); // Outputs a data URL containing the Base64 string of the PDF - }; - reader.readAsDataURL(blobData); - }); - } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/load-n-number-page.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/load-n-number-page.md index 2d75718670..7d410c7e52 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/load-n-number-page.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/load-n-number-page.md @@ -8,11 +8,11 @@ documentation: ug domainurl: ##DomainURL## --- -# Load N pages initially +# Load N pages initially in Angular Control the number of pages the PDF Viewer renders on the initial load to improve perceived performance and reduce initial memory usage. Additional pages are rendered dynamically as the user scrolls through the document, allowing quick access to early pages without loading the entire file. -Set the [initialRenderPages](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/#initialrenderpages) property to specify how many pages to render initially. For large documents, avoid high values for `initialRenderPages` because rendering many pages at once increases memory use and may slow loading. Typical ranges of 10–20 pages work well for most documents; adjust based on document size and client capabilities. +Set the [initialRenderPages](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#initialrenderpages) property to specify how many pages to render initially. For large documents, avoid high values for `initialRenderPages` because rendering many pages at once increases memory use and may slow loading. Typical ranges of 10–20 pages work well for most documents; adjust based on document size and client capabilities. {% tabs %} {% highlight ts tabtitle="Standalone" %} @@ -46,40 +46,6 @@ export class AppComponent implements OnInit { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService - } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService] -}) -export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public initialRender = 10; - ngOnInit(): void { - } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-annotation-in-a-document.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-annotation-in-a-document.md index a51a77470e..4185c06d38 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-annotation-in-a-document.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-annotation-in-a-document.md @@ -28,17 +28,6 @@ The following sample shows how to set `IsLocked` for custom stamp annotations wh style="height:640px;display:block"> -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - - - - - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-formfield-in-a-document.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-formfield-in-a-document.md index b0a2ebb343..51b8c8c9a8 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-formfield-in-a-document.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/lock-formfield-in-a-document.md @@ -151,141 +151,5 @@ export class AppComponent implements OnInit { }); } } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, PageOrganizerService, - TextFieldSettings, RadioButtonFieldSettings, InitialFieldSettings, - CheckBoxFieldSettings, SignatureFieldSettings, LoadEventArgs } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - - public document: string = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; - public service: string = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer"; - ngOnInit(): void { - } - public documentLoaded(e: LoadEventArgs): void { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - if (e.documentName === 'form-designer.pdf') { - viewer.formDesignerModule.addFormField('Textbox', { - name: 'First Name', - bounds: { X: 146, Y: 229, Width: 150, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'Middle Name', - bounds: { X: 338, Y: 229, Width: 150, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'Last Name', - bounds: { X: 530, Y: 229, Width: 150, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('RadioButton', { - bounds: { X: 148, Y: 289, Width: 18, Height: 18 }, - name: 'Gender', - isSelected: false, - } as RadioButtonFieldSettings); - viewer.formDesignerModule.addFormField('RadioButton', { - bounds: { X: 292, Y: 289, Width: 18, Height: 18 }, - name: 'Gender', - isSelected: false, - } as RadioButtonFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'DOB Month', - bounds: { X: 146, Y: 320, Width: 35, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'DOB Date', - bounds: { X: 193, Y: 320, Width: 35, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'DOB Year', - bounds: { X: 242, Y: 320, Width: 35, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('InitialField', { - name: 'Agree', - bounds: { X: 148, Y: 408, Width: 200, Height: 43 }, - } as InitialFieldSettings); - viewer.formDesignerModule.addFormField('InitialField', { - name: 'Do Not Agree', - bounds: { X: 148, Y: 466, Width: 200, Height: 43 }, - } as InitialFieldSettings); - viewer.formDesignerModule.addFormField('CheckBox', { - name: 'Text Message', - bounds: { X: 56, Y: 664, Width: 20, Height: 20 }, - isChecked: false, - } as CheckBoxFieldSettings); - viewer.formDesignerModule.addFormField('CheckBox', { - name: 'Email', - bounds: { X: 242, Y: 664, Width: 20, Height: 20 }, - isChecked: false, - } as CheckBoxFieldSettings); - viewer.formDesignerModule.addFormField('CheckBox', { - name: 'Appointment Reminder', - bounds: { X: 56, Y: 740, Width: 20, Height: 20 }, - isChecked: false, - } as CheckBoxFieldSettings); - viewer.formDesignerModule.addFormField('CheckBox', { - name: 'Request for Customerservice', - bounds: { X: 56, Y: 778, Width: 20, Height: 20 }, - isChecked: false, - } as CheckBoxFieldSettings); - viewer.formDesignerModule.addFormField('CheckBox', { - name: 'Information Billing', - bounds: { X: 290, Y: 740, Width: 20, Height: 20 }, - isChecked: false, - } as CheckBoxFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'My Email', - bounds: { X: 146, Y: 850, Width: 200, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'My Phone', - bounds: { X: 482, Y: 850, Width: 200, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('SignatureField', { - name: 'Sign', - bounds: { X: 57, Y: 923, Width: 200, Height: 43 }, - } as SignatureFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'DOS Month', - bounds: { X: 386, Y: 923, Width: 35, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'DOS Date', - bounds: { X: 434, Y: 923, Width: 35, Height: 24 }, - } as TextFieldSettings); - viewer.formDesignerModule.addFormField('Textbox', { - name: 'DOS Year', - bounds: { X: 482, Y: 923, Width: 35, Height: 24 }, - } as TextFieldSettings); - } - var formFields = viewer.retrieveFormFields(); - formFields.map((formField: any) => { - var isReadOnly = { isReadOnly: true }; - viewer.formDesignerModule.updateFormField(formField, isReadOnly); - }); - } -} - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/min-max-zoom.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/min-max-zoom.md index bc05bf9835..3b7cb3a077 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/min-max-zoom.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/min-max-zoom.md @@ -57,42 +57,6 @@ export class AppComponent implements OnInit { } } {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public maxZoom = 270; - public minZoom = 45; - ngOnInit(): void { - } -} -{% endhighlight %} {% endtabs %} #### Restrict Zoom Percentage on Mobile Devices @@ -143,52 +107,6 @@ import {Browser} from '@syncfusion/ej2-base'; } } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormFieldsService, FormDesignerService, - PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; -import {Browser} from '@syncfusion/ej2-base'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormFieldsService, FormDesignerService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { - } - documentLoaded(e: any): void { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - if (Browser.isDevice && !viewer.enableDesktopMode) { - viewer.maxZoom = 200; - viewer.minZoom = 10; - } - else { - viewer.zoomMode = 'Default'; - } - } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/pagerenderstarted-pagerendercompleted.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/pagerenderstarted-pagerendercompleted.md index 4d58a45fb7..75ba0dd812 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/pagerenderstarted-pagerendercompleted.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/pagerenderstarted-pagerendercompleted.md @@ -10,14 +10,14 @@ domainurl: ##DomainURL## # Page render initiate and complete events -In the PDF Viewer, the `pageRenderInitiate` and `pageRenderComplete` events fire during the page rendering lifecycle: +In the PDF Viewer, the `pageRenderInitiate` and `pageRenderComplete` events fire during the page rendering life cycle: - `pageRenderInitiate`: fired when the rendering of a page begins. Use this event to initialize resources, show loading indicators, or set up rendering parameters before the page content is drawn. - `pageRenderComplete`: fired when the rendering of a page finishes. Use this event to hide loading indicators, record render timing, or run post-render processing. ```html ® PDF Viewer component. +The provided code demonstrates how to subscribe to the [pageRenderInitiate](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/pageRenderInitiateEventArgs) and [pageRenderComplete](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/pageRenderCompleteEventArgs) events in the Syncfusion® PDF Viewer component. [View sample in GitHub](https://github.com/SyncfusionExamples/angular-pdf-viewer-examples/tree/master/How%20to/PageRenderStarted%20and%20PageRenderCompleted%20event) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/restricting-zoom-in-mobile-mode.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/restricting-zoom-in-mobile-mode.md index 5fcec3c4a7..f1eef2757f 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/restricting-zoom-in-mobile-mode.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/restricting-zoom-in-mobile-mode.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Restrict zoom percentage on mobile devices +# Restrict zoom percentage on mobile devices in Angular Use `minZoom` and `maxZoom` to restrict zoom levels on mobile devices and improve scrolling performance and perceived load time. Restricting zoom prevents extreme zoom levels that can degrade rendering performance on constrained devices. @@ -56,52 +56,6 @@ import {Browser} from '@syncfusion/ej2-base'; } } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormFieldsService, FormDesignerService, - PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; -import {Browser} from '@syncfusion/ej2-base'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormFieldsService, FormDesignerService, PageOrganizerService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { - } - documentLoaded(e: any): void { - var viewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - if (Browser.isDevice && !viewer.enableDesktopMode) { - viewer.maxZoom = 200; - viewer.minZoom = 10; - } - else { - viewer.zoomMode = 'Default'; - } - } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-custom-stamp-item.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-custom-stamp-item.md index 9f77a72310..a6436ec128 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-custom-stamp-item.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-custom-stamp-item.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Display custom stamp items in the custom stamp dropdown +# Display custom stamp items in the custom stamp dropdown in Angular ### Overview @@ -94,77 +94,6 @@ export class AppComponent implements OnInit { } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - AnnotationService, - TextSearchService, - TextSelectionService, - FormFieldsService, - FormDesignerService, - PrintService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - template: ` -
    - - -
    - `, - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - AnnotationService, - TextSearchService, - TextSelectionService, - FormFieldsService, - FormDesignerService, - PrintService, - ], -}) -export class AppComponent implements OnInit { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public serviceUrl: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - - public customStampSettings = { - isAddToMenu: true, - customStamps: [ - { - customStampName: 'Image1', - customStampImageSource: 'data:image/png;base64,...' // Provide a valid base64 or URL for the image - }, - { - customStampName: 'Image2', - customStampImageSource: 'data:image/png;base64,...' // Provide a valid base64 or URL for the image - } - ], - enableCustomStamp: true, - opacity: 1, - }; - - ngOnInit(): void {} - -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-pop-up-after-completion-of-export-form-fields.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-pop-up-after-completion-of-export-form-fields.md index 9b440d9f6a..6685a6fc8d 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-pop-up-after-completion-of-export-form-fields.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/show-pop-up-after-completion-of-export-form-fields.md @@ -19,29 +19,7 @@ Use the following example to display a notification after a successful export. - - -//Method to notify popup once the form is submitted. -public fireExportRequestSuccess() { - var pdfViewer = (document.getElementById('pdfViewer')) - .ej2_instances[0]; - //API to notify popup once the form is submitted. - pdfViewer.viewerBase.openImportExportNotificationPopup( - 'Your form information has been saved. You can resume it at any times.Form Information Saved' - ); -} - -{% endhighlight %} - -{% highlight js tabtitle="Server-Backed" %} - - - diff --git a/Document-Processing/PDF/PDF-Viewer/angular/how-to/signatureselect-signatureunselect.md b/Document-Processing/PDF/PDF-Viewer/angular/how-to/signatureselect-signatureunselect.md index f133f14b84..a2c227c791 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/how-to/signatureselect-signatureunselect.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/how-to/signatureselect-signatureunselect.md @@ -24,7 +24,7 @@ The following snippet shows how to subscribe to `signatureSelect` and `signature ```html - - - `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} @@ -113,32 +83,6 @@ You can switch the interaction mode of the PDF Viewer using the following code s public interaction = 'Pan'; } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public interaction = 'Pan'; - } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/hyperlink.md b/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/hyperlink.md index f979c7b381..b7afb32a69 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/hyperlink.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/hyperlink.md @@ -72,35 +72,6 @@ export class AppComponent { ngOnInit(): void {} } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService ] -}) -export class AppComponent { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - ngOnInit(): void {} -} {% endhighlight %} {% endtabs %} @@ -148,34 +119,6 @@ export class AppComponent { ngOnInit(): void {} } {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService ] -}) -export class AppComponent { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - ngOnInit(): void {} -} -{% endhighlight %} {% endtabs %} ### Handle hyperlink events @@ -240,46 +183,6 @@ export class AppComponent { ngOnInit(): void {} } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService ] -}) -export class AppComponent { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - onHyperlinkClick(args: any): void { - console.log('Hyperlink Clicked:', args.hyperlink); - // To prevent default navigation, set: args.cancel = true; - } - - onHyperlinkMouseOver(args: any): void { - console.log('Mouse is over hyperlink:', args.hyperlinkElement.href); - } - - ngOnInit(): void {} -} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page-thumbnail.md b/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page-thumbnail.md index a2822215cf..4cf511c273 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page-thumbnail.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page-thumbnail.md @@ -46,37 +46,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent { - @ViewChild('pdfViewer') public pdfViewer: PdfViewerComponent; - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page.md b/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page.md index b7a7abc013..7bb8526d9b 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/interactive-pdf-navigation/page.md @@ -83,36 +83,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public resource: string = 'https://cdn.syncfusion.com/ej2/23.2.6/dist/ej2-pdfviewer-lib'; } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} @@ -197,59 +167,6 @@ import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, Magnifi public goToPreviousPage(): void { this.pdfViewer.navigation.goToPreviousPage(); } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit, ViewChild } from '@angular/core'; -import { PdfViewerComponent, LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    -
    - - - - - -
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent { - @ViewChild('pdfViewer') public pdfViewer: PdfViewerComponent; - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - public goToFirstPage(): void { - this.pdfViewer.navigation.goToFirstPage(); - } - public goToLastPage(): void { - this.pdfViewer.navigation.goToLastPage(); - } - public goToNextPage(): void { - this.pdfViewer.navigation.goToNextPage(); - } - public goToPage(): void { - this.pdfViewer.navigation.goToPage(4); - } - public goToPreviousPage(): void { - this.pdfViewer.navigation.goToPreviousPage(); - } - } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/magnification.md b/Document-Processing/PDF/PDF-Viewer/angular/magnification.md index a7655a9da8..a52b1ff342 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/magnification.md @@ -47,38 +47,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/mobile-toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/mobile-toolbar.md index 97dd2d66a0..1152a256ee 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/mobile-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/mobile-toolbar.md @@ -92,40 +92,6 @@ export class AppComponent implements OnInit { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } -} {% endhighlight %} {% endtabs %} @@ -170,41 +136,6 @@ export class AppComponent implements OnInit { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, - MagnificationService, ThumbnailViewService, ToolbarService, - NavigationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, - AnnotationService, PageOrganizerService } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - // specifies the template string for the PDF Viewer component - template: `
    - - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, TextSelectionService, PrintService, - AnnotationService, FormDesignerService, FormFieldsService, PageOrganizerService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - ngOnInit(): void { - } -} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/navigation.md b/Document-Processing/PDF/PDF-Viewer/angular/navigation.md index 2c2026b14e..68da853219 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/navigation.md @@ -53,38 +53,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} @@ -123,38 +91,6 @@ export class AppComponent implements OnInit { public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService,ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] -}) -export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -} - {% endhighlight %} {% endtabs %} @@ -192,37 +128,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService,TextSearchService,TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} @@ -266,37 +171,6 @@ Table of contents navigation allows users to jump to sections listed in the PDF' public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - - import { Component, OnInit } from '@angular/core'; - import { LinkAnnotationService,BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; - @Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} @@ -331,38 +205,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public linkOpenState = 'NewTab'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public linkOpenState = 'NewTab'; - } - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-amazon-s3.md b/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-amazon-s3.md index dea35fffa0..a4171ff95c 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-amazon-s3.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-amazon-s3.md @@ -74,149 +74,4 @@ loadDocument() { N> Install the AWS SDK package appropriate for the project. For v2 use `npm install aws-sdk`; for v3 prefer the modular packages such as `@aws-sdk/client-s3`. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using the server-backed PDF Viewer - -Follow these steps to load a PDF from AWS S3 using the server-backed PDF Viewer - -**Step 1:** Create a Simple PDF Viewer Sample in Angular - -Create a basic PDF Viewer sample by following the getting started guide: [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started) - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` - -5. Modify the `Load()` method to load the PDF files from AWS S3. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  - -public async Task Load([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - - string document = jsonObject["document"]; - - // Specify the document name or retrieve it from a different source - var response = await s3Client.GetObjectAsync(_bucketName, document); - - Stream responseStream = response.ResponseStream; - responseStream.CopyTo(stream); - stream.Seek(0, SeekOrigin.Begin); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - - jsonResult = pdfviewer.Load(stream, jsonObject); - - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace the placeholders with actual values when testing. For production deployments, avoid storing AWS credentials in configuration files; use secure server-side credential management, IAM roles, or pre-signed URLs. - -**Step 3:** Configure the PDF Viewer component - -Set the serviceUrl of the PDF Viewer to your web service endpoint (replace the localhost URL with your server URL). Set the documentPath to the PDF file name to load from AWS S3. Ensure the document name matches an object in your bucket. - -```typescript -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService,ThumbnailViewService, - ToolbarService, NavigationService, AnnotationService, TextSearchService, - TextSelectionService, PrintService, FormDesignerService, FormFieldsService] - }) - export class AppComponent implements OnInit { - // Replace the "localhost:44396" with the actual URL of your server - public service = 'https://localhost:44396/pdfviewer'; - public documentPath = 'PDF_Succinctly.pdf'; - } -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-azure-blob-storage.md b/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-azure-blob-storage.md index 266f7907a8..579fbb5998 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-azure-blob-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-azure-blob-storage.md @@ -86,131 +86,4 @@ blobToBase64(blob: Blob): Promise { } ``` -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage). - -## Using the server-backed PDF Viewer - -Follow these steps to load a PDF from Azure Blob Storage using the server-backed PDF Viewer. - -**Step 1:** Create a Simple PDF Viewer Sample in Angular - -Follow the getting-started guide in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started) to create a basic PDF Viewer sample in Angular. - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private readonly string _storageConnectionString; -private readonly string _storageContainerName; -private readonly ILogger _logger; - -public PdfViewerController(IConfiguration configuration, ILogger logger) -{ - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); - _logger = logger; -} -``` - -5. Modify the `Load()` method to load PDF files from Azure Blob Storage. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  -  -public IActionResult Load([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.TryParse(jsonObject["isFileName"], out bool isFileName) && isFileName) - { - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - string fileName = jsonObject["document"]; - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - BlockBlobClient blockBlobClient = containerClient.GetBlockBlobClient(fileName); - blockBlobClient.DownloadTo(stream); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -Note: Do not store secrets in source control. Use secure configuration options such as Azure Key Vault, environment variables, or a secrets manager to hold connection strings. - -**Step 3:** Configure the PDF Viewer component - -Set the serviceUrl to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from Azure Blob Storage. Ensure the document name exists in your Azure container. - -```typescript -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService,ThumbnailViewService, - ToolbarService, NavigationService, AnnotationService, TextSearchService, - TextSelectionService, PrintService, FormDesignerService, FormFieldsService] - }) - export class AppComponent implements OnInit { - // Replace the "localhost:44396" with the actual URL of your server - public service = 'https://localhost:44396/pdfviewer'; - public documentPath = 'PDF_Succinctly.pdf'; - } -``` - -N> The `Azure.Storage.Blobs` NuGet package must be installed in your application to use the previous code example. - [View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-dropbox-cloud-file-storage.md b/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-dropbox-cloud-file-storage.md index 634981e56f..c9cc21da81 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-dropbox-cloud-file-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/open-pdf-file/from-dropbox-cloud-file-storage.md @@ -63,149 +63,4 @@ private blobToBase64(blob: Blob): Promise { N> The **npm install dropbox** package must be installed in the Angular application to use the Dropbox SDK. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) - -## Using the server-backed PDF Viewer - -To load a PDF file from Dropbox cloud file storage in a PDF Viewer, you can follow the steps below - -**Step 1** Create a Dropbox API - -To create a Dropbox API App, you should follow the official documentation provided by Dropbox [link](https://www.dropbox.com/developers/documentation/dotnet#tutorial). This enables programmatic access with secure credentials. - -**Step 2:** Create a PDF Viewer sample in Angular - -Start by following the steps provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started) to create a simple PDF Viewer sample in Angular. This will give you a basic setup of the PDF Viewer component. - -**Step 3:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Dropbox.Api; -using Dropbox.Api.Files; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _folderName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _folderName = _configuration.GetValue("FolderName"); -} - -``` - -5. Modify the `Load()` method to load the PDF files from Dropbox cloud file storage. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  - -public async Task Load([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - // Get the file name from the jsonObject, which should contain the Dropbox file name - string fileName = jsonObject["document"]; - - using (var dropBox = new DropboxClient(_accessToken)) - { - using (var response = await dropBox.Files.DownloadAsync(_folderName + "/" + fileName)) - { - var byteArray = await response.GetContentAsByteArrayAsync(); - - // Load the PDF file into the PDF viewer - stream = new MemoryStream(byteArray); - } - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} - -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Dropbox_Access_Token", - "FolderName": "Your_Folder_Name" -} -``` - -N> Replace the placeholders with your actual Dropbox values: Access Token and Folder Name. - -**Step 4:** Configure the PDF Viewer component - -Set the serviceUrl to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from Dropbox. Ensure the document name exists in your Dropbox folder. - -```typescript -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService,ThumbnailViewService, - ToolbarService, NavigationService, AnnotationService, TextSearchService, - TextSelectionService, PrintService, FormDesignerService, FormFieldsService] - }) - export class AppComponent implements OnInit { - // Replace the "localhost:44396" with the actual URL of your server - public service = 'https://localhost:44396/pdfviewer'; - public documentPath = 'PDF_Succinctly.pdf'; - } -``` - -N> The **Dropbox.Api** NuGet package must be installed in the web service project to use the Dropbox SDK. - -N> Replace `PDF_Succinctly.pdf` with the actual document name to load from Dropbox. Ensure the specified document exists in the configured Dropbox folder and is passed to the `documentPath` property of the PDF Viewer component. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Server-Backed) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/import-pages.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/import-pages.md index aa17ab7a43..7f1fdf5556 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/import-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/import-pages.md @@ -20,7 +20,7 @@ This guide explains how to import pages from another PDF into the current docume - EJ2 Angular PDF Viewer installed - PDF Viewer is injected with `PageOrganizer` service -- [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) (standalone) or [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) (server-backed) configured when required +- [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) (standalone) ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/insert-blank-pages.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/insert-blank-pages.md index 91cc5ad4c4..bb9bd0b66a 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/insert-blank-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/insert-blank-pages.md @@ -20,7 +20,7 @@ This guide describes inserting new blank pages into a PDF using the **Organize P - EJ2 Angular PDF Viewer installed - `PageOrganizer` services injected into `PdfViewerComponent` -- [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) for standalone mode or [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) for server-backed mode configured as required +- [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) for standalone mode. ## Steps @@ -57,7 +57,7 @@ To enable or disable the **Insert Pages** button in the page thumbnails, update ## Troubleshooting - **Organize Pages button missing**: Verify `PageOrganizer` is included in `Inject` and `Toolbar` is enabled. -- **Inserted page not saved**: Confirm [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) or [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) is configured for your selected processing mode. +- **Inserted page not saved**: Confirm [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) is configured for your selected processing mode. - **Insert options disabled**: Ensure [`pageOrganizerSettings.canInsert`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/pageorganizersettingsmodel#caninsert) is set to `true` to enable insert option. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/programmatic-support.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/programmatic-support.md index 3bd7fdbf19..bb99741745 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/programmatic-support.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/programmatic-support.md @@ -75,65 +75,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerModule, - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [PdfViewerModule], - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, - ], - template: ` -
    - - -
    - `, -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { } -} - {% endhighlight %} {% endtabs %} @@ -200,65 +141,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerModule, - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [PdfViewerModule], - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, - ], - template: ` -
    - - -
    - `, -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { } -} - {% endhighlight %} {% endtabs %} @@ -325,65 +207,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerModule, - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [PdfViewerModule], - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, - ], - template: ` -
    - - -
    - `, -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/remove-pages.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/remove-pages.md index 030afb13e0..637cc48567 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/remove-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/remove-pages.md @@ -19,7 +19,7 @@ This guide shows how to delete single or multiple pages from a PDF using the **O ## Prerequisites - EJ2 Angular PDF Viewer installed in your project -- Basic PDF Viewer setup ([`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) for standalone mode or [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) for server-backed mode) +- Basic PDF Viewer setup ([`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) for standalone mode) ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/reorder-pages.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/reorder-pages.md index 0db6e4c183..55c8b31d0e 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/reorder-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/reorder-pages.md @@ -58,7 +58,7 @@ To enable or disable the **Reorder pages** option in the Organize Pages, update ## Troubleshooting - **Thumbnails won't move**: Confirm [`pageOrganizerSettings.canRearrange`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/pageorganizersettingsmodel#canrearrange) is is not set to `false`. -- **Changes not saved**: Verify [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) (server) or [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) (standalone) is configured correctly. +- **Changes not saved**: Verify [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) (standalone) is configured correctly. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/rotate-pages.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/rotate-pages.md index 13321a8685..f05ff5d8be 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/rotate-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/rotate-pages.md @@ -19,7 +19,7 @@ This guide explains how to rotate individual or multiple pages using the **Organ ## Prerequisites - EJ2 Angular PDF Viewer installed -- PDF Viewer configured with [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) (standalone) or [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) (server-backed) +- PDF Viewer configured with [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) (standalone) ## Steps @@ -66,7 +66,7 @@ To enable or disable the **Rotate Pages** button in the Organize Pages toolbar, ## Troubleshooting - **Rotate controls disabled**: Ensure [`pageOrganizerSettings.canRotate`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/pageorganizersettingsmodel#canrotate) is not set to `false`. -- **Rotation not persisted**: Click **Save** after rotating. For server-backed setups ensure [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) is set so server-side save can persist changes. +- **Rotation not persisted**: Click **Save** after rotating. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/toolbar.md index f481928946..c9affbf24f 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/organize-pages/toolbar.md @@ -75,65 +75,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerModule, - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [PdfViewerModule], - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, - ], - template: ` -
    - - -
    - `, -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { } -} - {% endhighlight %} {% endtabs %} @@ -200,65 +141,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerModule, - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [PdfViewerModule], - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, - ], - template: ` -
    - - -
    - `, -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { } -} - {% endhighlight %} {% endtabs %} @@ -325,65 +207,6 @@ export class AppComponent implements OnInit { ngOnInit(): void { } } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - PdfViewerModule, - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, -} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-root', - standalone: true, - imports: [PdfViewerModule], - providers: [ - LinkAnnotationService, - BookmarkViewService, - MagnificationService, - ThumbnailViewService, - ToolbarService, - NavigationService, - TextSearchService, - TextSelectionService, - PrintService, - AnnotationService, - FormFieldsService, - FormDesignerService, - PageOrganizerService, - ], - template: ` -
    - - -
    - `, -}) -export class AppComponent implements OnInit { - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - - ngOnInit(): void { } -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-amazon-s3.md b/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-amazon-s3.md index 9154edd7c8..b4f233d83e 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-amazon-s3.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-amazon-s3.md @@ -116,138 +116,4 @@ saveDocument() { N> Install the AWS SDK package to use the browser example. Run `npm install aws-sdk` for the v2 bundle, or prefer the AWS SDK v3 modular packages for smaller client bundles and better tree-shaking. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To save a PDF file to AWS S3, you can follow the steps below: - -**Step 1:** Create a PDF Viewer sample in TypeScript - -Follow the instructions provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started) to create a simple PDF Viewer sample in Angular. This will set up the basic structure of your PDF Viewer application. - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://support.syncfusion.com/kb/article/9766/how-to-create-pdf-viewer-web-service-in-net-core-31-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` - -5. Modify the `Download()` method to save the downloaded PDF files to AWS S3 bucket - -```csharp - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public IActionResult Download([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - string bucketName = _bucketName; - string documentName = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentName); - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - using (MemoryStream stream = new MemoryStream(bytes)) - { - var request = new PutObjectRequest - { - BucketName = bucketName, - Key = result + "_downloaded.pdf", - InputStream = stream, - }; - // Upload the PDF document to AWS S3 - var response = s3Client.PutObjectAsync(request).Result; - } - return Content(documentBase); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace the placeholders with the appropriate AWS credentials and bucket name. For enhanced security, avoid storing long-lived credentials in configuration files; use environment variables or a secrets manager instead. - -**Step 3:** Set the PDF Viewer properties in the TypeScript PDF Viewer component - -Modify the serviceUrl with your web service endpoint and set documentPath to the PDF file name to load from AWS S3. Ensure the document exists in the target bucket. - -```typescript -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService,ThumbnailViewService, - ToolbarService, NavigationService, AnnotationService, TextSearchService, - TextSelectionService, PrintService, FormDesignerService, FormFieldsService] - }) - export class AppComponent implements OnInit { - // Replace the "localhost:44396" with the actual URL of your server - public service = 'https://localhost:44396/pdfviewer'; - public documentPath = 'PDF_Succinctly.pdf'; - } -``` - -N> The `AWSSDK.S3` NuGet package must be installed in the web service project to use the server example. Use secure secret management for credentials rather than storing them in source-controlled configuration files. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-azure-blob-storage.md b/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-azure-blob-storage.md index d7c1a6acb4..3a63ba0afe 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-azure-blob-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-azure-blob-storage.md @@ -103,172 +103,4 @@ SavePdfToBlob() { N> Install the Azure Storage Blob client package for browser use: `npm install @azure/storage-blob`. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using Server-Backed PDF Viewer - -To save a PDF file to Azure Blob Storage, you can follow the steps below - -**Step 1:** Create a PDF Viewer sample in Angular - -Follow the instructions provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started) to create a simple PDF Viewer sample in Angular. This will set up the basic structure of your PDF Viewer application. - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private readonly string _storageConnectionString; -private readonly string _storageContainerName; -private readonly ILogger _logger; - -public PdfViewerController(IConfiguration configuration, ILogger logger) -{ - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); - _logger = logger; -} -``` - -5. Modify the [Download()](https://ej2.syncfusion.com/documentation/api/pdfviewer#download) method to save the downloaded PDF file to the Azure Blob Storage container. - -```csharp - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public IActionResult Download([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string document = jsonObject["documentId"]; - - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - - string result = Path.GetFileNameWithoutExtension(document); - // Get a reference to the blob - BlobClient blobClient = containerClient.GetBlobClient(result + "_downloaded.pdf"); - - // Convert the document base64 string to bytes - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - // Upload the document to Azure Blob Storage - using (MemoryStream stream = new MemoryStream(bytes)) - { - blobClient.Upload(stream, true); - } - return Content(documentBase); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -N> Replace the placeholders with the actual Azure Storage connection string and container name. For enhanced security, avoid storing connection strings in source-controlled files; use environment variables, managed identities, or a secret store such as Azure Key Vault. - -**Step 3:** Modify the web service project to save the downloaded document to Azure Blob Storage - -Create a web service project in .NET Core (version 3.0 and above) by following the steps in this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above). In the controller.cs file of your web service project, add the following code to modify the `Download` method. This code saves the downloaded PDF document to Azure Blob Storage container. - -```c# -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public IActionResult Download([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string document = jsonObject["documentId"]; - - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - - string result = Path.GetFileNameWithoutExtension(document); - // Get a reference to the blob - BlobClient blobClient = containerClient.GetBlobClient(result + "_download.pdf"); - - // Convert the document base64 string to bytes - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - // Upload the document to Azure Blob Storage - using (MemoryStream stream = new MemoryStream(bytes)) - { - blobClient.Upload(stream, true); - } - return Content(documentBase); -} -``` - -**Step 4:** Set the PDF Viewer properties in the Angular PDF Viewer component - -Modify the [serviceUrl](https://ej2.syncfusion.com/documentation/api/pdfviewer#serviceurl) property of the PDF Viewer component with the accurate URL of the web service, replacing `https://localhost:44396/pdfviewer` with the actual server URL. Set the `documentPath` property to the desired PDF file name to load from Azure Blob Storage, and ensure that the document exists in the target container. - -```typescript -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService,ThumbnailViewService, - ToolbarService, NavigationService, AnnotationService, TextSearchService, - TextSelectionService, PrintService, FormDesignerService, FormFieldsService] - }) - export class AppComponent implements OnInit { - // Replace the "localhost:44396" with the actual URL of your server - public service = 'https://localhost:44396/pdfviewer'; - public documentPath = 'PDF_Succinctly.pdf'; - } -``` - -N> Install the `Azure.Storage.Blobs` NuGet package in the web service project to use the server example. For security, avoid committing connection strings to source control and prefer environment variables, managed identities, or Azure Key Vault for secret management. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-dropbox-cloud-file-storage.md b/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-dropbox-cloud-file-storage.md index 5f3ee020ae..3e6641c201 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-dropbox-cloud-file-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/save-pdf-file/to-dropbox-cloud-file-storage.md @@ -103,140 +103,4 @@ saveDocument() { N> Install the `dropbox` package in the Angular project before running the sample: `npm install dropbox`. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) - -## Using server-backed PDF Viewer - -To save a PDF file to Dropbox cloud file storage, you can follow the steps below: - -**Step 1:** Create a Dropbox API app - -To create a Dropbox API app, follow the Dropbox .NET tutorial: [Dropbox .NET tutorial](https://www.dropbox.com/developers/documentation/dotnet#tutorial). Use the Dropbox App Console to register an app and obtain the necessary access token and permissions. - -**Step 2:** Create a Simple PDF Viewer Sample in Angular - -Follow the Syncfusion getting-started instructions for the Angular PDF Viewer: [Angular PDF Viewer getting started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/angular/getting-started). This sets up the basic PDF Viewer application structure. - -**Step 3:** Modify the `PdfViewerController.cs` file in the web service project - -1. Create a web service project in .NET Core 3.0 or above. Refer to the Syncfusion knowledge base article on creating a PDF Viewer web service: [Create a PDF Viewer web service in .NET Core 3.0 and above](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above). - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Dropbox.Api; -using Dropbox.Api.Files; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _folderName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _folderName = _configuration.GetValue("FolderName"); -} -``` - -5. Modify the `Download()` method to save the downloaded PDF files to Dropbox cloud storage - -```csharp - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public async Task Download([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - string documentId = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentId); - string fileName = result + "_downloaded.pdf"; - - using (var dropBox = new DropboxClient(_accessToken)) - { - using (var stream = new MemoryStream(documentBytes)) - { - // Upload the document to Dropbox - var uploadedFile = await dropBox.Files.UploadAsync( - _folderName + "/" + fileName, - WriteMode.Overwrite.Instance, - body: stream - ); - } - } - return Content(documentBase); -} -``` - -6. Open the `appsettings.json` file in the web service project and add the following entries below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Dropbox_Access_Token", - "FolderName": "Your_Folder_Name" -} -``` - -N> Replace the placeholders with the actual Dropbox access token and folder name. - -**Step 4:** Set the PDF Viewer properties in the Angular PDF Viewer component - -Modify the `serviceUrl` property of the PDF viewer component with the accurate URL of your web service project, replacing `https://localhost:44396/pdfviewer` with the actual URL of your server. Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Dropbox cloud file storage. Ensure that you correctly pass the document name from the files available in your dropbox folder to the documentPath property. - -```typescript -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService} from '@syncfusion/ej2-angular-pdfviewer'; - -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService,ThumbnailViewService, - ToolbarService, NavigationService, AnnotationService, TextSearchService, - TextSelectionService, PrintService, FormDesignerService, FormFieldsService] - }) - export class AppComponent implements OnInit { - // Replace the "localhost:44396" with the actual URL of the server - public service = 'https://localhost:44396/pdfviewer'; - public documentPath = 'PDF_Succinctly.pdf'; - } -``` - -N> Install the `Dropbox.Api` NuGet package in the web service application to use the previous code example. - -N> Replace `PDF_Succinctly.pdf` with the actual document name stored in Dropbox and pass that name to the `documentPath` property of the PDF Viewer component. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Server-Backed) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/annotation-toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/annotation-toolbar.md index c984a6b491..fbc5534b51 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/annotation-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/annotation-toolbar.md @@ -19,7 +19,7 @@ This guide shows how to show or hide the annotation toolbar and how to choose wh ## Prerequisites - EJ2 Angular PDF Viewer installed and added in your project. See [getting started guide](../getting-started) -- A valid [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) or [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#serviceurl) for viewer assets when running locally +- A valid [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer#resourceurl) ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/custom-toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/custom-toolbar.md index e39d07ab6e..32f9fdaafa 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/custom-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/custom-toolbar.md @@ -32,19 +32,6 @@ Create a simple PDF Viewer sample by following the [getting started](https://ej2 style="height:640px; display: block">
    -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - - - - {% endhighlight %} {% endtabs %} @@ -89,21 +76,6 @@ Hide the default toolbar using `enableToolbar` and `enableThumbnail` properties: style="display: block; height: 640px;">
    -{% endraw %} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - - - - - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/form-designer-toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/form-designer-toolbar.md index 3460e11b06..90d20b56f4 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/form-designer-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/form-designer-toolbar.md @@ -19,7 +19,7 @@ This guide shows how to show or hide the form designer toolbar, and how to confi ## Prerequisites - EJ2 Angular PDF Viewer installed and added in project. See [getting started guide](../getting-started) -- If using standalone WASM mode, provide [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#resourceurl) or a [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#serviceurl) for server mode. +- If using standalone WASM mode, provide [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#resourceurl) ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/mobile-toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/mobile-toolbar.md index cba0f914b3..bf46e84ce1 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/mobile-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/toolbar-customization/mobile-toolbar.md @@ -17,7 +17,6 @@ This how-to explains how to enable the desktop toolbar on mobile devices running - EJ2 Angular PDF Viewer installed and added in your Angular project. - For standalone mode: a valid [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#resourceurl) hosting the PDF Viewer assets. -- For server-backed mode: a working [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#serviceurl) endpoint. ## Steps @@ -59,35 +58,6 @@ export class AppComponent { public resource: string = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; } {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -import { Component } from '@angular/core'; -import { PdfViewerModule, ToolbarService, MagnificationService, NavigationService, AnnotationService, LinkAnnotationService, - ThumbnailViewService, BookmarkViewService, TextSelectionService, TextSearchService, FormFieldsService, FormDesignerService, - PrintService, PageOrganizerService } 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, - PrintService, PageOrganizerService - ], - template: ` - ` -}) -export class AppComponent { - public document: string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service: string = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -} -{% endhighlight %} {% endtabs %} ## Troubleshooting @@ -95,7 +65,6 @@ export class AppComponent { - Print option not visible on mobile: set [`enableDesktopMode`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#enabledesktopmode) to `true`; otherwise the mobile toolbar omits Print. - Touch scrolling is jerky after enabling desktop toolbar: set [`enableTextSelection`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#enabletextselection) to `false` to avoid text-selection capturing touch events. - Missing assets or broken UI: confirm [`resourceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#resourceurl) points to the correct version of the `ej2-pdfviewer-lib` and is reachable from the device. -- Server errors in server-backed mode: verify [`serviceUrl`](https://ej2.syncfusion.com/angular/documentation/api/pdfviewer/index-default#serviceurl) CORS configuration and that the back end is running. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/angular/toolbar.md b/Document-Processing/PDF/PDF-Viewer/angular/toolbar.md index 408f3509c2..6f3a9fbf6e 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/toolbar.md @@ -62,37 +62,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - } - {% endhighlight %} {% endtabs %} @@ -142,38 +111,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public toolbarSettings = { showTooltip: true, toolbarItems: 'DownloadOption' } } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService,NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template:`
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public toolbarSettings = { showTooltip: true, toolbarItems: 'DownloadOption' } - } - {% endhighlight %} {% endtabs %} @@ -222,39 +159,6 @@ import { LinkAnnotationService, BookmarkViewService, MagnificationService, public toolbarSettings = { showTooltip: true, toolbarItems: ['OpenOption'] }; } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - TextSearchService, AnnotationService, TextSelectionService, - PrintService - } from '@syncfusion/ej2-angular-pdfviewer'; -@Component({ - selector: 'app-container', - // specifies the template string for the PDF Viewer component - template: `
    - - -
    `, - providers: [ LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService] - }) - export class AppComponent implements OnInit { - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public toolbarSettings = { showTooltip: true, toolbarItems: ['OpenOption'] }; - } - {% endhighlight %} {% endtabs %} @@ -348,87 +252,6 @@ export class AppComponent implements OnInit { } } -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -import { Component, OnInit } from '@angular/core'; -import { - LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService, CustomToolbarItemModel -} from '@syncfusion/ej2-angular-pdfviewer'; -import { ComboBox } from "@syncfusion/ej2-dropdowns"; -import { TextBox } from "@syncfusion/ej2-inputs"; -import { ClickEventArgs } from '@syncfusion/ej2-angular-navigations'; - -@Component({ - selector: 'app-root', - template: `
    - - -
    `, - providers: [LinkAnnotationService, BookmarkViewService, MagnificationService, - ThumbnailViewService, ToolbarService, NavigationService, - AnnotationService, TextSearchService, TextSelectionService, - PrintService, FormDesignerService, FormFieldsService] -}) -export class AppComponent implements OnInit { - public document = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - public service = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; - - public toolItem1: CustomToolbarItemModel = { - prefixIcon: 'e-icons e-paste', - id: 'print', - tooltipText: 'Custom toolbar item', - }; - public toolItem2: CustomToolbarItemModel = { - id: 'download', - text: 'Save', - tooltipText: 'Custom toolbar item', - align: 'right' - }; - LanguageList: string[] = ['Typescript', 'Javascript', 'Angular', 'C#', 'C', 'Python']; - public toolItem3: CustomToolbarItemModel = { - type: 'Input', - tooltipText: 'Language List', - cssClass: 'percentage', - align: 'Left', - id: 'dropdown', - template: new ComboBox({ width: 100, value: 'TypeScript', dataSource: this.LanguageList, popupWidth: 85, showClearButton: false, readonly: false }) - }; - public toolItem4: CustomToolbarItemModel = { - type: 'Input', - tooltipText: 'Text', - align: 'Right', - cssClass: 'find', - id: 'textbox', - template: new TextBox({ width: 125, placeholder: 'Type Here', created: this.OnCreateSearch}) - } - public toolbarSettings = { - showTooltip: true, - toolbarItems: [this.toolItem1, this.toolItem2, 'OpenOption', 'PageNavigationTool', 'MagnificationTool', this.toolItem3, 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption', 'UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', this.toolItem4, 'CommentTool', 'SubmitForm'] - }; - - public toolbarClick(args: ClickEventArgs): void { - var pdfViewer = (document.getElementById('pdfViewer')).ej2_instances[0]; - if (args.item && args.item.id === 'print') { - pdfViewer.printModule.print(); - } else if (args.item && args.item.id === 'download') { - pdfViewer.download(); - } - } - public OnCreateSearch(this: any): any { - this.addIcon('prepend', 'e-icons e-search'); - } - ngOnInit(): void { - } -} {% endhighlight %} {% endtabs %} @@ -483,19 +306,6 @@ The PDF Viewer exposes APIs so applications can implement a custom toolbar UI. H style="height:640px; display: block">
    -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - - - - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/angular/troubleshooting/document-loading-issues.md b/Document-Processing/PDF/PDF-Viewer/angular/troubleshooting/document-loading-issues.md index f6761be1cd..21bcb2e2ae 100644 --- a/Document-Processing/PDF/PDF-Viewer/angular/troubleshooting/document-loading-issues.md +++ b/Document-Processing/PDF/PDF-Viewer/angular/troubleshooting/document-loading-issues.md @@ -21,7 +21,8 @@ If a document does not render in the viewer when using version 23.1 or later, us function documentLoad () { var pdfviewer = (document.getElementById("pdfViewer")).ej2_instances[0]; - pdfViewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer"; pdfViewer.dataBind(); + pdfViewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"; + pdfViewer.dataBind(); pdfViewer.load("https://cdn.syncfusion.com/content/pdf/annotations.pdf",null); } ``` diff --git a/Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/restricting-zoom-in-mobile-mode.md b/Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/restricting-zoom-in-mobile-mode.md index 78bff87ba5..82ccd88427 100644 --- a/Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/restricting-zoom-in-mobile-mode.md +++ b/Document-Processing/PDF/PDF-Viewer/asp-net-core/how-to/restricting-zoom-in-mobile-mode.md @@ -7,7 +7,7 @@ control: PDF Viewer documentation: ug --- -# Restrict zoom percentage on mobile devices +# Restrict zoom percentage on mobile devices in Core The Syncfusion® ASP.NET Core PDF Viewer allows developers to restrict zoom ranges on mobile devices by adjusting the `maxZoom` and `minZoom` properties during the `documentLoad` event. Implementing device-specific zoom limits prevents excessive pinch-zooming, maintains document readability, and optimizes rendering performance on phones and tablets. diff --git a/Document-Processing/PDF/PDF-Viewer/asp-net-mvc/how-to/restricting-zoom-in-mobile-mode.md b/Document-Processing/PDF/PDF-Viewer/asp-net-mvc/how-to/restricting-zoom-in-mobile-mode.md index 600e11d7cc..ee11ec0b4a 100644 --- a/Document-Processing/PDF/PDF-Viewer/asp-net-mvc/how-to/restricting-zoom-in-mobile-mode.md +++ b/Document-Processing/PDF/PDF-Viewer/asp-net-mvc/how-to/restricting-zoom-in-mobile-mode.md @@ -8,7 +8,7 @@ publishingplatform: ASP.NET MVC documentation: ug --- -# Restrict zoom percentage on mobile devices +# Restrict zoom percentage on mobile devices in MVC The Syncfusion® ASP.NET MVC PDF Viewer allows developers tqo cap zoom ranges on phones and tablets by adjusting the `maxZoom` and `minZoom` properties after the `documentLoad` event fires. Setting device-specific limits prevents excessive pinch-zooming, keeps pages readable, and avoids stuttering caused by rendering at extreme scales. diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/Localization/default-language.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/Localization/default-language.md index a20b27f87c..f054f595b4 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/Localization/default-language.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/Localization/default-language.md @@ -42,28 +42,6 @@ ej.pdfviewer.PdfViewer.Inject( }); pdfviewer.appendTo('#pdfViewer'); {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields, - ej.pdfviewer.PageOrganizer - ); - - var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', - locale: 'ar-AE' //Using locale update culture (en-US by default) - }); - pdfviewer.appendTo('#pdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/accessibility.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/accessibility.md index 890ad57d5b..3b41705031 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/accessibility.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/accessibility.md @@ -175,83 +175,6 @@ viewer.appendTo('#pdfViewer'); -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - - - - - - - - - - -
    -
    - -
    -
    -
    - - - - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/Squiggly-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/Squiggly-annotation.md index 25b6ced6f6..9ba406797d 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/Squiggly-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/Squiggly-annotation.md @@ -71,36 +71,6 @@ document.getElementById('squigglyMode').addEventListener('click', function () { pdfviewer.annotation.setAnnotationMode('Squiggly'); }); -document.getElementById('setNone').addEventListener('click', function () { - pdfviewer.annotation.setAnnotationMode('None'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - -document.getElementById('squigglyMode').addEventListener('click', function () { - pdfviewer.annotation.setAnnotationMode('Squiggly'); -}); - document.getElementById('setNone').addEventListener('click', function () { pdfviewer.annotation.setAnnotationMode('None'); }); @@ -137,35 +107,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addSquiggly').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Squiggly', { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addSquiggly').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Squiggly', { bounds: [{ x: 97, y: 110, width: 350, height: 14 }], @@ -236,39 +177,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editSquiggly').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - var ann = pdfviewer.annotationCollection[i]; - if (ann.author === 'Guest User' || ann.subject === 'Corrections') { - ann.color = '#ff0000'; - ann.opacity = 0.8; - pdfviewer.annotation.editAnnotation(ann); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editSquiggly').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { var ann = pdfviewer.annotationCollection[i]; @@ -308,26 +216,6 @@ var pdfviewer = new PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - squigglySettings: { author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9} -}); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -363,46 +251,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply Squiggly Settings while adding individual Annotation -document.getElementById('squiggly')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Squiggly', { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1, - author: 'User 1', - color: '#ffff00', - opacity: 0.9 - }); - - pdfviewer.annotation.addAnnotation('Squiggly', { - bounds: [{ x: 107, y: 220, width: 350, height: 14 }], - pageNumber: 1, - author: 'User 2', - color: '#ff1010ff', - opacity: 0.9 - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply Squiggly Settings while adding individual Annotation document.getElementById('squiggly')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Squiggly', { @@ -446,23 +294,6 @@ PdfViewer.Inject( var pdfviewer = new PdfViewer({ documentPath:'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', enableTextMarkupAnnotation: false }); pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new PdfViewer({ documentPath:'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', enableTextMarkupAnnotation: false }); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/area-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/area-annotation.md index 36b76702f2..c26180ea7c 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/area-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/area-annotation.md @@ -56,31 +56,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('areaMode').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Area'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('areaMode').addEventListener('click', function () { pdfviewer.annotationModule.setAnnotationMode('Area'); }); @@ -117,38 +92,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addAreaAnnotation').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Area', { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [ - { x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 } - ] - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addAreaAnnotation').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Area', { offset: { x: 200, y: 500 }, @@ -252,44 +195,6 @@ if (editAreaAnnotation) { }); } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - -var editAreaAnnotation = document.getElementById('editAreaAnnotation'); -if (editAreaAnnotation) { - editAreaAnnotation.addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Area calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle"; - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -318,29 +223,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer(); pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; -pdfviewer.areaSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - pdfviewer.areaSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} @@ -392,40 +274,6 @@ document.getElementById('Area')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.appendTo('#PdfViewer'); -// Apply Area settings while adding individual annotation -document.getElementById('Area')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Area', { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [ - { x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 } - ], - fillColor: 'yellow', - opacity: 0.6, - strokeColor: 'orange' - }); -}); -{% endhighlight %} {% endtabs %} ## Editing scale ratio and unit of the area measurement annotation @@ -473,30 +321,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/arrow-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/arrow-annotation.md index a030fc3f89..e272287e3c 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/arrow-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/arrow-annotation.md @@ -56,31 +56,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('arrowMode').addEventListener('click', function() { - pdfviewer.annotationModule.setAnnotationMode('Arrow'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('arrowMode').addEventListener('click', function() { pdfviewer.annotationModule.setAnnotationMode('Arrow'); }); @@ -117,36 +92,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addArrowAnnotation').addEventListener('click', function() { - pdfviewer.annotation.addAnnotation('Arrow', { - offset: { x: 200, y: 370 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 370 }, { x: 350, y: 370 }] - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addArrowAnnotation').addEventListener('click', function() { pdfviewer.annotation.addAnnotation('Arrow', { offset: { x: 200, y: 370 }, @@ -233,39 +178,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editArrowAnnotation').addEventListener('click', function() { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Arrow') { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = 'Circle'; - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = '#FFFF00'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editArrowAnnotation').addEventListener('click', function() { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Arrow') { @@ -305,29 +217,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer(); pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; -pdfviewer.arrowSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - pdfviewer.arrowSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} @@ -379,40 +268,6 @@ document.getElementById('arrow')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; -pdfviewer.appendTo('#PdfViewer'); -//Apply Arrow Settings while adding individual Annotation -document.getElementById('arrow').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Arrow', { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }], - fillColor: '#ff1010ff', - strokeColor: '#fff000', - opacity: 0.9, - author: 'User 1', - thickness: 1 - }); -}); -{% endhighlight %} {% endtabs %} N> In both [Arrow](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#arrowsettings) and [Line](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#linesettings) annotations Settings, the Fill Color option is available only when an arrowhead style is applied at the Start or End. If both Start and End arrowhead styles are set to None, lines do not support fill rendering and the Fill Color option remains disabled. diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/circle-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/circle-annotation.md index e6a32dccc2..340667e32e 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/circle-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/circle-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('circleMode').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Circle'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('circleMode').addEventListener('click', function () { pdfviewer.annotationModule.setAnnotationMode('Circle'); }); @@ -135,36 +110,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addCircleAnnotation').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Circle', { - offset: { x: 200, y: 620 }, - pageNumber: 1, - width: 90, - height: 90 - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addCircleAnnotation').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Circle', { offset: { x: 200, y: 620 }, @@ -244,42 +189,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -var editCircleAnnotation = document.getElementById('editCircleAnnotation'); -if (editCircleAnnotation) { - editCircleAnnotation.addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Circle') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = '#FFFF00'; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = 'Circle'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - var editCircleAnnotation = document.getElementById('editCircleAnnotation'); if (editCircleAnnotation) { editCircleAnnotation.addEventListener('click', function () { @@ -324,28 +233,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.circleSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.circleSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -394,40 +281,6 @@ document.getElementById('Circle')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -//Apply Circle Settings while adding individual Annotation -document.getElementById('Circle')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Circle', { - offset: { x: 200, y: 480 }, - pageNumber: 1, - width: 150, - height: 75, - opacity: 0.5, - strokeColor: '#FF0000', - fillColor: '#000fff#', - author: 'User1' - }); -}); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/distance-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/distance-annotation.md index 91ce8d7d2f..a3de226331 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/distance-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/distance-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('distanceMode').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Distance'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('distanceMode').addEventListener('click', function () { pdfviewer.annotationModule.setAnnotationMode('Distance'); }); @@ -132,35 +107,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addDistanceAnnotation').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Distance', { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addDistanceAnnotation').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Distance', { offset: { x: 200, y: 230 }, @@ -239,38 +185,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editDistanceAnnotation').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Distance calculation') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].opacity = 0.8; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editDistanceAnnotation').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Distance calculation') { @@ -311,28 +225,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.distanceSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.distanceSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -377,36 +269,6 @@ document.getElementById('Distance')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -//Apply Distance Settings while adding individual Annotation -document.getElementById('Distance')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Distance', { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }], - fillColor: 'blue', opacity: 0.6, strokeColor: 'green' - }); - }); -{% endhighlight %} {% endtabs %} ## Scale ratio and units @@ -445,28 +307,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/free-text-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/free-text-annotation.md index 53aad96fdd..55f3422e69 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/free-text-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/free-text-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addFreeTextAnnotation').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('FreeText'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addFreeTextAnnotation').addEventListener('click', function () { pdfviewer.annotationModule.setAnnotationMode('FreeText'); }); @@ -119,41 +94,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addFreeTextProgram').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('FreeText', { - offset: { x: 120, y: 80 }, - fontSize: 16, - fontFamily: 'Helvetica', - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - defaultText: 'Syncfusion' - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addFreeTextProgram').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('FreeText', { offset: { x: 120, y: 80 }, @@ -275,37 +215,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('changeContent').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Text Box') { - pdfviewer.annotationCollection[i].dynamicText = 'syncfusion'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('changeContent').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Text Box') { @@ -348,28 +257,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.freeTextSettings = { fillColor: 'green', borderColor: 'blue', fontColor: 'yellow' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.freeTextSettings = { fillColor: 'green', borderColor: 'blue', fontColor: 'yellow' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -421,43 +308,6 @@ document.getElementById('FreeText')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -//Apply FreeText Settings while adding individual Annotation -document.getElementById('FreeText')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('FreeText', { - offset: { x: 120, y: 80 }, - fontSize: 16, - fontFamily: 'Helvetica', - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - defaultText: 'Syncfusion', - fillColor: 'green', - borderColor: 'blue', - fontColor: 'yellow' - }); -}); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/highlight-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/highlight-annotation.md index a16dda9b56..f09d69ac89 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/highlight-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/highlight-annotation.md @@ -70,8 +70,6 @@ document.getElementById('set').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, add the below `serviceUrl` in the `index.ts` file: `pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/highlight-mode-cs1" %} To switch back to normal mode from highlight mode: @@ -112,9 +110,6 @@ document.getElementById('setNone').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, add the below `serviceUrl` in the `index.ts` file: -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/highlight-normal-mode-cs1" %} ### Add highlight annotation programmatically @@ -147,34 +142,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('highlight').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Highlight', { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('highlight').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Highlight', { bounds: [{ x: 97, y: 110, width: 350, height: 14 }], @@ -238,39 +205,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editHighlight').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - var annot = pdfviewer.annotationCollection[i]; - if (annot.textMarkupAnnotationType === 'Highlight') { - annot.color = '#000fff'; - annot.opacity = 0.8; - pdfviewer.annotation.editAnnotation(annot); - break; - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editHighlight').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { var annot = pdfviewer.annotationCollection[i]; @@ -312,25 +246,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.highlightSettings = { author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9 }; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.highlightSettings = { author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9 }; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -385,45 +300,6 @@ document.getElementById('highlight')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -//Apply Highlight Settings while adding individual Annotation -document.getElementById('highlight')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Highlight', { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1, - author: 'User 1', - color: '#ffff00', - opacity: 0.9 - }); - - pdfviewer.annotation.addAnnotation('Highlight', { - bounds: [{ x: 107, y: 220, width: 350, height: 14 }], - pageNumber: 1, - author: 'User 2', - color: '#ff1010ff', - opacity: 0.9 - }); -}); -{% endhighlight %} {% endtabs %} ## Disable highlight annotation @@ -449,25 +325,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.enableTextMarkupAnnotation = false; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.enableTextMarkupAnnotation = false; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/ink-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/ink-annotation.md index 93c8926fec..328331150d 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/ink-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/ink-annotation.md @@ -109,38 +109,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addInkAnnotationProgram').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Ink', { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width: 200, - height: 60, - path: '[{"command":"M","x":244.83,"y":982.00},{"command":"L","x":250.83,"y":953.33}]' - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addInkAnnotationProgram').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Ink', { offset: { x: 150, y: 100 }, @@ -216,42 +184,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editInkAnnotation').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].shapeAnnotationType === 'Ink') { - var width = pdfviewer.annotationCollection[i].bounds.width; - var height = pdfviewer.annotationCollection[i].bounds.height; - pdfviewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = 'Circle'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editInkAnnotation').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].shapeAnnotationType === 'Ink') { @@ -294,29 +226,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.inkAnnotationSettings = { author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6 }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.inkAnnotationSettings = { author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6 }; - pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} {% endtabs %} @@ -354,39 +263,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply Ink Settings while adding individual Annotation -document.getElementById('Ink')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Ink', { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width: 200, - height: 60, - path: '[{"command":"M","x":244.83,"y":982.00},{"command":"L","x":250.83,"y":953.33}]', - author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6 - }); -}); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl= 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply Ink Settings while adding individual Annotation document.getElementById('Ink')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Ink', { diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/line-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/line-annotation.md index 636bfa3f25..387d1849ac 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/line-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/line-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('lineMode').addEventListener('click', function() { - pdfviewer.annotationModule.setAnnotationMode('Line'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('lineMode').addEventListener('click', function() { pdfviewer.annotationModule.setAnnotationMode('Line'); }); @@ -132,35 +107,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addLineAnnotation').addEventListener('click', function() { - pdfviewer.annotation.addAnnotation('Line', { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addLineAnnotation').addEventListener('click', function() { pdfviewer.annotation.addAnnotation('Line', { offset: { x: 200, y: 230 }, @@ -252,38 +198,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editLineAnnotation').addEventListener('click', function() { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Line') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = 'Circle'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editLineAnnotation').addEventListener('click', function() { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Line') { @@ -324,28 +238,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.lineSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.lineSettings = { fillColor: 'blue', opacity: 0.6, strokeColor: 'green' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} N> In both [Arrow](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#arrowsettings) and [Line](https://ej2.syncfusion.com/documentation/api/pdfviewer/index-default#linesettings) annotation settings, the Fill Color option is available only when an arrowhead style is applied at the Start or End. If both Start and End arrowhead styles are set to None, lines do not support fill rendering and the Fill Color option remains disabled. @@ -383,41 +275,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply line Settings while adding individual Annotation -document.getElementById('line')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Line', { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }], - fillColor:'#ff1010ff', - strokeColor:'#fff000', - opacity:0.9, - author: 'User 1', - thickness: 1 - }); -}); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply line Settings while adding individual Annotation document.getElementById('line')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Line', { diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/perimeter-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/perimeter-annotation.md index f3f0297d00..7a320038f8 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/perimeter-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/perimeter-annotation.md @@ -56,34 +56,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -var perimeterBtn = document.getElementById('perimeterMode'); -if (perimeterBtn) { - perimeterBtn.addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Perimeter'); - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - var perimeterBtn = document.getElementById('perimeterMode'); if (perimeterBtn) { perimeterBtn.addEventListener('click', function () { @@ -123,43 +95,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -var addBtn = document.getElementById('addPerimeterAnnotation'); -if (addBtn) { - addBtn.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Perimeter', { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [ - { x: 200, y: 350 }, - { x: 285, y: 350 }, - { x: 286, y: 412 } - ] - }); - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; - -pdfviewer.appendTo('#PdfViewer'); - var addBtn = document.getElementById('addPerimeterAnnotation'); if (addBtn) { addBtn.addEventListener('click', function () { @@ -265,46 +200,6 @@ if (editPerimeterAnnotation) { }); } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - -var editPerimeterAnnotation = document.getElementById('editPerimeterAnnotation'); -if (editPerimeterAnnotation) { - editPerimeterAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Perimeter calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle"; - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -333,29 +228,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer(); pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; -pdfviewer.perimeterSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; - pdfviewer.perimeterSettings = { fillColor: 'green', opacity: 0.6, strokeColor: 'blue' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} @@ -394,37 +266,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply Perimeter Settings while adding individual Annotation -document.getElementById('Perimeter')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Perimeter', { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 350 }, { x: 285, y: 350 }, { x: 286, y: 412 }], - fillColor: 'green', opacity: 0.6, strokeColor: 'blue' - }); -}); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -=ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply Perimeter Settings while adding individual Annotation document.getElementById('Perimeter')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Perimeter', { @@ -482,30 +323,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/polygon-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/polygon-annotation.md index 469178bb38..11ad5baff4 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/polygon-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/polygon-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('polygonMode') && document.getElementById('polygonMode').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Polygon'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('polygonMode') && document.getElementById('polygonMode').addEventListener('click', function () { pdfviewer.annotationModule.setAnnotationMode('Polygon'); }); @@ -132,37 +107,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addPolygonAnnotation') && document.getElementById('addPolygonAnnotation').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Polygon', { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [ - { x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 } - ] - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addPolygonAnnotation') && document.getElementById('addPolygonAnnotation').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Polygon', { offset: { x: 200, y: 800 }, @@ -248,39 +192,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editPolygonAnnotation') && document.getElementById('editPolygonAnnotation').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Polygon') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = '#FFFF00'; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = 'Circle'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editPolygonAnnotation') && document.getElementById('editPolygonAnnotation').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Polygon') { @@ -322,28 +233,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.polygonSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.polygonSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -379,41 +268,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply Polygon Settings while adding individual Annotation -document.getElementById('Polygon')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Polygon', { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [ - { x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 } - ], - fillColor:'#ff000', - opacity: 0.9, - strokeColor:'##ff000' - }); -}); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply Polygon Settings while adding individual Annotation document.getElementById('Polygon')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Polygon', { diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/radius-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/radius-annotation.md index 9322791d71..e20e737a62 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/radius-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/radius-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('radiusMode').addEventListener('click', function() { - pdfviewer.annotationModule.setAnnotationMode('Radius'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('radiusMode').addEventListener('click', function() { pdfviewer.annotationModule.setAnnotationMode('Radius'); }); @@ -132,36 +107,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addRadiusAnnotation').addEventListener('click', function() { - pdfviewer.annotation.addAnnotation('Radius', { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addRadiusAnnotation').addEventListener('click', function() { pdfviewer.annotation.addAnnotation('Radius', { offset: { x: 200, y: 630 }, @@ -241,38 +186,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editRadiusAnnotation').addEventListener('click', function() { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Radius calculation') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].opacity = 0.8; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editRadiusAnnotation').addEventListener('click', function() { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Radius calculation') { @@ -313,28 +226,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.radiusSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.radiusSettings = { fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -370,38 +261,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply Radius Settings while adding individual Annotation -document.getElementById('Radius')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Radius', { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90, - fillColor: 'orange', opacity: 0.6, strokeColor: 'pink' - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply Radius Settings while adding individual Annotation document.getElementById('Radius')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Radius', { @@ -451,28 +310,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/rectangle-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/rectangle-annotation.md index cde1e1489c..fb79edff49 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/rectangle-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/rectangle-annotation.md @@ -57,31 +57,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('rectangleMode') && document.getElementById('rectangleMode').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Rectangle'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('rectangleMode') && document.getElementById('rectangleMode').addEventListener('click', function () { pdfviewer.annotationModule.setAnnotationMode('Rectangle'); }); @@ -132,36 +107,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('addRectangleAnnotation') && document.getElementById('addRectangleAnnotation').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Rectangle', { - offset: { x: 200, y: 480 }, - pageNumber: 1, - width: 150, - height: 75 - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('addRectangleAnnotation') && document.getElementById('addRectangleAnnotation').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Rectangle', { offset: { x: 200, y: 480 }, @@ -244,39 +189,6 @@ pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editRectangleAnnotation') && document.getElementById('editRectangleAnnotation').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Rectangle') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = '#FFFF00'; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = 'Circle'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editRectangleAnnotation') && document.getElementById('editRectangleAnnotation').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].subject === 'Rectangle') { @@ -318,28 +230,6 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.rectangleSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.rectangleSettings = { fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -389,29 +279,6 @@ document.getElementById('Rectangle')?.addEventListener('click', function () { }); }); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, RectangleSettings} from '@syncfusion/ej2-pdfviewer'; - -PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner); - -const pdfviewer: PdfViewer = new PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -//Apply Rectangle Settings while adding individual Annotation -document.getElementById('Rectangle')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Rectangle', { - offset: { x: 200, y: 480 }, - pageNumber: 1, - width: 150, - height: 75, - opacity: 0.5, - strokeColor: '#FF0000', - fillColor: '#000fff#', - author: 'User1' - } as RectangleSettings); -}); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/stamp-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/stamp-annotation.md index a978f30342..982aa02e3e 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/stamp-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/stamp-annotation.md @@ -77,26 +77,6 @@ document.getElementById('customStamp') && document.getElementById('customStamp') }); }); {% endhighlight %} -{% highlight javascript tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - -document.getElementById('dynamicStamp') && document.getElementById('dynamicStamp').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Stamp', ej.pdfviewer.DynamicStampItem.NotApproved); -}); - -document.getElementById('signStamp') && document.getElementById('signStamp').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Stamp', undefined, ej.pdfviewer.SignStampItem.Witness); -}); - -document.getElementById('standardBusinessStamp') && document.getElementById('standardBusinessStamp').addEventListener('click', function () { - pdfviewer.annotationModule.setAnnotationMode('Stamp', undefined, undefined, ej.pdfviewer.StandardBusinessStampItem.Approved); -}); -{% endhighlight %} {% endtabs %} ### Add Stamp annotations programmatically @@ -137,40 +117,6 @@ document.getElementById('addStandard') && document.getElementById('addStandard') }, undefined, undefined, ej.pdfviewer.StandardBusinessStampItem.Approved); }); -document.getElementById('addCustom') && document.getElementById('addCustom').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Stamp', { - offset: { x: 100, y: 440 }, width: 46, height: 100, pageNumber: 1, isLock: true, - author: 'Guest', - customStamps: [{ customStampName: 'Image', customStampImageSource: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...' }] - }); -}); -{% endhighlight %} -{% highlight javascript tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - -document.getElementById('addDynamic') && document.getElementById('addDynamic').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Stamp', { - offset: { x: 200, y: 140 }, pageNumber: 1 - }, ej.pdfviewer.DynamicStampItem.Approved); -}); - -document.getElementById('addSign') && document.getElementById('addSign').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Stamp', { - offset: { x: 200, y: 240 }, pageNumber: 1 - }, undefined, ej.pdfviewer.SignStampItem.Witness); -}); - -document.getElementById('addStandard') && document.getElementById('addStandard').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Stamp', { - offset: { x: 200, y: 340 }, pageNumber: 1 - }, undefined, undefined, ej.pdfviewer.StandardBusinessStampItem.Approved); -}); - document.getElementById('addCustom') && document.getElementById('addCustom').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Stamp', { offset: { x: 100, y: 440 }, width: 46, height: 100, pageNumber: 1, isLock: true, @@ -213,27 +159,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editStamp') && document.getElementById('editStamp').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].shapeAnnotationType === 'stamp') { - var width = pdfviewer.annotationCollection[i].bounds.width; - var height = pdfviewer.annotationCollection[i].bounds.height; - pdfviewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - pdfviewer.annotationCollection[i].annotationSettings.isLock = true; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight javascript tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; - -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editStamp') && document.getElementById('editStamp').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].shapeAnnotationType === 'stamp') { @@ -262,15 +187,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.stampSettings = { opacity: 0.3, author: 'Guest User' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight javascript tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.stampSettings = { opacity: 0.3, author: 'Guest User' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) @@ -308,35 +224,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.p pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply Stamp Settings while adding individual Annotation -document.getElementById('Stamp')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Stamp', { - offset: { x: 200, y: 140 }, pageNumber: 1, - opacity: 0.3, author: 'Guest User' - } ,'Approved'); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer, -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/form-designer.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply Stamp Settings while adding individual Annotation document.getElementById('Stamp')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('Stamp', { diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/sticky-notes-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/sticky-notes-annotation.md index d2a64aa1b4..837ac9212c 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/sticky-notes-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/sticky-notes-annotation.md @@ -62,36 +62,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('stickyNote').addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('StickyNotes', { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('stickyNote').addEventListener('click', function () { pdfviewer.annotation.addAnnotation('StickyNotes', { offset: { x: 100, y: 200 }, @@ -163,39 +133,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -document.getElementById('editSticky').addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].shapeAnnotationType === 'sticky') { - var width = pdfviewer.annotationCollection[i].bounds.width; - var height = pdfviewer.annotationCollection[i].bounds.height; - pdfviewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - document.getElementById('editSticky').addEventListener('click', function () { for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { if (pdfviewer.annotationCollection[i].shapeAnnotationType === 'sticky') { @@ -237,29 +174,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.stickyNotesSettings = { author: 'Syncfusion' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.stickyNotesSettings = { author: 'Syncfusion' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -282,24 +196,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//Apply StickyNotes Settings while adding individual Annotation -document.getElementById('StickyNotes')?.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('StickyNotes', { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false, - author: 'Syncfusion' - }); -}); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //Apply StickyNotes Settings while adding individual Annotation document.getElementById('StickyNotes')?.addEventListener('click', function () { pdfviewer.annotation.addAnnotation('StickyNotes', { @@ -340,29 +236,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.enableStickyNotesAnnotation = false; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.enableStickyNotesAnnotation = false; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/strikethrough-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/strikethrough-annotation.md index d346dadd9a..9ae66d152b 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/strikethrough-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/strikethrough-annotation.md @@ -94,10 +94,6 @@ document.getElementById('set').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.js` file -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/strikethrough-mode-cs1" %} #### Exit strikethrough mode @@ -163,10 +159,6 @@ document.getElementById('setNone').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.js` file -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/strikethrough-normal-mode-cs1" %} ### Add strikethrough annotations programmatically @@ -202,38 +194,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -var strikethrough = document.getElementById('strikethrough'); -if (strikethrough) { - strikethrough.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Strikethrough', { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - var strikethrough = document.getElementById('strikethrough'); if (strikethrough) { strikethrough.addEventListener('click', function () { @@ -319,42 +279,6 @@ if (editStrikethroughAnnotation) { }); } {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - -var editStrikethroughAnnotation = document.getElementById('editStrikethroughAnnotation'); -if (editStrikethroughAnnotation) { - editStrikethroughAnnotation.addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].textMarkupAnnotationType === 'Strikethrough') { - pdfviewer.annotationCollection[i].color = '#ff0000'; - pdfviewer.annotationCollection[i].opacity = 0.8; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - break; - } - } - }); -} -{% endhighlight %} {% endtabs %} ## Default strikethrough settings during initialization @@ -385,25 +309,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.strikethroughSettings = { author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9 }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.strikethroughSettings = { author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9 }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -498,26 +403,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.enableTextMarkupAnnotation = false; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.enableTextMarkupAnnotation = false; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/underline-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/underline-annotation.md index 23bdecfd77..d9e6741f7e 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/underline-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/underline-annotation.md @@ -94,10 +94,6 @@ document.getElementById('set').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.js` file -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/underline-mode-cs1" %} #### Exit underline mode @@ -163,10 +159,6 @@ document.getElementById('setNone').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.js` file -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/underline-normal-mode-cs1" %} ### Add underline annotations programmatically @@ -202,38 +194,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -var underline = document.getElementById('underline'); -if (underline) { - underline.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Underline', { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - var underline = document.getElementById('underline'); if (underline) { underline.addEventListener('click', function () { @@ -319,42 +279,6 @@ if (editUnderlineAnnotation) { }); } {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - -var editUnderlineAnnotation = document.getElementById('editUnderlineAnnotation'); -if (editUnderlineAnnotation) { - editUnderlineAnnotation.addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].textMarkupAnnotationType === 'Underline') { - pdfviewer.annotationCollection[i].color = '#00aa00'; - pdfviewer.annotationCollection[i].opacity = 0.8; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - break; - } - } - }); -} -{% endhighlight %} {% endtabs %} ## Default underline settings during initialization @@ -385,25 +309,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9 }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.underlineSettings = { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9 }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Set properties while adding Individual Annotation @@ -498,26 +403,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.enableTextMarkupAnnotation = false; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.enableTextMarkupAnnotation = false; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/volume-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/volume-annotation.md index 1ffe89fd8f..86032e362f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/volume-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotation-types/volume-annotation.md @@ -58,35 +58,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -var volumeModeBtn = document.getElementById('volumeMode'); -if (volumeModeBtn) { - volumeModeBtn.addEventListener('click', function () { - pdfviewer.annotation.setAnnotationMode('Volume'); - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - var volumeModeBtn = document.getElementById('volumeMode'); if (volumeModeBtn) { volumeModeBtn.addEventListener('click', function () { @@ -144,41 +115,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -var addVolBtn = document.getElementById('addVolumeAnnotation'); -if (addVolBtn) { - addVolBtn.addEventListener('click', function () { - pdfviewer.annotation.addAnnotation('Volume', { - offset: { x: 200, y: 810 }, - pageNumber: 1, - vertexPoints: [ - { x: 200, y: 810 }, { x: 200, y: 919 }, { x: 320, y: 919 }, { x: 320, y: 809 }, { x: 200, y: 810 } - ] - }); - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - var addVolBtn = document.getElementById('addVolumeAnnotation'); if (addVolBtn) { addVolBtn.addEventListener('click', function () { @@ -263,42 +199,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -var editVolBtn = document.getElementById('editVolumeAnnotation'); -if (editVolBtn) { - editVolBtn.addEventListener('click', function () { - for (var i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Volume calculation') { - pdfviewer.annotationCollection[i].strokeColor = '#0000FF'; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].opacity = 0.8; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.appendTo('#PdfViewer'); - var editVolBtn = document.getElementById('editVolumeAnnotation'); if (editVolBtn) { editVolBtn.addEventListener('click', function () { @@ -343,29 +243,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.volumeSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.volumeSettings = { fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} ## Scale ratio and units @@ -405,29 +282,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfview pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -var PdfViewer = ej.pdfviewer.PdfViewer; -PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.measurementSettings = { scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm' }; -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} {% endtabs %} [View Sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master) diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotations-undo-redo.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotations-undo-redo.md index cc697a0948..f4a65c2a83 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotations-undo-redo.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/annotations-undo-redo.md @@ -59,9 +59,6 @@ document.getElementById('redo').addEventListener('click', function () { {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, add the following `serviceUrl` in the `index.js` file: -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es6/text-markup-annotation/undo-redo-cs1" %} ## See also diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/comments.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/comments.md index fa7c18b372..9418e39279 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/comments.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/comments.md @@ -130,35 +130,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//for adding Comments programmatically -document.getElementById("addComment")?.addEventListener("click", function() { - let annot = pdfviewer.annotationCollection[0]; - if (annot) { - annot.commentType = "add"; - annot.note = "New Comment"; - pdfviewer.annotation.editAnnotation(annot); - console.log(pdfviewer.annotationCollection[0]); - } - }); -//for adding reply programmatically -document.getElementById("addReply")?.addEventListener("click", function() { - let annot = pdfviewer.annotationCollection[0]; - if (annot) { - annot.commentType = "add"; - annot.replyComment = ["Reply Comment"]; - pdfviewer.annotation.editAnnotation(annot); - console.log(pdfviewer.annotationCollection[0]); - } - }); -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //for adding Comments programmatically document.getElementById("addComment")?.addEventListener("click", function() { let annot = pdfviewer.annotationCollection[0]; @@ -202,36 +173,6 @@ pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly. pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib'; pdfviewer.appendTo('#PdfViewer'); -//for Editing Comments programmatically -document.getElementById("editComment")?.addEventListener("click", function() { - let annot = pdfviewer.annotationCollection[0]; - if (annot) { - annot.commentType = "edit"; - annot.note = "Edited Comment"; - pdfviewer.annotation.editAnnotation(annot); - console.log(pdfviewer.annotationCollection[0]); - } - }); - -//for Editing reply programmatically -document.getElementById("editReply")?.addEventListener("click", function() { - let annot = pdfviewer.annotationCollection[0]; - if (annot) { - annot.commentType = "edit"; - annot.replyComment = ["Edited Reply Comment"]; - pdfviewer.annotation.editAnnotation(annot); - console.log(pdfviewer.annotationCollection[0]); - } - }); -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - //for Editing Comments programmatically document.getElementById("editComment")?.addEventListener("click", function() { let annot = pdfviewer.annotationCollection[0]; @@ -277,17 +218,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/customize-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/customize-annotation.md index 45b81cad2d..811070d320 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/customize-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/customize-annotation.md @@ -109,47 +109,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ stickyNotesSettings: { author: 'QA', subject: 'Review', color: '#ffcc00', opacity: 1 } }); -pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - - highlightSettings: { author: 'QA', subject: 'Review', color: '#ffff00', opacity: 0.6 }, - strikethroughSettings: { author: 'QA', subject: 'Remove', color: '#ff0000', opacity: 0.6 }, - underlineSettings: { author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9 }, - squigglySettings: { author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9 }, - - lineSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }, - arrowSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }, - rectangleSettings: { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1 }, - circleSettings: { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1 }, - polygonSettings: { fillColor: '#ffffff00', strokeColor: '#222222', thickness: 1, opacity: 1 }, - - distanceSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }, - perimeterSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8 }, - areaSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00' }, - radiusSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00' }, - volumeSettings: { strokeColor: '#0066ff', thickness: 2, opacity: 0.8, fillColor: '#ffffff00' }, - - freeTextSettings: { borderColor: '#222222', thickness: 1, opacity: 1 }, - inkAnnotationSettings: { color: '#0000ff', thickness: 3, opacity: 0.8 }, - stampSettings: { opacity: 0.9 }, - stickyNotesSettings: { author: 'QA', subject: 'Review', color: '#ffcc00', opacity: 1 } -}); - -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/free-text-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/free-text-annotation.md index bc46a7f0bf..94d1d2d580 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/free-text-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/free-text-annotation.md @@ -50,25 +50,6 @@ if (addFreeTextAnnotationButton) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let addFreeTextAnnotationButton = document.getElementById('addFreeTextAnnotation'); -if (addFreeTextAnnotationButton) { - addFreeTextAnnotationButton.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode("FreeText"); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -111,34 +92,6 @@ if (addFreeTextAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let addFreeTextAnnotation = document.getElementById('addFreeTextAnnotation'); -if (addFreeTextAnnotation) { - addFreeTextAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("FreeText", { - offset: { x: 120, y: 80 }, - fontSize: 16, - fontFamily: "Helvetica", - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - defaultText: "Syncfusion" - } ); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -176,31 +129,6 @@ if (changeContent) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let changeContent = document.getElementById('changeContent'); -if (changeContent) { - changeContent.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === 'Text Box') { - pdfviewer.annotationCollection[i].dynamicText = 'syncfusion'; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -282,17 +210,5 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - freeTextSettings : { fillColor: 'green', borderColor: 'blue', fontColor: 'yellow' } - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/ink-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/ink-annotation.md index 477e9f9900..d86ebf53dd 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/ink-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/ink-annotation.md @@ -50,26 +50,6 @@ if (addInkAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let addInkAnnotation = document.getElementById('addInkAnnotation'); -if (addInkAnnotation) { - addInkAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode("Ink"); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -109,32 +89,6 @@ if (addInkAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let addInkAnnotation = document.getElementById('addInkAnnotation'); -if (addInkAnnotation) { - addInkAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Ink", { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width : 200, - height:60, - 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}]' - }); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -178,36 +132,6 @@ if (editInkAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let editInkAnnotation = document.getElementById('editInkAnnotation'); -if (editInkAnnotation) { - editInkAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].shapeAnnotationType === "Ink") { - var width = pdfviewer.annotationCollection[i].bounds.width; - var height = pdfviewer.annotationCollection[i].bounds.height; - pdfviewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -253,18 +177,5 @@ pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.inkAnnotationSettings = {author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6}; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer} from '@syncfusion/ej2-pdfviewer'; - -PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer); - -let pdfviewer: PdfViewer = new PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.inkAnnotationSettings = {author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6}; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/measurement-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/measurement-annotation.md index 5bda021b57..507c52f7fe 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/measurement-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/measurement-annotation.md @@ -58,25 +58,6 @@ if (distanceMode) { } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let distanceMode = document.getElementById('distanceMode'); -if (distanceMode) { - distanceMode.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode("Distance"); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -171,83 +152,6 @@ if (addVolumeAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let addDistanceAnnotation = document.getElementById('addDistanceAnnotation'); -if (addDistanceAnnotation) { - addDistanceAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Distance", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); - } - }); -} - -let addPerimeterAnnotation = document.getElementById('addPerimeterAnnotation'); -if (addPerimeterAnnotation) { - addPerimeterAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Perimeter", { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 350 }, { x: 285, y: 350 }, { x: 286, y: 412 }] - }); - } - }); -} - -let addAreaAnnotation = document.getElementById('addAreaAnnotation'); -if (addAreaAnnotation) { - addAreaAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Area", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - }); - } - }); -} - -let addRadiusAnnotation = document.getElementById('addRadiusAnnotation'); -if (addRadiusAnnotation) { - addRadiusAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Radius", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - }); - } - }); -} - -let addVolumeAnnotation = document.getElementById('addVolumeAnnotation'); -if (addVolumeAnnotation) { - addVolumeAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Volume", { - offset: { x: 200, y: 810 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 810 }, { x: 200, y: 919 }, { x: 320, y: 919 }, { x: 320, y: 809 }, { x: 200, y: 810 }] - }); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -360,101 +264,6 @@ if (editVolumeAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let editDistanceAnnotation = document.getElementById('editDistanceAnnotation'); -if (editDistanceAnnotation) { - editDistanceAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Distance calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editPerimeterAnnotation = document.getElementById('editPerimeterAnnotation'); -if (editPerimeterAnnotation) { - editPerimeterAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Perimeter calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editAreaAnnotation = document.getElementById('editAreaAnnotation'); -if (editAreaAnnotation) { - editAreaAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Area calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editRadiusAnnotation = document.getElementById('editRadiusAnnotation'); -if (editRadiusAnnotation) { - editRadiusAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Radius calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editVolumeAnnotation = document.getElementById('editVolumeAnnotation'); -if (editVolumeAnnotation) { - editVolumeAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Volume calculation") { - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -514,22 +323,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - distanceSettings : {fillColor: 'blue', opacity: 0.6, strokeColor: 'green'}, - perimeterSettings : {fillColor: 'green', opacity: 0.6, strokeColor: 'blue'}, - areaSettings :{fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'}, - radiusSettings : {fillColor: 'orange', opacity: 0.6, strokeColor: 'pink'}, - volumeSettings : {fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow'}, - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} ## Editing scale ratio and unit of the measurement annotation @@ -565,17 +358,5 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - measurementSettings = {scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm'}, - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/shape-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/shape-annotation.md index 3b547003b4..544baf44db 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/shape-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/shape-annotation.md @@ -59,26 +59,6 @@ if (circleAnnotationButton) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let circleAnnotationButton = document.getElementById('circleAnnotationButton'); -if (circleAnnotationButton) { - circleAnnotationButton.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode("Circle"); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -173,84 +153,6 @@ if (addPolygonAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let addLineAnnotation = document.getElementById('addLineAnnotation'); -if (addLineAnnotation) { - addLineAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Line", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); - } - }); -} - -let addArrowAnnotation = document.getElementById('addArrowAnnotation'); -if (addArrowAnnotation) { - addArrowAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Arrow", { - offset: { x: 200, y: 370 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 370 }, { x: 350, y: 370 }] - }); - } - }); -} - -let addRectangleAnnotation = document.getElementById('addRectangleAnnotation'); -if (addRectangleAnnotation) { - addRectangleAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Rectangle", { - offset: { x: 200, y: 480 }, - pageNumber: 1, - width: 150, - height: 75 - }); - } - }); -} - -let addCircleAnnotation = document.getElementById('addCircleAnnotation'); -if (addCircleAnnotation) { - addCircleAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Circle", { - offset: { x: 200, y: 620 }, - pageNumber: 1, - width: 90, - height: 90 - }); - } - }); -} - -let addPolygonAnnotation = document.getElementById('addPolygonAnnotation'); -if (addPolygonAnnotation) { - addPolygonAnnotation.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Polygon", { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 }] - }); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -361,100 +263,6 @@ if (editPolygonAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let editLineAnnotation = document.getElementById('editLineAnnotation'); -if (editLineAnnotation) { - editLineAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Line") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editArrowAnnotation = document.getElementById('editArrowAnnotation'); -if (editArrowAnnotation) { - editArrowAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Arrow") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editRectangleAnnotation = document.getElementById('editRectangleAnnotation'); -if (editRectangleAnnotation) { - editRectangleAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Rectangle") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editCircleAnnotation = document.getElementById('editCircleAnnotation'); -if (editCircleAnnotation) { - editCircleAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Circle") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - -let editPolygonAnnotation = document.getElementById('editPolygonAnnotation'); -if (editPolygonAnnotation) { - editPolygonAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].subject === "Polygon") { - pdfviewer.annotationCollection[i].strokeColor = "#0000FF"; - pdfviewer.annotationCollection[i].thickness = 2; - pdfviewer.annotationCollection[i].fillColor = "#FFFF00"; - pdfviewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -514,21 +322,5 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - lineSettings : {fillColor: 'blue', opacity: 0.6, strokeColor: 'green'}, - arrowSettings : {fillColor: 'green', opacity: 0.6, strokeColor: 'blue'}, - rectangleSettings : {fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'}, - circleSettings : {fillColor: 'orange', opacity: 0.6, strokeColor: 'pink'}, - polygonSettings : {fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow'} - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/signature-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/signature-annotation.md index d6754bfe0b..1deefb5f90 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/signature-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/signature-annotation.md @@ -54,24 +54,6 @@ if (handWrittenSignature) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let handWrittenSignature = document.getElementById('handWrittenSignature'); -if (handWrittenSignature) { - handWrittenSignature.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.setAnnotationMode('HandWrittenSignature'); - } - }); -} {% endhighlight %} {% endtabs %} @@ -140,62 +122,6 @@ if(addHandwrittenSignature){ }); } -{% endhighlight %} - -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let addHandwrittenSignature = document.getElementById('addHandwrittenSignature'); -if(addHandwrittenSignature){ - addHandwrittenSignature.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Initial", { - offset: { x: 220, y: 180 }, - pageNumber: 1, - width: 150, - height: 60, - signatureItem: ['Initial'], - initialDialogSettings: { - displayMode: ej.pdfviewer.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}]' - }); - pdfviewer.annotation.addAnnotation("Initial", { - offset: { x: 200, y: 380 }, - pageNumber: 1, - width: 200, - height: 65, - signatureItem: ['Initial'], - initialDialogSettings: { - displayMode: ej.pdfviewer.DisplayMode.Text, hideSaveSignature: false - }, - canSave: false, - path: 'Syncfusion', - fontFamily: "Helvetica", - }); - pdfviewer.annotation.addAnnotation("HandWrittenSignature", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - width: 200, - height: 80, - signatureItem: ['Signature'], - signatureDialogSettings: { - displayMode: ej.pdfviewer.DisplayMode.Upload, hideSaveSignature: false - }, - canSave: true, - path: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - }); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -260,44 +186,6 @@ document.getElementById('Signature')?.addEventListener('click', function () { }); }); -//Edit Signature annotation -document.getElementById('editSignatureAnnotation')?.addEventListener('click', () => { - for (let i = 0; i < pdfviewer.signatureCollection.length; i++) { - if (pdfviewer.signatureCollection[i].shapeAnnotationType === 'SignatureText') { - pdfviewer.signatureCollection[i].fontSize = 12; - pdfviewer.signatureCollection[i].thickness = 2; - pdfviewer.signatureCollection[i].strokeColor = '#0000FF'; - pdfviewer.signatureCollection[i].opacity = 0.8; - pdfviewer.annotationModule.editSignature(pdfviewer.signatureCollection[i]); - } - } -}); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - -//Add Signature annotation -document.getElementById('Signature')?.addEventListener('click', function () { - pdfviewer.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 Signature annotation document.getElementById('editSignatureAnnotation')?.addEventListener('click', () => { for (let i = 0; i < pdfviewer.signatureCollection.length; i++) { @@ -328,16 +216,6 @@ pdfviewer.appendTo('#PdfViewer'); pdfviewer.enableHandwrittenSignature = false; -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer); -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); -pdfviewer.enableHandwrittenSignature = false; - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/stamp-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/stamp-annotation.md index 0af4ee5c88..57cacbc70f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/stamp-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/stamp-annotation.md @@ -79,43 +79,6 @@ if (standardBusinessStamp) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, SignStampItem, StandardBusinessStampItem, DynamicStampItem,} from '@syncfusion/ej2-pdfviewer'; - -PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer); - -let pdfviewer: PdfViewer = new PdfViewer(); -pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"; -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; -pdfviewer.appendTo('#PdfViewer'); - -let dynamicStamp = document.getElementById('dynamicStamp'); -if (dynamicStamp) { - dynamicStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode('Stamp', 'NotApproved'); - } - }); -} -let signStamp = document.getElementById('signStamp'); -if (signStamp) { - signStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode('Stamp', undefined, 'Witness'); - } - }); -} -let standardBusinessStamp = document.getElementById('standardBusinessStamp'); -if (standardBusinessStamp) { - standardBusinessStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotationModule.setAnnotationMode('Stamp', undefined, undefined, 'Approved'); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -189,73 +152,6 @@ if (standardBusinessStamp) { }); } -let customStamp = document.getElementById('customStamp'); -if (customStamp) { - customStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation('Stamp', - { - offset: { x: 100, y: 440 }, - width: 46, - author: 'Guest', - height: 100, - isLock: true, - pageNumber: 1, - customStamps: [ - { - customStampName: "Image", - customStampImageSource: - "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - } - ] - }); - } - }); -} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let dynamicStamp = document.getElementById('dynamicStamp'); -if (dynamicStamp) { - dynamicStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 140 }, - pageNumber: 1 - }, 'Approved'); - } - }); -} -let signStamp = document.getElementById('signStamp'); -if (signStamp) { - signStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 240 }, - pageNumber: 1 - }, undefined,'Witness'); - } - }); -} -let standardBusinessStamp = document.getElementById('standardBusinessStamp'); -if (standardBusinessStamp) { - standardBusinessStamp.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 340 }, - pageNumber: 1 - }, undefined, undefined, 'Approved'); - } - }); -} - let customStamp = document.getElementById('customStamp'); if (customStamp) { customStamp.addEventListener('click', function () { @@ -318,32 +214,6 @@ if (editAnnotation) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -if (editAnnotation) { - editAnnotation.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].shapeAnnotationType === "stamp") { - var width = pdfviewer.annotationCollection[i].bounds.width; - var height = pdfviewer.annotationCollection[i].bounds.height; - pdfviewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - pdfviewer.annotationCollection[i].annotationSettings.isLock = true; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} {% endhighlight %} {% endtabs %} @@ -365,17 +235,5 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - stampSettings : {opacity: 0.3, author: 'Guest User'} - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/sticky-notes-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/sticky-notes-annotation.md index e5a5c63bd3..68ec654622 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/sticky-notes-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/sticky-notes-annotation.md @@ -66,30 +66,6 @@ if (stickyNote) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let stickyNote = document.getElementById('stickyNote'); -if (stickyNote) { - stickyNote.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("StickyNotes", { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false - }); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -130,33 +106,6 @@ if (stickyNote) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -let stickyNote = document.getElementById('stickyNote'); -if (stickyNote) { - stickyNote.addEventListener('click', function () { - if (pdfviewer) { - for (let i = 0; i < pdfviewer.annotationCollection.length; i++) { - if (pdfviewer.annotationCollection[i].shapeAnnotationType === "sticky") { - var width = pdfviewer.annotationCollection[i].bounds.width; - var height = pdfviewer.annotationCollection[i].bounds.height; - pdfviewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]); - } - } - } - }); -} - {% endhighlight %} {% endtabs %} @@ -198,18 +147,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - stickyNotesSettings : {author: 'Syncfusion'} - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -229,17 +166,5 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - enableStickyNotesAnnotation : false - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/text-markup-annotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/text-markup-annotation.md index 13005db875..f1b43c7ceb 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/text-markup-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/annotations/text-markup-annotation.md @@ -43,10 +43,6 @@ Refer to the following code snippet to switch to highlight mode. {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below [serviceUrl](https://ej2.syncfusion.com/documentation/api/pdfviewer/#serviceurl) in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/highlight-mode-cs1" %} Refer to the following code snippet to switch back to normal mode from highlight mode. @@ -57,10 +53,6 @@ Refer to the following code snippet to switch back to normal mode from highlight {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/highlight-normal-mode-cs1" %} ## Highlight text programmatically @@ -95,27 +87,6 @@ if (highlight) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let highlight = document.getElementById('highlight'); -if (highlight) { - highlight.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Highlight", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - } - }); -} {% endhighlight %} {% endtabs %} @@ -148,10 +119,6 @@ Refer to the following code snippet to switch to underline mode. {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/underline-mode-cs1" %} @@ -163,10 +130,6 @@ Refer to the following code snippet to switch back to normal mode from underline {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/underline-normal-mode-cs1" %} ## Underline text programmatically @@ -201,28 +164,6 @@ if (underline) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let underline = document.getElementById('underline'); -if (underline) { - underline.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Underline", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - } - }); -} - {% endhighlight %} {% endtabs %} @@ -255,10 +196,6 @@ Refer to the following code snippet to switch to strikethrough mode. {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/strikethrough-mode-cs1" %} Refer to the following code snippet to switch back to normal mode from strikethrough mode. @@ -269,10 +206,6 @@ Refer to the following code snippet to switch back to normal mode from strikethr {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/strikethrough-normal-mode-cs1" %} ## Strikethrough text programmatically @@ -307,27 +240,6 @@ if (strikethrough) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let strikethrough = document.getElementById('strikethrough'); -if (strikethrough) { - strikethrough.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Strikethrough", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - } - }); -} {% endhighlight %} {% endtabs %} @@ -359,10 +271,6 @@ Refer to the following code snippet to switch to squiggly mode. {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/squiggly-mode-cs1" %} Refer to the following code snippet to switch back to normal mode from squiggly mode. @@ -373,10 +281,6 @@ Refer to the following code snippet to switch back to normal mode from squiggly {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/squiggly-normal-mode-cs1" %} ## Add squiggly to text programmatically @@ -412,27 +316,6 @@ if (squiggly) { }); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl : "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); -let squiggly = document.getElementById('squiggly'); -if (squiggly) { - squiggly.addEventListener('click', function () { - if (pdfviewer) { - pdfviewer.annotation.addAnnotation("Squiggly", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - } - }); -} {% endhighlight %} {% endtabs %} @@ -487,20 +370,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - highlightSettings: {author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: ''}, - underlineSettings: {author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9, modifiedDate: ''}, - strikethroughSettings: {author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9, modifiedDate: ''}, - squigglySettings: {author: 'Guest User', subject: 'Spelling Error', color: '#ff0000', opacity: 0.9, modifiedDate: ''} -}); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -527,10 +396,6 @@ Refer to the following code snippet to call undo and redo actions from the clien {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-text-markup-annotation/undo-redo-cs1" %} ## Save text markup annotations @@ -555,17 +420,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextMarkupAnnotation: false, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/download.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/download.md index e97427d77e..9de8f07646 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/download.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/download.md @@ -38,19 +38,8 @@ The PDF Viewer supports downloading the currently loaded PDF document. Use the ` var pdfviewer = new ej.pdfviewer.PdfViewer({ enableDownload: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", -}); - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableDownload: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib", + documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); @@ -73,21 +62,7 @@ Invoke the download action programmatically with a simple button example: var pdfviewer = new ej.pdfviewer.PdfViewer({ enableDownload: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -document.getElementById('download').addEventListener('click', function () { - pdfviewer.download() -}); - -{% endhighlight %} -{% highlight html tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableDownload: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib", }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/forms/import-export-form-fields/import-form-fields.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/forms/import-export-form-fields/import-form-fields.md index 0849db4d90..d524954b3f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/forms/import-export-form-fields/import-form-fields.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/forms/import-export-form-fields/import-form-fields.md @@ -18,8 +18,6 @@ The **PDF Viewer** lets you import values into interactive form fields in the cu ## API to use - [`importFormFields(sourceOrObject, format)`](https://ej2.syncfusion.com/javascript/documentation/api/pdfviewer/index-default#importformfields) — Imports form data into the currently loaded PDF. The `sourceOrObject` parameter accepts a file path or URL, a file stream, or a JavaScript object; the `format` parameter accepts `FDF`, `XFDF`, or `JSON`. -N> For server-backed viewers, set `serviceUrl` before importing. The method triggers import events (`importStart`, `importSuccess`, `importFailed`); see the import/export events page for recommended handling. - ### Import FDF ```html diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/globalization.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/globalization.md index b0caafde03..aaf27bfcb4 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/globalization.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/globalization.md @@ -296,17 +296,7 @@ The different locale value for the PDF Viewer can be specified using the locale var pdfviewer = new ej.pdfviewer.PdfViewer({ locale: 'ar-AE', documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - locale: 'ar-AE', - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-save-button-js.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-save-button-js.md index 167d26e7b3..24759de3c7 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-save-button-js.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/add-save-button-js.md @@ -46,35 +46,6 @@ function OnCreateSearch() { this.addIcon('prepend', 'e-icons e-search'); } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var toolItem1 = { - prefixIcon: 'e-icons e-save', - id: 'download', - text: 'Save', - tooltipText: 'Save button', - align: 'Left' -}; - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath:'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - toolbarSettings : { toolbarItems: ['OpenOption', toolItem1, 'PageNavigationTool', 'MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm'] } - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar,ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields); - -//PDF Viewer control rendering starts -pdfviewer.appendTo('#PdfViewer'); -pdfviewer.toolbarClick = function (args) { - if (args.item && args.item.id === 'download') { - pdfviewer.download(); - } -}; -function OnCreateSearch() { - this.addIcon('prepend', 'e-icons e-search'); -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/change-author-name-using-annotation-settings.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/change-author-name-using-annotation-settings.md index 39ae82b07b..4b6091509e 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/change-author-name-using-annotation-settings.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/change-author-name-using-annotation-settings.md @@ -42,17 +42,4 @@ viewer.freeTextSettings = { allowTextOnly : true }; viewer.appendTo("#pdfViewer"); ``` {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -```ts -import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, Print, Annotation, FormFields } from "../src/index"; - -PdfViewer.Inject(Toolbar, Magnification, Navigation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, Print, Annotation, FormFields); -let viewer: PdfViewer = new PdfViewer(); -viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer"; -viewer.load('https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', null); -viewer.annotationSettings = { author: 'syncfusion', minHeight: 30, maxHeight: 500, minWidth: 30, maxWidth: 500, isLock: false, isPrint: true, isDownload: true }; -viewer.freeTextSettings = { allowTextOnly : true }; -viewer.appendTo("#pdfViewer"); -``` -{% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/configure-annotationselector-setting-js.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/configure-annotationselector-setting-js.md index 4dd97afa10..35e1f07ac0 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/configure-annotationselector-setting-js.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/configure-annotationselector-setting-js.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Configure annotation selector settings +# Configure annotation selector settings in JavaScript Use the [annotationSelectorSettings](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotationSelectorSettings/) property to customize the appearance and behavior of the annotation selector in the UI. diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-js.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-js.md index 2a5c80fd01..9e74d0acbd 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-js.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-js.md @@ -1,6 +1,6 @@ --- layout: post -title: Convert PDF Library bounds to PDF Viewer bounds in JavaScript PDF Viewer | Syncfusion +title: Convert PDF Library bounds to PDF Viewer bounds in JS | Syncfusion description: Learn how to convert PDF Library bounds into PDF Viewer bounds when exporting annotations, ensuring accurate placement in the JavaScript PDF Viewer. platform: document-processing control: PDF Viewer @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Convert PDF Library bounds to PDF Viewer bounds +# Convert PDF Library bounds to PDF Viewer bounds in JavaScript When exporting annotations from the PDF Library, convert the bounds values into the PDF Viewer format to ensure accurate placement. @@ -21,7 +21,7 @@ Create an instance of the PDF Viewer and configure it with the required services ```js var pdfviewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject( diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/custom-context-menu-js.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/custom-context-menu-js.md index 2d9d415223..51ce7d8b54 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/custom-context-menu-js.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/custom-context-menu-js.md @@ -272,10 +272,6 @@ The following is the output of the custom context menu with customization. {% endhighlight %} {% endtabs %} -N> To set up the server-backed PDF Viewer, add the following `serviceUrl` in the `index.ts` file: - -`pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer';` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/custom-context-menu" %} [Custom context menu sample on GitHub](https://github.com/SyncfusionExamples/javascript-pdf-viewer-examples/tree/master/How%20to/Custom%20Context%20Menu) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/min-max-zoom-js.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/min-max-zoom-js.md index 77ec13f323..02f673b672 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/min-max-zoom-js.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/min-max-zoom-js.md @@ -34,19 +34,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - maxZoom : 100, - minZoom : 10, - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -75,27 +62,6 @@ pdfviewer.documentLoad = (): void => { } }; -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -pdfviewer.documentLoad = (): void => { - if (Browser.isDevice && !viewer.enableDesktopMode) { - pdfviewer.maxZoom = 200; - pdfviewer.minZoom = 10; - } - else{ - pdfviewer.zoomMode = 'Default'; - } -}; - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/restricting-zoom-in-mobile-mode-js.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/restricting-zoom-in-mobile-mode-js.md index 19d25e8328..962a552ec8 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/restricting-zoom-in-mobile-mode-js.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/how-to/restricting-zoom-in-mobile-mode-js.md @@ -33,27 +33,6 @@ pdfviewer.documentLoad = (): void => { } }; -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - -pdfviewer.documentLoad = (): void => { - if (Browser.isDevice && !viewer.enableDesktopMode) { - pdfviewer.maxZoom = 200; - pdfviewer.minZoom = 10; - } - else{ - pdfviewer.zoomMode = 'Default'; - } -}; - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interaction-mode.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interaction-mode.md index e630e8abfb..1a043d417f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interaction-mode.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interaction-mode.md @@ -51,20 +51,6 @@ let pdfviewer: PdfViewer = new PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,ThumbnailView,BookmarkView, TextSelection} from '@syncfusion/ej2-pdfviewer'; - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); - -let pdfviewer: PdfViewer = new PdfViewer({ - enableTextSelection: true, - documentPath:'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl : 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -94,7 +80,7 @@ pdfviewer.appendTo('#PdfViewer'); var pdfviewer = new ej.pdfviewer.PdfViewer({ interactionMode: 'Pan' documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/bookmark.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/bookmark.md index 923e470862..9936be1694 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/bookmark.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/bookmark.md @@ -26,21 +26,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableBookmark: true, - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf' -}); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/hyperlink.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/hyperlink.md index da25174e6d..c961c1d72b 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/hyperlink.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/hyperlink.md @@ -57,21 +57,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, -ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, -ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - enableHyperlink: false // Disables all hyperlinks -}); - -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -100,7 +85,7 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ hyperlinkOpenState: 'NewTab' // Opens links in a new browser tab }); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; +pdfviewer.resourceUrl="https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} @@ -171,37 +156,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ // Append the PDF Viewer to the HTML element pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, -ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, ej.pdfviewer.LinkAnnotation, -ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', - // Event handler for hyperlink click - hyperlinkClick: function (args) { - // Log the URL of the clicked hyperlink - console.log('Hyperlink Clicked:', args.hyperlink); - - // To prevent the default navigation behavior, set args.cancel to true - // args.cancel = true; - }, - - // Event handler for mouse hover over a hyperlink - hyperlinkMouseOver: function (args) { - // Log the href of the hyperlink element when the mouse hovers over it - if (args && args.hyperlinkElement && args.hyperlinkElement.href) { - console.log('Mouse is over hyperlink:', args.hyperlinkElement.href); - } - } -}); - -// Append the PDF Viewer to the HTML element -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page-thumbnail.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page-thumbnail.md index a594d96308..0b545c0c79 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page-thumbnail.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page-thumbnail.md @@ -39,7 +39,7 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ enableThumbnail: true, documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf' }); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; +pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page.md index b074e006ed..38ddd62728 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/interactive-pdf-navigation/page.md @@ -53,21 +53,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableNavigation: true, - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf' -}); - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection -); - -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -131,44 +116,6 @@ document.getElementById('goToPreviousPage').addEventListener('click', () => { viewer.navigation.goToPreviousPage(); }); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var viewer = new ej.pdfviewer.PdfViewer ({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - resourceUrl:'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib' -}); - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, - ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, - ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation, ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -viewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'; -viewer.appendTo('#pdfViewer'); - -// Go To First Page -document.getElementById('goToFirstPage').addEventListener('click', () => { -viewer.navigation.goToFirstPage(); -}); -// Go To Last Page -document.getElementById('goToLastPage').addEventListener('click', () => { -viewer.navigation.goToLastPage(); -}); -// Go To Next Page -document.getElementById('goToNextPage').addEventListener('click', () => { -viewer.navigation.goToNextPage(); -}); -// Go To Page -document.getElementById('goToPage').addEventListener('click', () => { -viewer.navigation.goToPage(4); -}); -// Go To Previous Page -document.getElementById('goToPreviousPage').addEventListener('click', () => { -viewer.navigation.goToPreviousPage(); -}); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/magnification.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/magnification.md index 9a2dfb35ef..70610326d8 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/magnification.md @@ -42,17 +42,7 @@ Use the following configuration to enable magnification in the PDF Viewer: var pdfviewer = new ej.pdfviewer.PdfViewer({ enableMagnification: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableMagnification: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/navigation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/navigation.md index 52aa2d27e5..dfc8fa23ce 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/navigation.md @@ -51,17 +51,7 @@ Enable or disable page navigation using the following configuration: var pdfviewer = new ej.pdfviewer.PdfViewer({ enableNavigation: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableNavigation: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -104,48 +94,7 @@ You can also perform page navigation programmatically: var viewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', -}); -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormFields -); -viewer.appendTo('#pdfViewer'); -// Go To First Page -document.getElementById('goToFirstPage').addEventListener('click', () => { - viewer.navigation.goToFirstPage(); -}); -// Go To Last Page -document.getElementById('goToLastPage').addEventListener('click', () => { - viewer.navigation.goToLastPage(); -}); -// Go To Next Page -document.getElementById('goToNextPage').addEventListener('click', () => { - viewer.navigation.goToNextPage(); -}); -// Go To Page -document.getElementById('goToPage').addEventListener('click', () => { - viewer.navigation.goToPage(4); -}); -// Go To Previous Page -document.getElementById('goToPreviousPage').addEventListener('click', () => { - viewer.navigation.goToPreviousPage(); -}); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl:'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject( ej.pdfviewer.Toolbar, @@ -197,17 +146,7 @@ Bookmarks saved in PDF files provide quick navigation. Enable or disable bookmar var pdfviewer = new ej.pdfviewer.PdfViewer({ enableBookmark: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableBookmark: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -260,17 +199,7 @@ Thumbnails provide miniature representations of PDF pages for quick navigation. var pdfviewer = new ej.pdfviewer.PdfViewer({ enableThumbnail: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableThumbnail: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -298,17 +227,7 @@ Enable or disable table of contents navigation using the following configuration var pdfviewer = new ej.pdfviewer.PdfViewer({ enableHyperlink: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableHyperlink: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -324,23 +243,12 @@ Change the hyperlink open state using the following configuration: var pdfviewer = new ej.pdfviewer.PdfViewer({ enableHyperlink: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" hyperlinkOpenState:'NewTab', }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableHyperlink: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - hyperlinkOpenState:'NewTab', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-amazon-s3.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-amazon-s3.md index b719de55db..9bc99641a8 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-amazon-s3.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-amazon-s3.md @@ -71,143 +71,4 @@ pdfviewer.created = function () { N> The **aws-sdk** package must be installed in your application to use the previous code example. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using the server-backed PDF Viewer - -Follow these steps to load a PDF from AWS S3 using the server-backed PDF Viewer. - -**Step 1:** Create a PDF Viewer sample in JavaScript - -Create a basic PDF Viewer sample by following the [getting started guide](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/getting-started) - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` - -5. Modify the [Load()](https://ej2.syncfusion.com/documentation/api/pdfviewer/#load) method to load the PDF files from AWS S3. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  - -public async Task Load([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - - string document = jsonObject["document"]; - - // Specify the document name or retrieve it from a different source - var response = await s3Client.GetObjectAsync(_bucketName, document); - - Stream responseStream = response.ResponseStream; - responseStream.CopyTo(stream); - stream.Seek(0, SeekOrigin.Begin); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - - jsonResult = pdfviewer.Load(stream, jsonObject); - - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace the placeholders with your actual AWS credentials and bucket name: Access Key, Secret Key, and Bucket Name. - -**Step 3:** Configure the PDF Viewer component - -Set the [serviceUrl](https://ej2.syncfusion.com/documentation/api/pdfviewer/#serviceurl) to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from AWS S3. Ensure the document name matches an object in your bucket. - -```javascript -// Inject required modules -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner -); - -var viewer = new ej.pdfviewer.PdfViewer(); -// Replace the "localhost:44396" with the actual URL of your server -viewer.serviceUrl = 'https://localhost:44396/pdfviewer'; -viewer.appendTo('#pdfViewer'); -viewer.load('PDF_Succinctly.pdf', null); - -``` - -N> The **AWSSDK.S3** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-azure-blob-storage.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-azure-blob-storage.md index f38bd66776..88628c452e 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-azure-blob-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-azure-blob-storage.md @@ -87,126 +87,4 @@ function blobToBase64(blob) { } ``` -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using the server-backed PDF Viewer - -Follow these steps to load a PDF from Azure Blob Storage using the server-backed PDF Viewer. - -**Step 1:** Create a PDF Viewer sample in JavaScript - -Start by following the steps provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/getting-started) to create a simple PDF viewer sample in JavaScript. This will give you a basic setup of the PDF viewer component. - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private readonly string _storageConnectionString; -private readonly string _storageContainerName; -private readonly ILogger _logger; - -public PdfViewerController(IConfiguration configuration, ILogger logger) -{ - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); - _logger = logger; -} -``` - -5. Modify the [Load()](https://ej2.syncfusion.com/documentation/api/pdfviewer/#load) method to load PDF files from Azure Blob Storage. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  -  -public IActionResult Load([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.TryParse(jsonObject["isFileName"], out bool isFileName) && isFileName) - { - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - string fileName = jsonObject["document"]; - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - BlockBlobClient blockBlobClient = containerClient.GetBlockBlobClient(fileName); - blockBlobClient.DownloadTo(stream); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -N> Replace the placeholders with your actual values: Azure storage connection string and container name. - -**Step 3:** Configure the PDF Viewer component - -Set the [serviceUrl](https://ej2.syncfusion.com/documentation/api/pdfviewer/#serviceurl) to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from Azure Blob Storage. Ensure the document name exists in your Azure container. - -```javascript -// Inject required modules -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner -); - -var viewer = new ej.pdfviewer.PdfViewer(); -// Replace the "localhost:44396" with the actual URL of your server -viewer.serviceUrl = 'https://localhost:44396/pdfviewer'; -viewer.appendTo('#pdfViewer'); -viewer.load('PDF_Succinctly.pdf', null); - -``` - -N> The **Azure.Storage.Blobs** NuGet package must be installed in your application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-dropbox-cloud-file-storage.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-dropbox-cloud-file-storage.md index c4dc9f40e5..d8f544c1dd 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-dropbox-cloud-file-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/open-pdf-file/from-dropbox-cloud-file-storage.md @@ -61,141 +61,4 @@ function blobToBase64(blob: Blob): Promise { N> Install the Dropbox SDK for the client sample with `npm install dropbox`. Verify the SDK version compatibility with your project. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) - -## Using the server-backed PDF Viewer - -To load a PDF file from Dropbox cloud file storage in a PDF Viewer, you can follow the steps below - -**Step 1:** Create a Dropbox API app - -Follow the official Dropbox documentation [link](https://www.dropbox.com/developers/documentation/dotnet#tutorial) to create a Dropbox API app using the App Console. Configure redirect URIs and required scopes for file access, and select an OAuth flow appropriate for the application (server-side OAuth is recommended for production). - -**Step 2:** Create a PDF Viewer sample in JavaScript - -Start by following the steps provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/javascript-es5/getting-started) to create a simple PDF viewer sample in JavaScript. This will give you a basic setup of the PDF viewer component. - -**Step 3:** Modify the `PdfViewerController.cs` file in the web service project - -1. Create a web service project in .NET Core 3.0 or above (NET 6 LTS or later recommended). You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on creating a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Dropbox.Api; -using Dropbox.Api.Files; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _folderName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _folderName = _configuration.GetValue("FolderName"); -} -``` - -5. Modify the [Load()](https://ej2.syncfusion.com/documentation/api/pdfviewer/#load) method to load the PDF files from Dropbox cloud file storage. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  - -public async Task Load([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - // Get the file name from the jsonObject, which should contain the Dropbox file name - string fileName = jsonObject["document"]; - - using (var dropBox = new DropboxClient(_accessToken)) - { - using (var response = await dropBox.Files.DownloadAsync(_folderName + "/" + fileName)) - { - var byteArray = await response.GetContentAsByteArrayAsync(); - - // Load the PDF file into the PDF viewer - stream = new MemoryStream(byteArray); - } - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Dropbox_Access_Token", - "FolderName": "Your_Folder_Name" -} -``` - -N> Replace the placeholders with your actual Dropbox values: access token and folder name. Store server-side credentials securely (for example, using environment variables or a secrets store) and restrict token permissions to the minimum required scopes. - -**Step 4:** Configure the PDF Viewer component - -Set the [serviceUrl](https://ej2.syncfusion.com/documentation/api/pdfviewer/#serviceurl) to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from Dropbox. Ensure the document name exists in your Dropbox folder. - -```javascript - -// Inject required modules -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormFields, - ej.pdfviewer.FormDesigner -); - -var viewer = new ej.pdfviewer.PdfViewer(); -// Replace the "localhost:44396" with the actual URL of your server -viewer.serviceUrl = 'https://localhost:44396/pdfviewer'; -viewer.appendTo('#pdfViewer'); -viewer.load('PDF_Succinctly.pdf', null); - -``` - -N> Install the `Dropbox.Api` NuGet package in the server project to use the Dropbox client APIs shown above. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Server-Backed) +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/programmatic-support.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/programmatic-support.md index b0889f2fe6..f46ebc5595 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/programmatic-support.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/programmatic-support.md @@ -31,22 +31,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.enablePageOrganizer = true; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; -pdfviewer.enablePageOrganizer = true; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -69,22 +53,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.isPageOrganizerOpen = true; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; -pdfviewer.isPageOrganizerOpen = true; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -107,22 +75,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.pageOrganizerSettings = {canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, canImport: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5} pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; -pdfviewer.pageOrganizerSettings = {canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, canImport: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5} -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/toolbar.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/toolbar.md index f2ad8e0b7c..2d5259d612 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pages/toolbar.md @@ -31,22 +31,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.pageOrganizerSettings = { canInsert: false }; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; -pdfviewer.pageOrganizerSettings = { canInsert: false }; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -70,22 +54,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.pageOrganizerSettings = {canDelete: false}; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; -pdfviewer.pageOrganizerSettings = {canDelete: false}; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -108,22 +76,6 @@ pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewe pdfviewer.pageOrganizerSettings = {canRotate: false}; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Navigation, ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner, ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer(); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; -pdfviewer.documentPath = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf'; -pdfviewer.resourceUrl = 'https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib'; -pdfviewer.pageOrganizerSettings = {canRotate: false}; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pdf.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pdf.md index 2be2580550..b0180d4010 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pdf.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/organize-pdf.md @@ -86,18 +86,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - enablePageOrganizer : true - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -115,18 +103,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - isPageOrganizerOpen : true - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -144,18 +120,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - pageOrganizerSettings : {canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, canImport: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5} - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print.md index 941911347c..9360d4b37f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print.md @@ -41,17 +41,7 @@ The following HTML and JavaScript examples render the PDF Viewer with printing e var pdfviewer = new ej.pdfviewer.PdfViewer({ enablePrint: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enablePrint: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -76,22 +66,7 @@ To start printing from code, call the `print.print()` method after loading a doc var pdfviewer = new ej.pdfviewer.PdfViewer({ enablePrint: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -document.getElementById('print').addEventListener('click', function () { - pdfviewer.print.print(); -}); - - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enablePrint: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -118,19 +93,7 @@ The following example demonstrates how to update the scale factor before printin var pdfviewer = new ej.pdfviewer.PdfViewer({ enablePrint: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - printScaleFactor: 0.5, - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -//pdf with low quality. By changing values you can change the quality of the pdf. -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enablePrint: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib", printScaleFactor: 0.5, }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); @@ -149,22 +112,7 @@ Set the `enablePrintRotation` property to control whether landscape pages are ro var viewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - enablePrintRotation: true -}); - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, - ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.Print, ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation -); - -viewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" enablePrintRotation: true }); @@ -194,22 +142,7 @@ The following example shows how to set the print mode. var viewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - printMode: 'NewWindow' -}); - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, - ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.Print, ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation -); - -viewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib", printMode: 'NewWindow' }); @@ -247,24 +180,7 @@ The following example logs the file that is being printed and shows how to cance var viewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - printStart: function(args) { - console.log('Print action has started for file ' + args.fileName); - } -}); - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, - ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.Print, ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation -); - -viewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib", printStart: function(args) { console.log('Print action has started for file ' + args.fileName); } @@ -293,24 +209,7 @@ The following example logs the printed file name. var viewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - printEnd: function(args) { - console.log('Printed File Name: ' + args.fileName); - } -}); - -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, - ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.Print, ej.pdfviewer.Navigation, - ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation -); - -viewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib", printEnd: function(args) { console.log('Printed File Name: ' + args.fileName); } diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/enable-print-rotation.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/enable-print-rotation.md index ccdf7290b9..5072e6f49a 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/enable-print-rotation.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/enable-print-rotation.md @@ -38,30 +38,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -// Inject required modules -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', - enablePrintRotation: true -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/events.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/events.md index 08721b11b9..741ff23f88 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/events.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/events.md @@ -57,31 +57,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', - printStart: function(args) { - console.log('Print action has started for file: ' + args.fileName); - // To cancel the print action - // args.cancel = true; - } -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -119,29 +94,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/', - printEnd: function(args) { - console.log('Printed File Name: ' + args.fileName); - } -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/overview.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/overview.md index 81617b01e0..b479a3e7e3 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/overview.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/overview.md @@ -43,27 +43,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enablePrint: true, - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -103,34 +82,6 @@ if (printButton) { }; } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); -pdfviewer.appendTo('#PdfViewer'); -//print on button click -var printButton = document.getElementById('print'); -if (printButton) { - printButton.onclick = function () { - pdfviewer.print.print(); - }; -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-modes.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-modes.md index f7fb3dbac2..8ad28bd844 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-modes.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-modes.md @@ -45,30 +45,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ pdfviewer.printMode = "NewWindow"; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -// Inject required modules -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); -pdfviewer.printMode = "NewWindow"; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-quality.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-quality.md index 8e6ec4209b..f778a8820a 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-quality.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/print/print-quality.md @@ -42,31 +42,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ pdfviewer.printScaleFactor = 0.5; pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -// Inject required modules - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields, - ej.pdfviewer.PageOrganizer -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); -pdfviewer.printScaleFactor = 0.5; -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search.md index 5cd630c9ca..2d2bbdef4c 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search.md @@ -39,17 +39,7 @@ The text search feature in the PDF Viewer locates and highlights matching conten var pdfviewer = new ej.pdfviewer.PdfViewer({ enableTextSearch: true, documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); - -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextSearch: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' + resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib" }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); pdfviewer.appendTo('#PdfViewer'); @@ -165,21 +155,6 @@ document.getElementById('textbounds').addEventListener('click', function() { }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextSearch: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); -document.getElementById('textbounds').addEventListener('click', function() { - console.log(viewer.textSearch.findText('pdf', false)); -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -204,21 +179,6 @@ document.getElementById('textbounds').addEventListener('click', function() { }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextSearch: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); -document.getElementById('textbounds').addEventListener('click', function() { - console.log(viewer.textSearch.findText('pdf', false, 7)); -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -243,21 +203,6 @@ document.getElementById('textbounds').addEventListener('click', function() { }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextSearch: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); -document.getElementById('textbounds').addEventListener('click', function() { - console.log(viewer.textSearch.findText(['pdf', 'adobe'], false)); -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -282,21 +227,6 @@ document.getElementById('textbounds').addEventListener('click', function() { }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextSearch: true, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); -document.getElementById('textbounds').addEventListener('click', function() { - console.log(viewer.textSearch.findText(['pdf', 'adobe'], false, 7)); -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/find-text.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/find-text.md index 84a83f935c..6c6b989bf9 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/find-text.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/find-text.md @@ -46,30 +46,6 @@ document.getElementById('textbounds').addEventListener('click', function () { console.log(viewer.textSearch.findText('pdf', false)); }); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields -); - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' -}); -viewer.appendTo('#pdfViewer'); -document.getElementById('textbounds').addEventListener('click', function () { - console.log(viewer.textSearch.findText('pdf', false)); -}); - {% endhighlight %} {% endtabs %} @@ -105,30 +81,6 @@ document.getElementById('textbounds').addEventListener('click', function () { console.log(viewer.textSearch.findText('pdf', false, 7)); }); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields -); - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' -}); -viewer.appendTo('#pdfViewer'); -document.getElementById('textbounds').addEventListener('click', function () { - console.log(viewer.textSearch.findText('pdf', false, 7)); -}); - {% endhighlight %} {% endtabs %} @@ -163,30 +115,6 @@ document.getElementById('textbounds').addEventListener('click', function () { console.log(viewer.textSearch.findText(['adobe', 'pdf'], false)); }); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields -); - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' -}); -viewer.appendTo('#pdfViewer'); -document.getElementById('textbounds').addEventListener('click', function () { - console.log(viewer.textSearch.findText(['adobe', 'pdf'], false)); -}); - {% endhighlight %} {% endtabs %} @@ -222,30 +150,6 @@ document.getElementById('textbounds').addEventListener('click', function () { console.log(viewer.textSearch.findText(['adobe', 'pdf'], false, 7)); }); -{% endhighlight %} -{% highlight js tabtitle="Server-backed" %} - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch, - ej.pdfviewer.Print, - ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Annotation, - ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields -); - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' -}); -viewer.appendTo('#pdfViewer'); -document.getElementById('textbounds').addEventListener('click', function () { - console.log(viewer.textSearch.findText(['adobe', 'pdf'], false, 7)); -}); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/text-search-features.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/text-search-features.md index 3571d346f4..8370c16556 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/text-search-features.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/text-search/text-search-features.md @@ -105,29 +105,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ }); pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.Pdfviewer.TextSearch -); - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableTextSearch: true, - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -251,71 +228,6 @@ function cancelTextSearch() { viewer.textSearch.cancelTextSearch(); } -// Example: wire up to buttons/inputs -var input = document.getElementById('searchBox'); -var btnSearch = document.getElementById('btnSearch'); -if (btnSearch) { - btnSearch.addEventListener('click', function () { - var val = input ? input.value : ''; - searchText(val, false); - }); -} -var btnNext = document.getElementById('btnNext'); -if (btnNext) { - btnNext.addEventListener('click', function () { searchNext(); }); -} -var btnPrev = document.getElementById('btnPrev'); -if (btnPrev) { - btnPrev.addEventListener('click', function () { searchPrevious(); }); -} -var btnCancel = document.getElementById('btnCancel'); -if (btnCancel) { - btnCancel.addEventListener('click', function () { cancelTextSearch(); }); -} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, - ej.pdfviewer.Magnification, - ej.pdfviewer.Navigation, - ej.pdfviewer.Annotation, - ej.pdfviewer.LinkAnnotation, - ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, - ej.pdfviewer.TextSelection, - ej.pdfviewer.TextSearch -); - -var viewer = new ej.pdfviewer.PdfViewer({ - documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', -serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); - -viewer.appendTo('#pdfViewer'); - -// --- Programmatic Text Search API --- - -// Searches the target text in the PDF and highlights all matches. -function searchText(query, matchCase) { - if (!query || !query.trim()) return; - viewer.textSearch.searchText(query, !!matchCase); -} - -// Navigates to the next occurrence relative to the current active match. -function searchNext() { - viewer.textSearch.searchNext(); -} - -// Navigates to the previous occurrence relative to the current active match. -function searchPrevious() { - viewer.textSearch.searchPrevious(); -} - -// Cancels the current search and clears all highlights. -function cancelTextSearch() { - viewer.textSearch.cancelTextSearch(); -} - // Example: wire up to buttons/inputs var input = document.getElementById('searchBox'); var btnSearch = document.getElementById('btnSearch'); diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/textselection.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/textselection.md index b901e9113c..2204a1604f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/textselection.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/textselection.md @@ -63,7 +63,7 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', enableTextSelection: true // Defaults to true }); -pdfviewer.serviceUrl = 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/'; +pdfviewer.resourceUrl="https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib"; pdfviewer.appendTo('#PdfViewer'); // Toggle on demand diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/custom-toolbar.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/custom-toolbar.md index ed3e4e44ec..71e21c0eaa 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/custom-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/custom-toolbar.md @@ -78,18 +78,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc pdfviewer.appendTo('#PdfViewer'); ``` {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -```javascript -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableToolbar: false, - enableNavigationToolbar: false, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' -}); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation,ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); -``` -{% endhighlight %} {% endtabs %} **Step 4: Add EJ2 Toolbar for primary actions.** @@ -654,358 +642,6 @@ textSearchPopup.hide(); enableNextButton(false); enablePrevButton(false); -``` -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -```javascript - -var inputTemplate = '
    '; -var totalPageNum = '
    of 0
    '; -var isBookmarkOpen = false; -var isBookmarkClick = false; -var isTextSearchBoxOpen = false; -var bookmarkPopup; -var textSearchPopup; -var toolbarObj; -var viewer; -var currentPageBox; -var searchInput; -var searchButton; -var openDocument; -var matchCase = false; -var fileInputElement; -var filename; - -function previousClicked(args) { - hidePopups(); - viewer.navigation.goToPreviousPage(); -} -function hidePopups() { - isBookmarkOpen = false; - isTextSearchBoxOpen = false; - bookmarkPopup.hide(); - textSearchPopup.hide(); -} -function bookmarkClicked() { - textSearchPopup.hide(); - if (!isBookmarkOpen) { - var bookmarkDetails = viewer.bookmark.getBookmarks(); - if (bookmarkDetails.bookmarks) { - var bookmarks = bookmarkDetails.bookmarks.bookMark; - var treeObj = new ej.navigations.TreeView({ - fields: { - dataSource: bookmarks, - id: 'Id', - parentID: 'Pid', - text: 'Title', - hasChildren: 'HasChild', - }, nodeSelected: nodeClick - }); - treeObj.appendTo('#bookmarkview'); - bookmarkPopup.show(); - isBookmarkOpen = true; - isBookmarkClick = true; - } - else { - toolbarObj.enableItems(document.getElementById('bookmarkButton'), false); - isBookmarkOpen = false; - } - } - else { - if (!isBookmarkClick) { - bookmarkPopup.show(); - isBookmarkClick = true; - } else { - bookmarkPopup.hide(); - isBookmarkClick = false; - } - } -} -function nextClicked(args) { - hidePopups(); - viewer.navigation.goToNextPage(); -} -function searchClicked(args) { - bookmarkPopup.hide(); - if (!isTextSearchBoxOpen) { - textSearchPopup.show(); - } - else { - viewer.textSearch.cancelTextSearch(); - textSearchPopup.hide(); - } - isTextSearchBoxOpen = !isTextSearchBoxOpen; -} -function printClicked(args) { - hidePopups(); - viewer.print.print(); -} -function downloadClicked(args) { - hidePopups(); - viewer.download(); -} -function pageFitClicked(args) { - hidePopups(); - viewer.magnification.fitToPage(); - updateZoomButtons(); - toolbarObj.enableItems(document.getElementById('fitPage'), false); -} -function zoomInClicked(args) { - hidePopups(); - viewer.magnification.zoomIn(); - updateZoomButtons(); -} -function zoomOutClicked(args) { - hidePopups(); - viewer.magnification.zoomOut(); - updateZoomButtons(); -} - -function readFile(args) { - // tslint:disable-next-line - var upoadedFiles = args.target.files; - if (args.target.files[0] !== null) { - var uploadedFile = upoadedFiles[0]; - filename = upoadedFiles[0].name; - if (uploadedFile) { - var reader = new FileReader(); - reader.readAsDataURL(uploadedFile); - // tslint:disable-next-line - reader.onload = function (e) { - var uploadedFileUrl = e.currentTarget.result; - viewer.load(uploadedFileUrl, null); - currentPageBox.value = '1'; - document.getElementById("bookmarkview").innerHTML = ""; - isBookmarkOpen = false; - viewer.fileName = filename; - }; - } - } -} - -function openClicked() { - document.getElementById('fileUpload').click(); -} -function onCurrentPageBoxKeypress(event) { - if ((event.which < 48 || event.which > 57) && event.which !== 8 && event.which !== 13) { - event.preventDefault(); - return false; - } - else { - var currentPageNumber = parseInt(currentPageBox.value); - if (event.which === 13) { - if (currentPageNumber > 0 && currentPageNumber <= viewer.pageCount) { - viewer.navigation.goToPage(currentPageNumber); - } - else { - currentPageBox.value = viewer.currentPageNumber.toString(); - } - } - return true; - } -} -function onCurrentPageBoxClicked() { - currentPageBox.select(); - currentPageBox.focus(); -} -function updatePageNavigation() { - if (viewer.currentPageNumber === 1) { - toolbarObj.enableItems(document.getElementById('previousPage'), false); - toolbarObj.enableItems(document.getElementById('nextPage'), true); - } - else if (viewer.currentPageNumber === viewer.pageCount) { - toolbarObj.enableItems(document.getElementById('previousPage'), true); - toolbarObj.enableItems(document.getElementById('nextPage'), false); - } - else { - toolbarObj.enableItems(document.getElementById('previousPage'), true); - toolbarObj.enableItems(document.getElementById('nextPage'), true); - } -} -function updateZoomButtons() { - if (viewer.zoomPercentage <= 50) { - toolbarObj.enableItems(document.getElementById('zoomIn'), true); - toolbarObj.enableItems(document.getElementById('zoomOut'), false); - toolbarObj.enableItems(document.getElementById('fitPage'), true); - } - else if (viewer.zoomPercentage >= 400) { - toolbarObj.enableItems(document.getElementById('zoomIn'), false); - toolbarObj.enableItems(document.getElementById('zoomOut'), true); - toolbarObj.enableItems(document.getElementById('fitPage'), true); - } - else { - toolbarObj.enableItems(document.getElementById('zoomIn'), true); - toolbarObj.enableItems(document.getElementById('zoomOut'), true); - toolbarObj.enableItems(document.getElementById('fitPage'), true); - } -} -function nodeClick(args) { - var bookmarksDetails = viewer.bookmark.getBookmarks(); - var bookmarksDestination = bookmarksDetails.bookmarksDestination; - var bookid = Number(args.nodeData.id); - var pageIndex = bookmarksDestination.bookMarkDestination[bookid].PageIndex; - var Y = bookmarksDestination.bookMarkDestination[bookid].Y; - viewer.bookmark.goToBookmark(pageIndex, Y); - return false; -} -function searchInputKeypressed(event) { - enablePrevButton(true); - enableNextButton(true); - if (event.which === 13) { - initiateTextSearch(); - updateSearchInputIcon(false); - } -} -function searchClickHandler() { - if (searchButton.classList.contains('e-pv-search-icon')) { - viewer.textSearch.cancelTextSearch(); - initiateTextSearch(); - } - else if (searchButton.classList.contains('e-pv-search-close')) { - searchInput.value = ''; - searchInput.focus(); - viewer.textSearch.cancelTextSearch(); - } -} -function initiateTextSearch() { - var searchString = searchInput.value; - viewer.textSearch.searchText(searchString, matchCase); -} -function previousSearchClicked() { - var searchString = searchInput.value; - if (searchString) { - viewer.textSearch.searchPrevious(); - } -} -function nextSearchClicked() { - var searchString = searchInput.value; - if (searchString) { - viewer.textSearch.searchNext(); - } -} -function checkBoxChanged(args) { - if (args.checked) { - matchCase = true; - } - else { - matchCase = false; - } - initiateTextSearch(); -} -function enablePrevButton(isEnable) { - var previousSearchButton = document.getElementById('previousSearch'); - if (isEnable) { - previousSearchButton.removeAttribute('disabled'); - } - else { - previousSearchButton.disabled = true; - } -} -function enableNextButton(isEnable) { - var nextSearchButton = document.getElementById('nextSearch'); - if (isEnable) { - nextSearchButton.removeAttribute('disabled'); - } - else { - nextSearchButton.disabled = true; - } -} -function updateSearchInputIcon(isEnable) { - if (isEnable) { - searchButton.classList.remove('e-pv-search-close'); - searchButton.classList.add('e-pv-search-icon'); - } - else { - searchButton.classList.remove('e-pv-search-icon'); - searchButton.classList.add('e-pv-search-close'); - } -} -toolbarObj = new ej.navigations.Toolbar({ - items: [ - { prefixIcon: 'e-pv-open-document', tooltipText: 'Open', id: 'openButton', click: openClicked }, - { prefixIcon: 'e-pv-bookmark-icon', tooltipText: 'Bookmark', id: 'bookmarkButton', click: bookmarkClicked }, - { prefixIcon: 'e-pv-previous-page-navigation-icon', id: 'previousPage', tooltipText: 'Previous Page', align: 'Center', click: previousClicked.bind(this) }, - { prefixIcon: 'e-pv-next-page-navigation-icon', id: 'nextPage', tooltipText: 'Next Page', align: 'Center', click: nextClicked.bind(this) }, - { template: inputTemplate, tooltipText: 'Page Number', align: 'Center' }, - { template: totalPageNum, tooltipText: 'Page Number', align: 'Center' }, - { prefixIcon: 'e-pv-search-icon', tooltipText: 'Text Search', align: 'Right', click: searchClicked.bind(this) }, - { prefixIcon: 'e-pv-print-document-icon', tooltipText: 'Print', align: 'Right', click: printClicked.bind(this) }, - { prefixIcon: 'e-pv-download-document-icon', tooltipText: 'Download', align: 'Right', click: downloadClicked.bind(this) } - ] -}); -toolbarObj.appendTo('#topToolbar'); -var magnificationToolbar = new ej.navigations.Toolbar({ - items: [ - { prefixIcon: 'e-pv-fit-page-icon', id: 'fitPage', tooltipText: 'Fit to page', click: pageFitClicked.bind(this) }, - { prefixIcon: 'e-pv-zoom-in-icon', id: 'zoomIn', tooltipText: 'Zoom in', click: zoomInClicked.bind(this) }, - { prefixIcon: 'e-pv-zoom-out-icon' , id: 'zoomOut', tooltipText: 'Zoom out', click: zoomOutClicked.bind(this) }, - ] -}); -magnificationToolbar.appendTo('#magnificationToolbar'); -viewer = new ej.pdfviewer.PdfViewer({ - enableToolbar: false, - enableNavigationToolbar: false, - documentPath: 'https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' -}); -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, - ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, - ej.pdfviewer.Print -); -viewer.appendTo('#pdfViewer'); -document.getElementById('fileUpload').addEventListener('change', readFile, false); -currentPageBox = document.getElementById('currentPage'); -currentPageBox.value = '1'; -searchInput = document.getElementById('searchInput'); -openDocument = document.getElementById('fileupload'); -bookmarkPopup = new ej.popups.Dialog({ - showCloseIcon: true, header: "Bookmarks", closeOnEscape: false, isModal: false, target: document.getElementById('pdfViewer'), - content: '
    ', - buttons: [{ - buttonModel: {}, - }], position: { X: 'left', Y: 'top' }, cssClass: 'e-bookmark-popup', beforeClose: function () { - isBookmarkOpen = false; - } -}); -bookmarkPopup.appendTo('#popup'); -textSearchPopup = new ej.popups.Dialog({ - showCloseIcon: false, closeOnEscape: false, isModal: false, target: document.getElementById('pdfViewer'), - buttons: [{ - buttonModel: {}, - }], position: { X: 'right', Y: 'top' }, cssClass: 'e-text-search-popup', -}); -textSearchPopup.appendTo('#textSearchBox'); -var previousSearch = new ej.buttons.Button({ iconCss: 'e-pv-previous-search' }); -previousSearch.appendTo('#previousSearch'); -var nextSearch = new ej.buttons.Button({ iconCss: 'e-pv-next-search-btn' }); -nextSearch.appendTo('#nextSearch'); -var matchCaseCheck = new ej.buttons.CheckBox({ label: 'Match case', change: checkBoxChanged }); -matchCaseCheck.appendTo('#matchCase'); -viewer.pageChange = function (args) { - currentPageBox.value = viewer.currentPageNumber.toString(); - updatePageNavigation(); -}; -viewer.documentLoad = function (args) { - - document.getElementById('totalPage').textContent = 'of ' + viewer.pageCount; - updatePageNavigation(); -}; -searchButton = document.getElementById('searchBtn'); -searchInput.addEventListener('focus', function () { searchInput.parentElement.classList.add('e-input-focus'); }); -searchInput.addEventListener('blur', function () { searchInput.parentElement.classList.remove('e-input-focus'); }); -searchInput.addEventListener('keypress', searchInputKeypressed); -document.getElementById('previousSearch').addEventListener('click', previousSearchClicked); -document.getElementById('nextSearch').addEventListener('click', nextSearchClicked); -searchButton.addEventListener('click', searchClickHandler); -currentPageBox.addEventListener('keypress', onCurrentPageBoxKeypress); -currentPageBox.addEventListener('click', onCurrentPageBoxClicked); -bookmarkPopup.hide(); -textSearchPopup.hide(); -enableNextButton(false); -enablePrevButton(false); - ``` {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/mobile-toolbar.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/mobile-toolbar.md index 4d095af2bb..b918d51890 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/mobile-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar-customization/mobile-toolbar.md @@ -74,23 +74,6 @@ ej.pdfviewer.PdfViewer.Inject( pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - enableDesktopMode : true -}); - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer -); - -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} @@ -115,24 +98,6 @@ ej.pdfviewer.PdfViewer.Inject( pdfviewer.appendTo('#PdfViewer'); -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - enableDesktopMode : true, - enableTextSelection : false -}); - -ej.pdfviewer.PdfViewer.Inject( - ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, - ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, - ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer -); - -pdfviewer.appendTo('#PdfViewer'); - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar.md index 4735ac0ede..9109bf2ac8 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/toolbar.md @@ -62,9 +62,6 @@ The PDF Viewer has an option to show or hide the complete default toolbar. You c {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, add the following `serviceUrl` in the `index.html` file: -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-toolbar/toolbar-hide-cs1" %} * **Show/Hide toolbar using showToolbar as in the following code snippet** @@ -75,10 +72,6 @@ N> To set up the **server-backed PDF Viewer**, add the following `serviceUrl` in {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-toolbar/toolbar-method-cs1" %} ## Show/Hide the default toolbaritem @@ -93,10 +86,6 @@ The PDF Viewer has an option to show or hide these grouped items in the default {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-toolbar/toolbar-items-cs1" %} * **Show/Hide toolbaritem using showToolbaritem as in the following code snippet** @@ -107,10 +96,6 @@ Add the below `serviceUrl` in the `index.html` file {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, -Add the below `serviceUrl` in the `index.html` file -`serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'` - {% previewsample "/document-processing/code-snippet/pdfviewer/javascript-es5/es5-toolbar/toolbar-items-method-cs1" %} ## Customize Built-In Toolbar @@ -173,57 +158,6 @@ function OnCreateSearch() { this.addIcon('prepend', 'e-icons e-search'); } -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} - -var toolItem1 = { - prefixIcon: 'e-icons e-paste', - id: 'print', - tooltipText: 'Custom toolbar item', -}; -var toolItem2 = { - id: 'download', - text: 'Save', - tooltipText: 'Custom toolbar item', - align: 'right' -}; -var LanguageList = ['Typescript', 'Javascript', 'Angular', 'C#', 'C', 'Python']; -var toolItem3 = { - type: 'Input', - tooltipText: 'Language List', - cssClass: 'percentage', - align: 'Left', - id: 'dropdown', - template: new ej.dropdowns.ComboBox({ width: 100, value: 'TypeScript', dataSource: LanguageList, popupWidth: 85, showClearButton: false, readonly: false }) -}; -var toolItem4 = { - type: 'Input', - tooltipText: 'Text', - align: 'Right', - cssClass: 'find', - id: 'textbox', - template: new ej.inputs.TextBox({ width: 125, placeholder: 'Type Here', created: OnCreateSearch }) -} -var pdfviewer = new ej.pdfviewer.PdfViewer({ - documentPath:'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer', - toolbarSettings : { toolbarItems: [toolItem1, toolItem2, 'OpenOption', 'PageNavigationTool', 'MagnificationTool', toolItem3, 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption', 'UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', toolItem4, 'CommentTool', 'SubmitForm'] } - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar,ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields); - -//PDF Viewer control rendering starts -pdfviewer.appendTo('#PdfViewer'); -pdfviewer.toolbarClick = function (args) { - if (args.item && args.item.id === 'print') { - pdfviewer.printModule.print(); - } else if (args.item && args.item.id === 'download') { - pdfviewer.download(); - } -}; -function OnCreateSearch() { - this.addIcon('prepend', 'e-icons e-search'); -} - {% endhighlight %} {% endtabs %} @@ -328,18 +262,6 @@ ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearc pdfviewer.appendTo('#PdfViewer'); ``` {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -```javascript -var pdfviewer = new ej.pdfviewer.PdfViewer({ - enableToolbar: false, - enableThumbnail: false, - documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' - }); -ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation,ej.pdfviewer.Print); -pdfviewer.appendTo('#PdfViewer'); -``` -{% endhighlight %} {% endtabs %} **Step 4:** Add EJ2 Toolbar for perform primary actions like Open, Previous page, Next page, Go to page,Print and Download using the following code snippet, @@ -892,356 +814,6 @@ this.default = function () { enablePrevButton(false); }; -``` -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -```javascript - -var inputTemplate = '
    '; -var totalPageNum = '
    of 0
    '; -var isBookmarkOpen = false; -var isBookmarkClick = false; -var isTextSearchBoxOpen = false; -var bookmarkPopup; -var textSearchPopup; -var toolbarObj; -var viewer; -var currentPageBox; -var searchInput; -var searchButton; -var openDocument; -var matchCase = false; -var fileInputElement; -var filename; - -function previousClicked(args) { - hidePopups(); - viewer.navigation.goToPreviousPage(); -} -function hidePopups() { - isBookmarkOpen = false; - isTextSearchBoxOpen = false; - bookmarkPopup.hide(); - textSearchPopup.hide(); -} -function bookmarkClicked() { - textSearchPopup.hide(); - if (!isBookmarkOpen) { - var bookmarkDetails = viewer.bookmark.getBookmarks(); - if (bookmarkDetails.bookmarks) { - var bookmarks = bookmarkDetails.bookmarks.bookMark; - var treeObj = new ej.navigations.TreeView({ - fields: { - dataSource: bookmarks, - id: 'Id', - parentID: 'Pid', - text: 'Title', - hasChildren: 'HasChild', - }, nodeSelected: nodeClick - }); - treeObj.appendTo('#bookmarkview'); - bookmarkPopup.show(); - isBookmarkOpen = true; - isBookmarkClick = true; - } - else { - toolbarObj.enableItems(document.getElementById('bookmarkButton'), false); - isBookmarkOpen = false; - } - } - else { - if (!isBookmarkClick) { - bookmarkPopup.show(); - isBookmarkClick = true; - } else { - bookmarkPopup.hide(); - isBookmarkClick = false; - } - } -} -function nextClicked(args) { - hidePopups(); - viewer.navigation.goToNextPage(); -} -function searchClicked(args) { - bookmarkPopup.hide(); - if (!isTextSearchBoxOpen) { - textSearchPopup.show(); - } - else { - viewer.textSearch.cancelTextSearch(); - textSearchPopup.hide(); - } - isTextSearchBoxOpen = !isTextSearchBoxOpen; -} -function printClicked(args) { - hidePopups(); - viewer.print.print(); -} -function downloadClicked(args) { - hidePopups(); - viewer.download(); -} -function pageFitClicked(args) { - hidePopups(); - viewer.magnification.fitToPage(); - updateZoomButtons(); - toolbarObj.enableItems(document.getElementById('fitPage'), false); -} -function zoomInClicked(args) { - hidePopups(); - viewer.magnification.zoomIn(); - updateZoomButtons(); -} -function zoomOutClicked(args) { - hidePopups(); - viewer.magnification.zoomOut(); - updateZoomButtons(); -} - -function readFile(args) { - // tslint:disable-next-line - var upoadedFiles = args.target.files; - if (args.target.files[0] !== null) { - var uploadedFile = upoadedFiles[0]; - filename = upoadedFiles[0].name; - if (uploadedFile) { - var reader = new FileReader(); - reader.readAsDataURL(uploadedFile); - // tslint:disable-next-line - reader.onload = function (e) { - var uploadedFileUrl = e.currentTarget.result; - viewer.load(uploadedFileUrl, null); - currentPageBox.value = '1'; - document.getElementById("bookmarkview").innerHTML = ""; - isBookmarkOpen = false; - viewer.fileName = filename; - }; - } - } -} - -function openClicked() { - document.getElementById('fileUpload').click(); -} -function onCurrentPageBoxKeypress(event) { - if ((event.which < 48 || event.which > 57) && event.which !== 8 && event.which !== 13) { - event.preventDefault(); - return false; - } - else { - var currentPageNumber = parseInt(currentPageBox.value); - if (event.which === 13) { - if (currentPageNumber > 0 && currentPageNumber <= viewer.pageCount) { - viewer.navigation.goToPage(currentPageNumber); - } - else { - currentPageBox.value = viewer.currentPageNumber.toString(); - } - } - return true; - } -} -function onCurrentPageBoxClicked() { - currentPageBox.select(); - currentPageBox.focus(); -} -function updatePageNavigation() { - if (viewer.currentPageNumber === 1) { - toolbarObj.enableItems(document.getElementById('previousPage'), false); - toolbarObj.enableItems(document.getElementById('nextPage'), true); - } - else if (viewer.currentPageNumber === viewer.pageCount) { - toolbarObj.enableItems(document.getElementById('previousPage'), true); - toolbarObj.enableItems(document.getElementById('nextPage'), false); - } - else { - toolbarObj.enableItems(document.getElementById('previousPage'), true); - toolbarObj.enableItems(document.getElementById('nextPage'), true); - } -} -function updateZoomButtons() { - if (viewer.zoomPercentage <= 50) { - toolbarObj.enableItems(document.getElementById('zoomIn'), true); - toolbarObj.enableItems(document.getElementById('zoomOut'), false); - toolbarObj.enableItems(document.getElementById('fitPage'), true); - } - else if (viewer.zoomPercentage >= 400) { - toolbarObj.enableItems(document.getElementById('zoomIn'), false); - toolbarObj.enableItems(document.getElementById('zoomOut'), true); - toolbarObj.enableItems(document.getElementById('fitPage'), true); - } - else { - toolbarObj.enableItems(document.getElementById('zoomIn'), true); - toolbarObj.enableItems(document.getElementById('zoomOut'), true); - toolbarObj.enableItems(document.getElementById('fitPage'), true); - } -} -function nodeClick(args) { - var bookmarksDetails = viewer.bookmark.getBookmarks(); - var bookmarksDestination = bookmarksDetails.bookmarksDestination; - var bookid = Number(args.nodeData.id); - var pageIndex = bookmarksDestination.bookMarkDestination[bookid].PageIndex; - var Y = bookmarksDestination.bookMarkDestination[bookid].Y; - viewer.bookmark.goToBookmark(pageIndex, Y); - return false; -} -function searchInputKeypressed(event) { - enablePrevButton(true); - enableNextButton(true); - if (event.which === 13) { - initiateTextSearch(); - updateSearchInputIcon(false); - } -} -function searchClickHandler() { - if (searchButton.classList.contains('e-pv-search-icon')) { - viewer.textSearch.cancelTextSearch(); - initiateTextSearch(); - } - else if (searchButton.classList.contains('e-pv-search-close')) { - searchInput.value = ''; - searchInput.focus(); - viewer.textSearch.cancelTextSearch(); - } -} -function initiateTextSearch() { - var searchString = searchInput.value; - viewer.textSearch.searchText(searchString, matchCase); -} -function previousSearchClicked() { - var searchString = searchInput.value; - if (searchString) { - viewer.textSearch.searchPrevious(); - } -} -function nextSearchClicked() { - var searchString = searchInput.value; - if (searchString) { - viewer.textSearch.searchNext(); - } -} -function checkBoxChanged(args) { - if (args.checked) { - matchCase = true; - } - else { - matchCase = false; - } - initiateTextSearch(); -} -function enablePrevButton(isEnable) { - var previousSearchButton = document.getElementById('previousSearch'); - if (isEnable) { - previousSearchButton.removeAttribute('disabled'); - } - else { - previousSearchButton.disabled = true; - } -} -function enableNextButton(isEnable) { - var nextSearchButton = document.getElementById('nextSearch'); - if (isEnable) { - nextSearchButton.removeAttribute('disabled'); - } - else { - nextSearchButton.disabled = true; - } -} -function updateSearchInputIcon(isEnable) { - if (isEnable) { - searchButton.classList.remove('e-pv-search-close'); - searchButton.classList.add('e-pv-search-icon'); - } - else { - searchButton.classList.remove('e-pv-search-icon'); - searchButton.classList.add('e-pv-search-close'); - } -} -this.default = function () { - toolbarObj = new ej.navigations.Toolbar({ - items: [ - { prefixIcon: 'e-pv-open-document', tooltipText: 'Open', id: 'openButton', click: openClicked }, - { prefixIcon: 'e-pv-bookmark-icon', tooltipText: 'Bookmark', id: 'bookmarkButton', click: bookmarkClicked }, - { prefixIcon: 'e-pv-previous-page-navigation-icon', id: 'previousPage', tooltipText: 'Previous Page', align: 'Center', click: previousClicked.bind(this) }, - { prefixIcon: 'e-pv-next-page-navigation-icon', id: 'nextPage', tooltipText: 'Next Page', align: 'Center', click: nextClicked.bind(this) }, - { template: inputTemplate, tooltipText: 'Page Number', align: 'Center' }, - { template: totalPageNum, tooltipText: 'Page Number', align: 'Center' }, - { prefixIcon: 'e-pv-search-icon', tooltipText: 'Text Search', align: 'Right', click: searchClicked.bind(this) }, - { prefixIcon: 'e-pv-print-document-icon', tooltipText: 'Print', align: 'Right', click: printClicked.bind(this) }, - { prefixIcon: 'e-pv-download-document-icon', tooltipText: 'Download', align: 'Right', click: downloadClicked.bind(this) } - ] - }); - toolbarObj.appendTo('#topToolbar'); - var magnificationToolbar = new ej.navigations.Toolbar({ - items: [ - { prefixIcon: 'e-pv-fit-page-icon', id: 'fitPage', tooltipText: 'Fit to page', click: pageFitClicked.bind(this) }, - { prefixIcon: 'e-pv-zoom-in-icon', id: 'zoomIn', tooltipText: 'Zoom in', click: zoomInClicked.bind(this) }, - { prefixIcon: 'e-pv-zoom-out-icon' , id: 'zoomOut', tooltipText: 'Zoom out', click: zoomOutClicked.bind(this) }, - ] - }); - magnificationToolbar.appendTo('#magnificationToolbar'); - viewer = new ej.pdfviewer.PdfViewer({ - enableToolbar: true, - enableThumbnail: true, - documentPath: 'https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf', - serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' - }); - ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.LinkAnnotation,ej.pdfviewer.ThumbnailView, ej.pdfviewer.BookmarkView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Navigation, ej.pdfviewer.Print); - viewer.appendTo('#pdfViewer'); - document.getElementById('fileUpload').addEventListener('change', readFile, false); - currentPageBox = document.getElementById('currentPage'); - currentPageBox.value = '1'; - searchInput = document.getElementById('searchInput'); - openDocument = document.getElementById('fileupload'); - bookmarkPopup = new ej.popups.Dialog({ - showCloseIcon: true, header: "Bookmarks", closeOnEscape: false, isModal: false, target: document.getElementById('pdfViewer'), - content: '
    ', - buttons: [{ - buttonModel: {}, - }], position: { X: 'left', Y: 'top' }, cssClass: 'e-bookmark-popup', beforeClose: function () { - isBookmarkOpen = false; - } - }); - bookmarkPopup.appendTo('#popup'); - textSearchPopup = new ej.popups.Dialog({ - showCloseIcon: false, closeOnEscape: false, isModal: false, target: document.getElementById('pdfViewer'), - buttons: [{ - buttonModel: {}, - }], position: { X: 'right', Y: 'top' }, cssClass: 'e-text-search-popup', - }); - textSearchPopup.appendTo('#textSearchBox'); - var previousSearch = new ej.buttons.Button({ iconCss: 'e-pv-previous-search' }); - previousSearch.appendTo('#previousSearch'); - var nextSearch = new ej.buttons.Button({ iconCss: 'e-pv-next-search-btn' }); - nextSearch.appendTo('#nextSearch'); - var matchCaseCheck = new ej.buttons.CheckBox({ label: 'Match case', change: checkBoxChanged }); - matchCaseCheck.appendTo('#matchCase'); - viewer.pageChange = function (args) { - currentPageBox.value = viewer.currentPageNumber.toString(); - updatePageNavigation(); - }; - viewer.documentLoad = function (args) { - - document.getElementById('totalPage').textContent = 'of ' + viewer.pageCount; - updatePageNavigation(); - }; - searchButton = document.getElementById('searchBtn'); - searchInput.addEventListener('focus', function () { searchInput.parentElement.classList.add('e-input-focus'); }); - searchInput.addEventListener('blur', function () { searchInput.parentElement.classList.remove('e-input-focus'); }); - searchInput.addEventListener('keypress', searchInputKeypressed); - document.getElementById('previousSearch').addEventListener('click', previousSearchClicked); - document.getElementById('nextSearch').addEventListener('click', nextSearchClicked); - searchButton.addEventListener('click', searchClickHandler); - currentPageBox.addEventListener('keypress', onCurrentPageBoxKeypress); - currentPageBox.addEventListener('click', onCurrentPageBoxClicked); - bookmarkPopup.hide(); - textSearchPopup.hide(); - enableNextButton(false); - enablePrevButton(false); -}; - ``` {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es5/troubleshooting/document-loading-issues.md b/Document-Processing/PDF/PDF-Viewer/javascript-es5/troubleshooting/document-loading-issues.md index add9414fc5..d6c26a964f 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es5/troubleshooting/document-loading-issues.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es5/troubleshooting/document-loading-issues.md @@ -15,7 +15,7 @@ If a document does not render in the viewer when using version 23.1 or newer, fo ```javascript var viewer = new ej.pdfviewer.PdfViewer ({ -serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer'}); +resourceUrl: "https://cdn.syncfusion.com/ej2/33.2.13/dist/ej2-pdfviewer-lib"}); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.BookmarkView, ej.pdfviewer.ThumbnailView, ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.LinkAnnotation, ej.pdfviewer.Annotation, ej.pdfviewer.FormFields, ej.pdfviewer.FormDesigner); diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/configure-annotationselector-setting-ts.md b/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/configure-annotationselector-setting-ts.md index 6ffb38b864..1539a00917 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/configure-annotationselector-setting-ts.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/configure-annotationselector-setting-ts.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Configure annotation selector settings +# Configure annotation selector settings in TypeScript Use the [annotationSelectorSettings](https://ej2.syncfusion.com/documentation/api/pdfviewer/annotationSelectorSettings/) property to customize the appearance and behavior of the annotation selector in the UI. diff --git a/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-ts.md b/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-ts.md index 2da9466f35..e191448e03 100644 --- a/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-ts.md +++ b/Document-Processing/PDF/PDF-Viewer/javascript-es6/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds-ts.md @@ -1,6 +1,6 @@ --- layout: post -title: Convert PDF Library bounds to PDF Viewer bounds | Syncfusion +title: Convert PDF Library bounds to PDF Viewer bounds in TS | Syncfusion description: Learn how to convert PDF Library bounds into PDF Viewer bounds when exporting annotations, ensuring accurate placement in the TypeScript PDF Viewer. platform: document-processing control: PDF Viewer @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Convert PDF Library bounds to PDF Viewer bounds +# Convert PDF Library bounds to PDF Viewer bounds in TypeScript When exporting annotations from the PDF Library, convert the bounds values into the PDF Viewer format to ensure accurate placement. diff --git a/Document-Processing/PDF/PDF-Viewer/react/Localization/new-language.md b/Document-Processing/PDF/PDF-Viewer/react/Localization/new-language.md index 6390e9cdf3..55ce5e9571 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/Localization/new-language.md +++ b/Document-Processing/PDF/PDF-Viewer/react/Localization/new-language.md @@ -338,7 +338,6 @@ root.render(); ## Troubleshooting - **Overrides not applied?** Ensure the culture code matches in both `locale` and `L10n.load`. - **Some labels still English?** Add those keys to your `L10n.load` object. -- **Service issues?** Verify your `serviceUrl` endpoint. ## See also - [Default Language](./default-language) diff --git a/Document-Processing/PDF/PDF-Viewer/react/accessibility.md b/Document-Processing/PDF/PDF-Viewer/react/accessibility.md index bd111fd596..71a85baf7d 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/accessibility.md +++ b/Document-Processing/PDF/PDF-Viewer/react/accessibility.md @@ -165,70 +165,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import {PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function commandManager() { - keyboardCommand: [{ - name: 'customCopy', - gesture: { - pdfKeys: PdfKeys.G, - modifierKeys: ModifierKeys.Shift | ModifierKeys.Alt - } - }, - { - name: 'customPaste', - gesture: { - pdfKeys: PdfKeys.H, - modifierKeys: ModifierKeys.Shift | ModifierKeys.Alt - } - }, - { - name: 'customCut', - gesture: { - pdfKeys: PdfKeys.Z, - modifierKeys: ModifierKeys.Control - } - }, - { - name: 'customSelectAll', - gesture: { - pdfKeys: PdfKeys.E, - modifierKeys: ModifierKeys.Control - } - }, - ] - } - return (
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - commandManager = {commandManager} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/comments.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/comments.md index 2aba372619..eaecc265bf 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/comments.md +++ b/Document-Processing/PDF/PDF-Viewer/react/annotation/comments.md @@ -161,86 +161,6 @@ function App() { ); } -ReactDOM.createRoot(document.getElementById('sample')).render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} -import * as React from 'react'; -import * as ReactDOM from 'react-dom/client'; -import { - PdfViewerComponent, - Inject, - Toolbar, - Magnification, - Navigation, - Annotation, - LinkAnnotation, - ThumbnailView, - BookmarkView, - TextSelection, - TextSearch, - FormFields, - FormDesigner, - PageOrganizer -} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const addComment = () => { - const viewer = (document.getElementById('container')?.ej2_instances || [])[0]; - 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]); - } - }; - - const addReply = () => { - const viewer = (document.getElementById('container')?.ej2_instances || [])[0]; - 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]); - } - }; - - return ( -
    -
    - - -
    - - - -
    - ); -} - ReactDOM.createRoot(document.getElementById('sample')).render(); {% endraw %} {% endhighlight %} @@ -330,86 +250,6 @@ function App() { ); } -ReactDOM.createRoot(document.getElementById('sample')).render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} -import * as React from 'react'; -import * as ReactDOM from 'react-dom/client'; -import { - PdfViewerComponent, - Inject, - Toolbar, - Magnification, - Navigation, - Annotation, - LinkAnnotation, - ThumbnailView, - BookmarkView, - TextSelection, - TextSearch, - FormFields, - FormDesigner, - PageOrganizer -} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const editComment = () => { - const viewer = (document.getElementById('container')?.ej2_instances || [])[0]; - 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]); - } - }; - - const editReply = () => { - const viewer = (document.getElementById('container')?.ej2_instances || [])[0]; - 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]); - } - }; - - return ( -
    -
    - - -
    - - - -
    - ); -} - ReactDOM.createRoot(document.getElementById('sample')).render(); {% endraw %} {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/free-text-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/free-text-annotation.md deleted file mode 100644 index 47648690d2..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/free-text-annotation.md +++ /dev/null @@ -1,507 +0,0 @@ ---- -layout: post -title: Free text annotation in React PDF Viewer control | Syncfusion -description: Learn about free text annotations in the Syncfusion React PDF Viewer (Essential JS 2): add, edit, delete, and default settings. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Free text annotation in React PDF Viewer component - -The PDF Viewer provides tools to add, edit, and remove free-text annotations. - -## Add a free-text annotation - -To add a free-text annotation: - -* Click the **Edit Annotation** button in the PDF Viewer toolbar to reveal the annotation toolbar. -* Select the **Free Text Annotation** button to enter free*text annotation mode. -* Tap or click anywhere on the page to add text. - -When the viewer is in pan mode, selecting the Free Text annotation switches the viewer to text-selection mode. - -![Free Text tool in the annotation toolbar](../images/freetext_tool.png) - -The example below shows switching to free-text annotation mode via a button click. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function freetextMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('FreeText'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function freetextMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('FreeText'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add a free-text annotation programmatically - -You can add a free-text annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#annotation) method. - -Example: add a free-text annotation using `addAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("FreeText", { - offset: { x: 100, y: 150 }, - fontSize: 16, - fontFamily: "Helvetica", - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - textAlignment : 'Center', - borderStyle : 'solid', - borderWidth : 2, - borderColor : 'red', - fillColor : 'blue', - fontColor: 'white', - defaultText: "Syncfusion" - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("FreeText", { - offset: { x: 100, y: 150 }, - fontSize: 16, - fontFamily: "Helvetica", - pageNumber: 1, - width: 200, - height: 40, - isLock: false, - textAlignment : 'Center', - borderStyle : 'solid', - borderWidth : 2, - borderColor : 'red', - fillColor : 'blue', - fontColor: 'white', - defaultText: "Syncfusion" - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Change the content of an existing free-text annotation programmatically - -To update the content of an existing free-text annotation, use the `editAnnotation()` method. Example below demonstrates editing an annotation's bounds and text. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].subject === "Text Box") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].dynamicText = 'syncfusion'; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].subject === "Text Box") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].dynamicText = 'syncfusion'; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -N> The PDF Viewer does not edit original document text. You can add and modify free-text annotations only. - -## Edit free-text annotation properties - -Use the annotation toolbar to configure font family, size, style, font color, text alignment, fill color, stroke color, border thickness, and opacity. - -### Font family - -Choose a font from the Font Family tool. - -![Font family selection](../images/fontfamily.png) - -### Font size - -Select a size in the Font Size tool. - -![Font size selection](../images/fontsize.png) - -### Font color - -Pick a color from the Font Color palette. - -![Font color picker](../images/fontcolor.png) - -### Text alignment - -Set alignment using the Text Align tool. - -![Text alignment options](../images/textalign.png) - -### Text styles - -Toggle styles in the Font Style tool. - -![Text style options](../images/fontstyle.png) - -### Fill color - -Set the annotation's fill color with the Edit Color tool. - -![Fill color picker](../images/fillcolor.png) - -### Stroke color - -Set the stroke color with the Edit Stroke Color tool. - -![Stroke color picker](../images/fontstroke.png) - -### Thickness - -Adjust border thickness with the Edit Thickness slider. - -![Border thickness slider](../images/fontthickness.png) - -### Opacity - -Adjust opacity with the Edit Opacity slider. - -![Opacity slider](../images/fontopacity.png) - -## Set default properties during control initialization - -Set default properties for free-text annotations using `freeTextSettings` when initializing the control. The selected defaults are applied when annotations are created. The example below sets default values. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - freeTextSettings={{fillColor: 'green', borderColor: 'blue', fontColor: 'yellow'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - freeTextSettings={{fillColor: 'green', borderColor: 'blue', fontColor: 'yellow'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -You can also enable the autofit support for free text annotation by using the enableAutoFit boolean property in freeTextSettings as below. The width of the free text rectangle box will be increased based on the text added to it. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - freeTextSettings={{enableAutoFit: true}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - freeTextSettings={{enableAutoFit: true}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/ink-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/ink-annotation.md deleted file mode 100644 index a29c7840a7..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/ink-annotation.md +++ /dev/null @@ -1,396 +0,0 @@ ---- -layout: post -title: Ink annotation in React PDF Viewer control | Syncfusion -description: Learn about ink annotations in the Syncfusion React PDF Viewer (Essential JS 2): add, edit, delete, and default settings. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Ink annotation in React PDF Viewer - -The PDF Viewer control provides options to add, edit, and delete ink annotations. - -![Ink annotations overview](../images/ink_annotation.png) - -## Add an ink annotation to the PDF document - -Ink annotations can be added to the PDF document using the annotation toolbar. - -* Use the **Edit Annotation** button in the PDF Viewer toolbar. The annotation toolbar appears below it. -* Select the **Draw Ink** button to enable ink annotation mode. -* Draw on any page of the PDF document to create an ink annotation. - - ![Ink tool in the annotation toolbar](../images/ink_tool.png) - -The following example switches the viewer to ink annotation mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function inkMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Ink'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); - -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function inkMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Ink'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); - -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add an ink annotation programmatically to the PDF document - -The PDF Viewer library allows adding an ink annotation programmatically using the [addAnnotation()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#annotation) method. - -The following examples demonstrate how to add an ink annotation programmatically using `addAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Ink", { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width: 200, - height: 60, - 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}]' - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Ink", { - offset: { x: 150, y: 100 }, - pageNumber: 1, - width: 200, - height: 60, - 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}]' - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit an existing ink annotation programmatically - -Use the `editAnnotation()` method to modify an existing ink annotation programmatically. - -The following example demonstrates `editAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "Ink") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "Ink") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit the properties of ink annotations - -Stroke color, thickness, and opacity can be edited using the Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar. - -### Edit stroke color - -Change the stroke color using the color palette in the Edit Stroke Color tool. - -![Change ink stroke color](../images/ink_strokecolor.png) - -### Edit thickness - -Change the stroke thickness using the range slider in the Edit Thickness tool. - -![Change ink thickness](../images/ink_thickness.png) - -### Edit opacity - -Change the opacity using the range slider in the Edit Opacity tool. - -![Change ink opacity](../images/ink_opacity.png) - -## Set default properties during the control initialization - -Default properties for ink annotations can be set before creating the control by using the `inkAnnotationSettings` property on `PdfViewerComponent` (example below). - -Supported settings include `author`, `strokeColor`, `thickness`, and `opacity`. Set these values on initialization so the viewer uses them when creating new ink annotations. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - inkAnnotationSettings={{author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6}} - style={{ 'height': '640px' }}> - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - inkAnnotationSettings={{author: 'Syncfusion', strokeColor: 'green', thickness: 3, opacity: 0.6}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/measurement-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/measurement-annotation.md deleted file mode 100644 index 38876bd4de..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/measurement-annotation.md +++ /dev/null @@ -1,673 +0,0 @@ ---- -layout: post -title: Measurement annotation in React PDF Viewer control | Syncfusion -description: Learn about measurement annotations in the Syncfusion React PDF Viewer (Essential JS 2): distance, perimeter, area, radius, and volume. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Measurement annotation in React PDF Viewer - -The PDF Viewer supports measurement annotations for capturing distances, perimeters, areas, radius, and volumes. - -Supported measurement annotations: - -* Distance -* Perimeter -* Area -* Radius -* Volume - -![Measurement annotations overview](../images/calibrate_annotation.png) - -## Add measurement annotations - -Measurement annotations are available from the annotation toolbar. - -* Open the annotation toolbar using the **Edit Annotation** button in the PDF Viewer toolbar. -* Use the **Measurement Annotation** drop-down to choose a measurement type. -* Select a measurement type to enable its annotation mode, then place the measurement on the page. - -If the viewer is in pan mode, selecting a measurement annotation activates text selection mode where applicable. - -![CalibrateTool](../images/calibrate_tool.png) - -The following example switches the viewer to distance annotation mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function distanceMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Distance'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function distanceMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Distance'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add a measurement annotation to the PDF document programmatically - -The PDF Viewer library allows adding measurement annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#annotation) method. - -The following examples demonstrate how to add measurement annotations programmatically using `addAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addDistanceAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Distance", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); - } - function addPerimeterAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Perimeter", { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 350 }, { x: 285, y: 350 }, { x: 286, y: 412 }] - }); - } - function addAreaAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Area", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - }); - } - function addRadiusAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Radius", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - }); - } - function addVolumeAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Volume", { - offset: { x: 200, y: 810 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 810 }, { x: 200, y: 919 }, { x: 320, y: 919 }, { x: 320, y: 809 }, { x: 200, y: 810 }] - }); - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addDistanceAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Distance", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); - } - function addPerimeterAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Perimeter", { - offset: { x: 200, y: 350 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 350 }, { x: 285, y: 350 }, { x: 286, y: 412 }] - }); - } - function addAreaAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Area", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - }); - } - function addRadiusAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Radius", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - }); - } - function addVolumeAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Volume", { - offset: { x: 200, y: 810 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 810 }, { x: 200, y: 919 }, { x: 320, y: 919 }, { x: 320, y: 809 }, { x: 200, y: 810 }] - }); - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit an existing measurement annotation programmatically - -Use the `editAnnotation()` method to modify existing measurement annotations programmatically. - -The following example demonstrates `editAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editDistanceAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Distance calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editPerimeterAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Perimeter calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editAreaAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Area calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editRadiusAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Radius calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editVolumeAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Volume calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editDistanceAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Distance calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editPerimeterAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Perimeter calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editAreaAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Area calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editRadiusAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Radius calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editVolumeAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Volume calculation") { - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit properties of measurement annotations - -Change fill color, stroke color, thickness, and opacity using the annotation toolbar tools: Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity. - -### Edit fill color - -Change the fill color with the color palette in the Edit Color tool. - -![CalibrateFillColor](../images/calibrate_fillcolor.png) - -### Edit stroke color - -Change the stroke color with the Edit Stroke Color tool. - -![CalibrateStrokeColor](../images/calibrate_stroke.png) - -### Edit thickness - -Adjust border thickness with the range slider in the Edit Thickness tool. - -![CalibrateThickness](../images/calibrate_thickness.png) - -### Edit opacity - -Adjust annotation opacity with the range slider in the Edit Opacity tool. - -![CalibrateOpacity](../images/calibrate_opacity.png) - -### Edit line properties - -Line-based measurement annotations (distance and perimeter) include additional options in the Line Properties window. Open it by right-clicking the annotation and choosing Properties. - -![CalibrateProperty](../images/calibrate_lineprop.png) - -## Set default properties during initialization - -Default properties for measurement annotations can be configured on the viewer before creation using the `distanceSettings`, `perimeterSettings`, `areaSettings`, `radiusSettings`, and `volumeSettings` properties. - -The following code snippet shows how to set default measurement annotation settings on initialization. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -export function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - distanceSettings={{fillColor: 'blue', opacity: 0.6, strokeColor: 'green'}} - perimeterSettings={{fillColor: 'green', opacity: 0.6, strokeColor: 'blue'}} - areaSettings={{fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'}} - radiusSettings={{fillColor: 'orange', opacity: 0.6, strokeColor: 'pink'}} - volumeSettings={{fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -export function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - distanceSettings={{fillColor: 'blue', opacity: 0.6, strokeColor: 'green'}} - perimeterSettings={{fillColor: 'green', opacity: 0.6, strokeColor: 'blue'}} - areaSettings={{fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'}} - radiusSettings={{fillColor: 'orange', opacity: 0.6, strokeColor: 'pink'}} - volumeSettings={{fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Scale ratio and measurement units - -Modify the scale ratio and measurement unit via the Scale Ratio option in the viewer's context menu. - -![CalibrateScaleRatio](../images/calibrate_scaleratio.png) - -Supported units for measurement annotations: - -* Inch -* Millimeter -* Centimeter -* Point -* Pica -* Feet - -![CalibrateScaleDialog](../images/calibrate_scaledialog.png) - -## Set default scale ratio during initialization - -Configure scale ratio defaults using `measurementSettings` (for example, `scaleRatio`, `conversionUnit`, and `displayUnit`) before creating the viewer. The following snippet demonstrates these settings. -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - measurementSettings={{scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - measurementSettings={{scaleRatio: 2, conversionUnit: 'cm', displayUnit: 'cm'}} - style={{ 'height': '640px' }}> - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/shape-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/shape-annotation.md deleted file mode 100644 index eee775acdc..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/shape-annotation.md +++ /dev/null @@ -1,621 +0,0 @@ ---- -layout: post -title: Shape annotation in React PDF Viewer control | Syncfusion -description: Learn about shape annotations in the Syncfusion React PDF Viewer (Essential JS 2), including add, edit, delete, and default settings. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Shape annotation in React PDF Viewer - -The PDF Viewer provides tools to add, edit, and delete shape annotations. Supported shape types: - -* Line -* Arrow -* Rectangle -* Circle -* Polygon - -![Shape annotations overview](../images/shape_annot.png) - -## Add a shape annotation - -Shape annotations are available from the annotation toolbar. - -- Open the annotation toolbar with the **Edit Annotation** button in the PDF Viewer toolbar. -- Use the **Shape Annotation** drop-down to choose the desired shape type. -- Select a shape type to enable its annotation mode, then draw the shape on the page. - -N> When the viewer is in pan mode and a shape tool is selected, the viewer switches to text selection mode where applicable to ensure a smooth interaction. - -![Shape annotation toolbar](../images/shape_toolbar.png) - -The following sample shows how to switch the viewer to circle annotation mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function circleMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Circle'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function circleMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Circle'); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add a shape annotation to the PDF document programmatically - -The PDF Viewer library allows adding shape annotations programmatically using the [addAnnotation()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#annotation) method. - -The following examples show how to add shape annotations programmatically using `addAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addLineAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Line", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); - } - function addArrowAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Arrow", { - offset: { x: 200, y: 370 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 370 }, { x: 350, y: 370 }] - }); - } - function addRectangleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Rectangle", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - }); - } - function addCircleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Circle", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - }); - } - function addPolygonAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Polygon", { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 }] - }); - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addLineAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Line", { - offset: { x: 200, y: 230 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 230 }, { x: 350, y: 230 }] - }); - } - function addArrowAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Arrow", { - offset: { x: 200, y: 370 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 370 }, { x: 350, y: 370 }] - }); - } - function addRectangleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Rectangle", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 500 }, { x: 288, y: 499 }, { x: 289, y: 553 }, { x: 200, y: 500 }] - }); - } - function addCircleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Circle", { - offset: { x: 200, y: 630 }, - pageNumber: 1, - width: 90, - height: 90 - }); - } - function addPolygonAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Polygon", { - offset: { x: 200, y: 800 }, - pageNumber: 1, - vertexPoints: [{ x: 200, y: 800 }, { x: 242, y: 771 }, { x: 289, y: 799 }, { x: 278, y: 842 }, { x: 211, y: 842 }, { x: 200, y: 800 }] - }); - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit an existing shape annotation programmatically - -Use the `editAnnotation()` method to modify existing shape annotations programmatically. - -The following example demonstrates `editAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editLineAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Line") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editArrowAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Arrow") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editRectangleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Rectangle") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editCircleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Circle") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editPolygonAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Polygon") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editLineAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Line") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editArrowAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Arrow") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editRectangleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Rectangle") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editCircleAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Circle") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - function editPolygonAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].subject === "Polygon") { - viewer.annotationCollection[i].strokeColor = "#0000FF"; - viewer.annotationCollection[i].thickness = 2 ; - viewer.annotationCollection[i].fillColor = "#FFFF00"; - viewer.annotationCollection[i].annotationSelectorSettings.resizerShape = "Circle" - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Editing the properties of the shape annotation - -## Edit properties of shape annotations - -Change fill color, stroke color, thickness, and opacity using the Edit Color, Edit Stroke Color, Edit Thickness, and Edit Opacity tools in the annotation toolbar. - -### Edit fill color - -Change the fill color using the color palette in the Edit Color tool. - -![Edit fill color for shapes](../images/shape_fillColor.png) - -### Edit stroke color - -Change the stroke color using the Edit Stroke Color tool. - -![Edit stroke color for shapes](../images/shape_strokecolor.png) - -### Edit thickness - -Adjust border thickness using the Edit Thickness range slider. - -![Edit thickness for shapes](../images/shape_thickness.png) - -### Edit opacity - -Adjust opacity using the Edit Opacity range slider. - -![Edit opacity for shapes](../images/shape_opacity.png) - -### Line properties - -Line and arrow annotations include additional options in the Line Properties dialog. Open it by right-clicking a line or arrow annotation and choosing Properties. - -![Line properties dialog](../images/shape_lineproperty.png) - -### Edit annotation programmatically - -Modify annotations programmatically using the `editAnnotation()` method. The example below demonstrates selecting and editing an annotation. -``` - - - -``` -### Delete annotation programmatically - -Delete a specific annotation with `deleteAnnotationById()` by providing the annotation's id. The example below demonstrates usage. - -``` - - - -``` - -## Set default properties during initialization - -Default properties for shape annotations can be configured before creating the viewer using `lineSettings`, `arrowSettings`, `rectangleSettings`, `circleSettings`, and `polygonSettings`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - lineSettings={{fillColor: 'blue', opacity: 0.6, strokeColor: 'green'}} - arrowSettings={{fillColor: 'green', opacity: 0.6, strokeColor: 'blue'}} - rectangleSettings={{fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'}} - circleSettings={{fillColor: 'orange', opacity: 0.6, strokeColor: 'pink'}} - polygonSettings={{fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - lineSettings={{fillColor: 'blue', opacity: 0.6, strokeColor: 'green'}} - arrowSettings={{fillColor: 'green', opacity: 0.6, strokeColor: 'blue'}} - rectangleSettings={{fillColor: 'yellow', opacity: 0.6, strokeColor: 'orange'}} - circleSettings={{fillColor: 'orange', opacity: 0.6, strokeColor: 'pink'}} - polygonSettings={{fillColor: 'pink', opacity: 0.6, strokeColor: 'yellow'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -N> In both the Arrow and Line settings, the Fill Color option is available only when an arrowhead style is applied at the Start or End. If both Start and End arrowhead styles are set to `None`, lines do not support fill rendering and the Fill Color option is disabled. See Arrow settings and Line settings for API details. diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/signature-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/signature-annotation.md index 9cbc92d456..a0a2b5854c 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/signature-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/react/annotation/signature-annotation.md @@ -66,41 +66,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - function handWrittenSignature() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('HandWrittenSignature'); - } - return (
    - -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -180,77 +145,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject, DisplayMode } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Initial", { - offset: { x: 220, y: 180 }, - pageNumber: 1, - width: 150, - height: 60, - signatureItem: ['Initial'], - initialDialogSettings: { - 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}]' - }); - viewer.annotation.addAnnotation("Initial", { - offset: { x: 200, y: 310 }, - pageNumber: 1, - width: 200, - height: 65, - signatureItem: ['Initial'], - initialDialogSettings: { - displayMode: DisplayMode.Text, hideSaveSignature: false - }, - canSave: false, - path: 'Syncfusion', - fontFamily: "Helvetica", - }); - viewer.annotation.addAnnotation("HandWrittenSignature", { - offset: { x: 200, y: 500 }, - pageNumber: 1, - width: 200, - height: 80, - signatureItem: ['Signature'], - signatureDialogSettings: { - displayMode: DisplayMode.Upload, hideSaveSignature: false - }, - canSave: true, - path: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -516,39 +410,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom/client'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/stamp-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/stamp-annotation.md deleted file mode 100644 index e2640c0201..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/stamp-annotation.md +++ /dev/null @@ -1,471 +0,0 @@ ---- -layout: post -title: Stamp annotation in React Pdfviewer component | Syncfusion -description: Learn here all about Stamp annotation in Syncfusion React Pdfviewer component of Syncfusion Essential JS 2 and more. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Stamp annotation in React PDF Viewer - -The PDF Viewer provides options to add, edit, delete, and rotate the following stamp annotations: - -* Dynamic -* Sign Here -* Standard Business -* Custom Stamp - -![StampAnnotation](../images/stamp_annot.png) - -## Add stamp annotations to the PDF document - -Stamp annotations are added using the annotation toolbar. - -* Use the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. -* Use the **Stamp Annotation** drop-down to view available stamp annotation types. - - ![StampTool](../images/stamp_tool.png) - -* Selecting a stamp type enables its annotation mode. - - ![StampPopup](../images/selectstamp_annot.png) - -* Place the stamp on a page in the PDF document. - -N> When the viewer is in pan mode and a stamp annotation tool is selected, the PDF Viewer automatically switches to text select mode to provide a smoother interaction. - -The following examples show how to switch to stamp annotation modes. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject, SignStampItem, StandardBusinessStampItem, - DynamicStampItem, Inject} from '@syncfusion/ej2-react-pdfviewer'; -function App() { - function dynamicStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Stamp', DynamicStampItem.NotApproved); - } - function signStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Stamp', null, SignStampItem.Witness); - } - function standardBusinessStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Stamp', null, null, StandardBusinessStampItem.Approved,); - } - return (
    - - - -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject, SignStampItem, StandardBusinessStampItem, - DynamicStampItem, Inject} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - function dynamicStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Stamp', DynamicStampItem.NotApproved); - } - function signStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Stamp', null, SignStampItem.Witness); - } - function standardBusinessStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Stamp', null, null, StandardBusinessStampItem.Approved,); - } - return (
    - - - -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add a custom stamp - -Use the **Edit Annotation** button and the **Stamp Annotation** drop-down to access the Custom Stamp option. - -![CustomStamp](../images/customStamp.png) - -Select the Custom Stamp option, then choose an image file to add as a custom stamp on the PDF page. - -Only JPG and JPEG image formats are supported for custom stamp annotations. - -## Add a stamp annotation programmatically - -Use the [addAnnotation()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#annotation) method to add stamp annotations programmatically. - -The examples below demonstrate using `addAnnotation()` to create stamp annotations. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function dynamicStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 140 }, - pageNumber: 1 - }, 'Approved'); - } - function signStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 240 }, - pageNumber: 1 - }, undefined,'Witness'); - } - function standardBusinessStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 340 }, - pageNumber: 1 - }, undefined, undefined, 'Approved'); - } - function addCustomStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation('Stamp', - { - offset: { x: 100, y: 440 }, - width: 46, - author: 'Guest', - height: 100, - isLock: true, - pageNumber: 1, - customStamps: [ - { - customStampName: "Image", - customStampImageSource: - "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - } - ] - }); - } - return (
    - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function dynamicStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 140 }, - pageNumber: 1 - }, 'Approved'); - } - function signStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 240 }, - pageNumber: 1 - }, undefined,'Witness'); - } - function standardBusinessStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Stamp", { - offset: { x: 200, y: 340 }, - pageNumber: 1 - }, undefined, undefined, 'Approved'); - } - function addCustomStamp() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation('Stamp', - { - offset: { x: 100, y: 440 }, - width: 46, - author: 'Guest', - height: 100, - isLock: true, - pageNumber: 1, - customStamps: [ - { - customStampName: "Image", - customStampImageSource: - "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAIIAqwMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAv/EAEEQAAEDAwIEAwYDBAYLAAAAAAECAwQABREGIRIxQVETYXEHFCIygZEVQmIjUnKCJCUzU6HRFhc1c5KisbKzwvD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APcaUpQKUpQKUpQKUpQKUpQKVzXGdFtsN2ZPfbYjNJ4nHHDgJFfEK5Q5ttbuUaQhcNxvxUPcklPfflQdlYJxURpe/salthuMNpxEYvuNtKc28VKVcPGB2JB577Vyz7pNuUxy26eWlCml8Mu4OI4kR/0oB2Wvp2T17EJK43qDbloakOqL7m6I7TanHVjOMhCQTjzxgVut89i4Mqdj8Y4VlC0OIKFIUOYKTuOn0INRZZtWkrVLuDpIIHHJlPK4nX1dOJR5kk4A5DYDArVoWbHuVgTPjvF5Ul5xx5zhIBc4jkJyBlI+UHqE0FjpSlApSlApSlApSlApSlApSlApSlArClAczgVmqr7QZLptkezxHi1KvD4ihxKsFprBU6v6IB+pFBTdUKf1uUuFa0WpyUIVoYBx706chchXdKEhZSPLNXXVTsOw6NdjNxkvJS0iLEidHnDhLaPME4z5ZzVHk6kTHu1vTpyE1Jf8L3Oww1ZDaGc4XJXjklXDhP6UlWd63ybrL1rq1mNa1hLcAKEeQgcTbbvyuScHnw5KGweZJPIVRYoDT6okfSlnfWhmCwlu43FGAUKxu2j9atyT+UHvirZBixLZBaiQ2kR4zCMIQnZKRWuz2yLZ7czBgo4GWh13KidypR6qJJJPevOvaFqCXqC4HSGmzxlxQbmvJJAPXwwe2M8R9R3FQc1xde9qOqEW+C44jTFuVxPvtnHvCvI+e4HYZPavV4sdmLGajxmktMtJCENpGAkDkBUbpixRNO2dm3Q0/Cj4lrPNazzUf/uWKlkkEZByKDNKUoFKUoFKUoFKUoFKwahZ2p7dFfMZhTs+ZnHu0FHirB/VjZHqogUE3WOIYzUApzUlwBKUxLOwQCFL/bv467DCEn6qr5i6btk5ht+ZOlXlCxlLkiTxtr8whGG8fy0HdK1FZorymHbjH8dPNlC+NY/lTk1XNTe0m12SCXBFnrkOpX7uh6ItkKUBzPGEnhzjcA1bokKLAZS1BjMx20jAQy2EjHoK85i6PuOovaFNv+pWPDt8J/ggMKUCXktq+BX8HNXmT2G9HLF1trSyW2GrUFgbluT3eCIRIS26tS/iSjwgCcDl35Z3qBlSb/edVcN58e4tojKafiW2MfDQpRBXF8X5UnZPGsq5ZAr0TV2j52oL9Anx7wqCxHYWypLbeXAFH4lNqz8KiNs8x0qy2e1QrNbmYFuZDUdkYSkHOT1JPUk7k0HhsG6u3SHPeisLFwnucE95hOPdmc8DUNhR/OrCR5Ak9NvX9F6cRp20IZIR706AX1I5DA2Qn9KRsPvzJqGmXG0N6pfk3KTEhW2ykBsLKUh2Y4nKlY6lKCAOuVmuafry5T5rFs0vaHQ5JSVIm3FBaQhvq7wfNwjurAPnQZ9pms1WtlVmtDqRcnxwrdK+ERknqT0Vj7DftUN7OA1BilywWx65TnU8PjOAtMsJJzlbhBypXMhPFgADbrF6B0sNSagkzrk+5cbTDeUQ5IHwy3T+bHbYE/y9yK9sabQ02lDSAhCRhKUjAAoIaFaZ8gh++zg8vIKYsUFphB+/Ev8AmONuVTYGBgcqzSoFKUoFKUoFKUoFcV4mOW+2yJbEN6Y40gqTHYGVuHsK7awRmg8rd/1gameJn2n8Ptv5YQn+78f+8cSFLI57AJ8/Oy2eyalhxkRo79htEVI2YgQ1uEH+JSgD68NW/FQ2r7yqxWCTNZR4knZqM1/ePLPChP3IoKRc4l91FqJ3TkfUst2Aygfiz7TDTaEA8mkEAnjPXfAH2NohaPehR2Y8bVF9QwygNttJMcJSkDAAAZru0hY02CyMxFK8SWv9rMfPN55W6lE9d9vQCpughmrLNZVxI1Fc19kupYUn/wAYP+NdQVMjD+khEhsfM40nhUPMp3z9D9K76xQRN/uNxjWj3qwW9F0krKfDa8YISUn83F25VVocf2kXdR/EJlrskZQxiM14ryR5ZJA9c/SrHo973m2SFjPhCfKSzn9wPLCceXbyxUpPmRrdDemTHUMx2UFbjizgJAoPGrbpyJBRPvEi53STfhc34MRCVMrckLSvCT8aFEEjBUQdhUlfbHcrcItuYvc+VqbUBDcpf7PgDSfnJPBxBCQcDBGcnlUn7Om4kly+aonhbPBPkeGiRsIqCEqUcHkSMZ9K5bRqqMbjJ1E5FkTrndFe72m2sAF1MVBI4iD8iVKyoqO2w7VRbrJpRdkt7MGDe56GGhgJ8Njn1P8AZ9fPNd5gXNKQEXt0q7uRmz/0AqFja29znGFq2EmxuqaLzDrkhK2XUj5gF7YUNvhqsX+66nvtqlarsrsmDa7aUvQIqQULuCUqHiLdGPk4c8I686g9BMK8/lu7IxyzCB/9q4bpJkWeP7xd9TQojGeHjdipRk9hlW5/yrF21raoEGM/HcM+TMSDEhwyFuv55YA5DfcnYVx2fTD9wm/jeskMS7goYYhY42IKeyQeajtlR68tqCUjtXWVHakQL/FejupC23PcwsLSeoKVgEVsLWomsFMm1yAM5C2HGir6hSsfY1B6ILViuV50utSWkRpHvNvQTgGO6OLCe/CviB7bVMXjVMC2vCG0VTrk4MtQIeHHleZHJCf1KwKDTcNSqskB2XqSCYjTQ3fYcDzSj0SOSgSdhlP1r50FqherbM5cVQVQwmQtkNlfFxBON8/XB8wa4JNsfUzJ1Jq/wXFQWnH4tvbPEzFCUk8RyPjd2+bkOQ7nHs0iSLRY7dBkKUoy4gnYV8yHFEFxPoCtOPU+VBdaUpQKUpQKqF4H4xry027YxrYyq4yB3cPwND/vV9BVvNVTRf8ATrhqC9KIUJU4x2T2aZHAB/xcZ+tBa6UpQKr+r7lIjRWrdaz/AFrcleBF2z4W3xOq8kDf1wOtSV5ukSz216fOc4GGhk4GSo9EpHVROwHU1DaWtst2S9qG+N8Nzlp4WWSc+6R85S0P1dVHqfSgm7Rb2bTbItvjcXhR2g2kqOVKx1J6k8zVbfP+leoSxkGx2h7LxztJlD8h6FCOZ/VjtXdq25ymWY9ptSv61uSi2yr+4Rj43T5JHLzIrRfHIujtCy/dthFiqQyD8zrqhgZ7qUo/40FJsbL2q7W/YYchUdqdMlXC5SEDJQhbq/CbHTKuEEj90edXfRWi4Gk4yvAUqTMdADsp35ikckj91I7Vn2e6bTpnTUaG5hUtweLJcHVw9PQch6VZ6Dhudot12aQ1dIEWa2hXEhEllLgSe4Cga7OBPBwYHDjGMbYr6pQRNp03ZrM669arVChuu/OphkJJ8tunlUt0pSgjLxYLVew2LtAYleEctqcT8SPRXMfevq0WO12VtTdpgRoiVHKy02AVnuo8z9akaUEBr2O9L0beI8dtx1xyMpIQ2kqUodQANycZrk07JVeLyq4R2HmrZCiiJFW62UF9SilS1AHfhHAgA7b8XlVqIzWMb0GaUpQKUpQc9wkCJAkyVcmWlOH6AmoL2bsqZ0LZi4SXHowfcUeZU58ZP3VUpqNlcjT1zYaGVuRHUJA6koIFcuiZDcnR9lea+RcFkgdvgG1BN1omS48GM7JluoZYaSVuOLOEpSOZJrXdLjEtUF2bcJLceM0MrccOAP8AP0qqR4czWk1qfd2HItgZWFxLe6MLlKHJ14dE9kH1NBttDEjVVzYvtxaUza4547ZCdThSz0kLHQ4+UdAc86tcmQzDjOyJLiW2WUFxxxWwSkDJJ+lbQAOVVPU6vx29xdLsqPgBKZdzIG3ghWEtE9CtX/Kk0GzSTDlwekamnNlL08BMNCs5ZijdAweRVniPqB0qsarce1XrezWlghVsiTCp3B/tFtDicPok8CP4lq7VedSzXYFr8OBwpmyVCPEyPhStQPxEfupAKj5JNVz2eW9t2RIvLJWqGlsQbetXN1pCsuPerjmVZ6gCqLyBis0pUClKUClKUClKUClKUClKUClKUGCMjFVNqw36yeOxpmbb/wAPdcU43GntLPuqlHJCFJO6ckkJI2zzq20oKtE0iZE5q46mnKu8to8TLSmwiMwe6G99/wBSiTVoGwrNcV4uUez2yTcJiiGY7ZWrAyT2AHUk7D1oMXq6R7PapNxlk+FHQVkAZKj0SB1JOAPWozRtqfhW5ybcf9qXJz3qZk54FEbNg9kDCfoT1qGi++alvEGJdGwlq2hE+e0FApTKVu0we4Qk8R7nhNXkcqCs6q0zK1DcIWbkqNbW23ESmWk4ceCsZAV+UEAgnngnvViix2okZqPHbS2y0kIbQkYCUjYAVtpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKUpQKouv7mwi7W2HJBdZiJNxXHSd5DoUER2gOpU4rI/gq9VxO2i3PXRu6OwmFz2m/DbkKQCtKck4B+p+9BxaTtblqtQEvhM+UtUqatO4U8vdW/YbJHkkVNVgDFZoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP//Z" - } - ] - }); - } - return (
    - - - - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit an existing stamp annotation programmatically - -Use the `editAnnotation()` method to modify existing stamp annotations programmatically. - -The following example demonstrates `editAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].shapeAnnotationType === "stamp") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].annotationSettings.isLock = true; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) { - if (viewer.annotationCollection[i].shapeAnnotationType === "stamp") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = { x: 100, y: 100, width: width, height: height }; - viewer.annotationCollection[i].annotationSettings.isLock = true; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Set default properties during control initialization - -Set default properties for stamp annotations before creating the control by specifying `stampSettings`. - -After changing the default opacity using the Edit Opacity tool, the selected value is applied. The example below shows how to set default stamp annotation settings. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - stampSettings={{opacity: 0.3, author: 'Guest User'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - stampSettings={{opacity: 0.3, author: 'Guest User'}} - style={{ 'height': '640px' }}> - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/sticky-notes-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/sticky-notes-annotation.md deleted file mode 100644 index bdb8eb8c28..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/sticky-notes-annotation.md +++ /dev/null @@ -1,377 +0,0 @@ ---- -layout: post -title: Sticky notes in React PDF Viewer control | Syncfusion -description: Learn about sticky note annotations in the Syncfusion React PDF Viewer (Essential JS 2): add, edit, delete, and default settings. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Sticky notes annotation in React PDF Viewer - -The PDF Viewer provides options to add, edit, and delete sticky note annotations. - -![StickyNotesAnnotation](../images/stickynotes_annotation.png) - -## Add a sticky note annotation - -Annotation comments are added using the comment panel. - -* Right-click a sticky note annotation and choose **Comment** from the context menu. -* Use the comment panel to add comments, reply, and change status. - -![StickyNotesTool](../images/stickynotes_tool.png) - -![StickyNotesComment](../images/stickynotes_comment.png) - -## Add a sticky note annotation to the PDF document programmatically - -Use the [addAnnotation()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#annotation) method to add a sticky note annotation programmatically. - -The following example demonstrates using `addAnnotation()` to create a sticky note annotation. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("StickyNotes", { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("StickyNotes", { - offset: { x: 100, y: 200 }, - pageNumber: 1, - isLock: false - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit an existing sticky note annotation programmatically - -Use the `editAnnotation()` method to modify existing sticky note annotations programmatically. - -The following example demonstrates `editAnnotation()`. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "sticky") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function editAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - for (let i = 0; i < viewer.annotationCollection.length; i++) - { - if (viewer.annotationCollection[i].shapeAnnotationType === "sticky") { - var width = viewer.annotationCollection[i].bounds.width; - var height = viewer.annotationCollection[i].bounds.height; - viewer.annotationCollection[i].bounds = {x : 100, y: 100, width: width, height: height }; - viewer.annotation.editAnnotation(viewer.annotationCollection[i]); - } - } - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Edit the properties of sticky note annotations - -### Editing opacity - -Edit opacity using the range slider in the Edit Opacity tool. - -![StickyNotesOpacity](../images/sticky_opacity.png) - -### Editing comments - -Comment text, replies, and status can be edited using the comment panel. - -* Open the comment panel using the Comment Panel button in the annotation toolbar. - - ![StickyNotesComment](../images/commentPanel.png) - -Modify or delete comments or replies, and change status using the menu options in the comment panel. - - ![StickyNotesEdit](../images/sticky_editbtn.png) - -## Set default properties during control initialization - -Set default properties for sticky note annotations before creating the control by specifying `stickyNotesSettings`. - -After changing the default opacity using the Edit Opacity tool, the selected value is applied. The example below shows how to set default sticky note annotation settings. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - stickyNotesSettings={{author: 'Syncfusion'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - stickyNotesSettings={{author: 'Syncfusion'}} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Disable sticky note annotations - -The PDF Viewer control provides an option to disable sticky note annotations. The following example disables the feature. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - enableStickyNotesAnnotation={false} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - enableStickyNotesAnnotation={false} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/annotation/text-markup-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/annotation/text-markup-annotation.md deleted file mode 100644 index 7e9b0438e0..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/annotation/text-markup-annotation.md +++ /dev/null @@ -1,1427 +0,0 @@ ---- -layout: post -title: Text markup annotation in React PDF Viewer | Syncfusion -description: Learn to add, edit, delete, and customize text markup annotations like highlight, underline, and squiggly in Syncfusion React PDF Viewer. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Text markup annotation in React PDF Viewer - -The PDF Viewer provides options to add, edit, and delete text markup annotations, including Highlight, Underline, Strikethrough, and Squiggly. - -![Text markup annotation toolbar and examples](../images/text_markup_annotation.png) - -## Highlight text - -Two ways to add highlights: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Highlight** in the context menu. - - ![Highlight using context menu](../images/highlight_context.png) - -2. Using the annotation toolbar -* Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. -* Select **Highlight** to enable highlight mode. -* Select text to add the highlight annotation. -* Alternatively, select text first and then click **Highlight**. - - ![Highlight button in annotation toolbar](../images/highlight_button.png) - -When pan mode is active, entering any text markup mode switches the PDF Viewer to text selection mode. - -Refer to the following code snippet to switch to highlight mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function highlightMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Highlight'); - } - return ( -
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function highlightMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Highlight'); - } - return ( -
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -Refer to the following code snippet to switch back to normal mode from highlight mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function highlightMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Highlight'); - } - - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return (
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function highlightMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Highlight'); - } - - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return (
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Highlight text programmatically - -Programmatically add highlights using the [addAnnotation](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#addannotation) method. - -Example: - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Highlight", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Highlight", { - bounds: [{ x: 97, y: 110, width: 350, height: 14 }], - pageNumber: 1 - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Underline text - -Two ways to add underlines: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Underline** in the context menu. - - ![Underline using context menu](../images/underline_context.png) - -2. Using the annotation toolbar -* Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. -* Select **Underline** to enable underline mode. -* Select text to add the underline annotation. -* Alternatively, select text first and then click **Underline**. - - ![Underline button in annotation toolbar](../images/underline_button.png) - -When pan mode is active, entering underline mode switches the PDF Viewer to text selection mode to enable text selection for underlining. - -Refer to the following code snippet to switch to underline mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function underlineMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Underline'); - } - return (
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function underlineMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Underline'); - } - return (
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -Refer to the following code snippet to switch back to normal mode from underline mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function underlineMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Underline'); - } - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return (
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function underlineMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Underline'); - } - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return (
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Underline text programmatically - -Programmatically add underlines using the [addAnnotation](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#addannotation) method. - -Example: - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Underline", { - bounds: [{ x: 250, y: 148, width: 345, height: 14 }], - pageNumber: 2 - }) - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Underline", { - bounds: [{ x: 250, y: 148, width: 345, height: 14 }], - pageNumber: 2 - }) - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Strikethrough text - -Two ways to add strikethroughs: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Strikethrough** in the context menu. - - ![Strikethrough using context menu](../images/strikethrough_context.png) - -2. Using the annotation toolbar -* Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. -* Select **Strikethrough** to enable strikethrough mode. -* Select text to add the strikethrough annotation. -* Alternatively, select text first and then click **Strikethrough**. - - ![Strikethrough button in annotation toolbar](../images/strikethrough_button.png) - -When pan mode is active, entering strikethrough mode switches the PDF Viewer to text selection mode to enable text selection for striking through. - -Refer to the following code snippet to switch to strikethrough mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function strikethroughMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Strikethrough'); - } - return (
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function strikethroughMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Strikethrough'); - } - return (
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -Refer to the following code snippet to switch back to normal mode from strikethrough mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function strikethroughMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Strikethrough'); - } - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return ( -
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function strikethroughMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Strikethrough'); - } - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return ( -
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Strikethrough text programmatically - -Programmatically add strikethrough using the [addAnnotation](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#addannotation) method. - -Example: - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Strikethrough", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Strikethrough", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add squiggly to text - -Two ways to add squiggly annotations: - -1. Using the context menu -* Select text in the PDF document and right-click it. -* Select **Squiggly** in the context menu. - - ![Squiggly using context menu](../images/squiggly_context.png) - -2. Using the annotation toolbar -* Click the **Edit Annotation** button in the PDF Viewer toolbar to open the annotation toolbar. -* Select **Squiggly** to enable squiggly mode. -* Select text to add the squiggly annotation. -* Alternatively, select text first and then click **Squiggly**. - - ![Squiggly button in annotation toolbar](../images/squiggly_button.png) - -When pan mode is active, entering squiggly mode switches the PDF Viewer to text selection mode to enable text selection for adding squiggly annotations. - -Refer to the following code snippet to switch to squiggly mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function squigglyMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Squiggly'); - } - return (
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function squigglyMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Squiggly'); - } - return (
    - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -Refer to the following code snippet to switch back to normal mode from squiggly mode. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function squigglyMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Squiggly'); - } - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return ( -
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function squigglyMode() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('Squiggly'); - } - function normalMode () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.setAnnotationMode('None'); - } - return ( -
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Add squiggly to text programmatically - -Programmatically add squiggly using the [addAnnotation](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotation#addannotation) method. - -Example: - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Squiggly", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function addAnnotation() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.annotation.addAnnotation("Squiggly", { - bounds: [{ x: 250, y: 144, width: 345, height: 14 }], - pageNumber: 2 - }); - } - return (
    - -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Deleting a text markup annotation - -The selected annotation can be deleted in the following ways: - -1. Using the Delete/Backspace key - * Select the annotation. - * Press Delete (or Backspace). The selected annotation is removed. - -2. Using the annotation toolbar - * Select the annotation. - * Click **Delete Annotation** in the annotation toolbar. The selected annotation is removed. - - ![Delete annotation button in toolbar](../images/delete_button.png) - -## Edit text markup annotation properties - -The color and the opacity of the text markup annotation can be edited using the Edit Color tool and the Edit Opacity tool in the annotation toolbar. - -### Edit color - -Use the color palette in the Edit Color tool to change the annotation color. - -![Edit color palette for annotations](../images/edit_color.png) - -### Edit opacity - -Use the range slider in the Edit Opacity tool to change annotation opacity. - -![Edit opacity slider for annotations](../images/edit_opacity.png) - -## Set default properties during control initialization - -Set default properties before creating the control using `highlightSettings`, `underlineSettings`, `strikethroughSettings`, and `squigglySettings`. - -> After editing default color and opacity using the Edit Color and Edit Opacity tools, the values update to the selected settings. - -Refer to the following code snippet to set the default annotation settings. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return ( -
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }} - highlightSettings = {{author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: ''}} - underlineSettings = {{author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9,modifiedDate: ''}} - strikethroughSettings = {{author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9, modifiedDate: ''}} - squigglySettings - {{author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9, modifiedDate: ''}}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return ( -
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }} - highlightSettings = {{author: 'Guest User', subject: 'Important', color: '#ffff00', opacity: 0.9, modifiedDate: ''}} - underlineSettings = {{author: 'Guest User', subject: 'Points to be remembered', color: '#00ffff', opacity: 0.9,modifiedDate: ''}} - strikethroughSettings = {{author: 'Guest User', subject: 'Not Important', color: '#ff00ff', opacity: 0.9, modifiedDate: ''}} - squigglySettings = {{author: 'Guest User', subject: 'Corrections', color: '#00ff00', opacity: 0.9, modifiedDate: ''}}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Perform undo and redo - -The PDF Viewer supports undo and redo for changes. For text markup annotations, undo and redo are provided for: - -* Inclusion of the text markup annotations. -* Deletion of the text markup annotations. -* Change of either color or opacity of the text markup annotations. - -Undo and redo actions can be performed in the following ways: - -1.Using keyboard shortcuts: - After performing a text markup annotation action, press Ctrl+Z to undo and Ctrl+Y 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 js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function undo() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.undo(); - } - function redo () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.redo(); - } - return ( -
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function undo() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.undo(); - } - function redo () { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.redo(); - } - return ( -
    - - -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## Save text markup annotations - -Click the download tool in the toolbar to save text markup annotations to the PDF document. The original document is not modified. - -## Print text markup annotations - -Click the print tool in the toolbar to print the PDF document with text markup annotations. The original document is not modified. - -## Disable text markup annotation - -Disable text markup annotations using the `enableTextMarkupAnnotation` property. - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return ( -
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - enableTextMarkupAnnotation = {false} - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return ( -
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - enableTextMarkupAnnotation = {false} - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -## See also - -* [Toolbar items](../../pdfviewer/toolbar) -* [Feature modules](../../pdfviewer/feature-module) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/context-menu/custom-context-menu.md b/Document-Processing/PDF/PDF-Viewer/react/context-menu/custom-context-menu.md index 5db1ef5749..3d4825fa11 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/context-menu/custom-context-menu.md +++ b/Document-Processing/PDF/PDF-Viewer/react/context-menu/custom-context-menu.md @@ -228,6 +228,4 @@ The following is the output of the custom context menu with customization. {% endhighlight %} {% endtabs %} -N> To set up the **server-backed PDF Viewer**, add the following `serviceUrl` within the
    element in either the `index.TSX` or `index.JSX` file: **serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer"**. - [View the sample in Stack blitz](https://stackblitz.com/edit/react-zmbkebwq?file=index.js) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/share-point.md b/Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/share-point.md index 702efb8582..62ded2d2e7 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/share-point.md +++ b/Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/share-point.md @@ -84,7 +84,6 @@ resourceUrl = "https://contoso.sharepoint.com/sites/YourSite/SiteAssets/ej2-pdfv Notes on rendering modes and SPFx: - Standalone (client-only): fully supported in SPFx — set `resourceUrl` as above and the viewer will render entirely in the browser. This is the recommended, simplest approach for SPFx web parts. -- Server‑backed (optional): to use server-side rendering, set `serviceUrl` (pointing to your PDF rendering web service) instead of `resourceUrl`. Important: ensure any host you use serves `.wasm` files with Content-Type `application/wasm` and that tenant/content security policies permit fetching assets from the chosen host. diff --git a/Document-Processing/PDF/PDF-Viewer/react/document-handling/retrieve-loadedDoc.md b/Document-Processing/PDF/PDF-Viewer/react/document-handling/retrieve-loadedDoc.md index e6f8bf89e5..7220d4b570 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/document-handling/retrieve-loadedDoc.md +++ b/Document-Processing/PDF/PDF-Viewer/react/document-handling/retrieve-loadedDoc.md @@ -233,8 +233,6 @@ function App() { ); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - function downloadClicked() { - var viewer = document.getElementById('container').ej2_instances[0]; - viewer.download(); - } - return (
    -
    - {/* Render the PDF Viewer */} - - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/forms/import-export-form-fields/import-form-fields.md b/Document-Processing/PDF/PDF-Viewer/react/forms/import-export-form-fields/import-form-fields.md index 0fa5e1ff68..8bec1441f7 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/forms/import-export-form-fields/import-form-fields.md +++ b/Document-Processing/PDF/PDF-Viewer/react/forms/import-export-form-fields/import-form-fields.md @@ -17,7 +17,7 @@ This guide shows how to import form field values into an already loaded PDF in t 2. Call [`importFormFields(data, format)`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#importformfields) where `format` is one of `FormFieldDataFormat.Fdf`, `FormFieldDataFormat.Xfdf`, or `FormFieldDataFormat.Json`. `data` may be a file path (for server/file-based imports) / base64 string or a JavaScript object mapping field names to values. -3. Verify the form fields are populated after the import completes. For server-backed imports, ensure [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) is configured and the import file is accessible by the server. +3. Verify the form fields are populated after the import completes. ## Example @@ -64,9 +64,7 @@ export default function App() { style={{ height: '680px', width: '100%' }} ref={viewerRef} documentPath="https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf" - // For server-backed viewer uncomment and set your service URL - // serviceUrl="http://localhost:5262/pdfviewer" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" + resourceUrl="https://cn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" > diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/add-save-button.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/add-save-button.md index 7b0013af61..52958bd388 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/add-save-button.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/add-save-button.md @@ -70,59 +70,6 @@ return (
    const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, FormFields, FormDesigner, Inject} from '@syncfusion/ej2-react-pdfviewer'; -import { ComboBox } from "@syncfusion/ej2-dropdowns"; -import { TextBox } from "@syncfusion/ej2-inputs"; - -export function App() { - -// Add OnCreateSearch outside the App function -function OnCreateSearch() { - this.addIcon('prepend', 'e-icons e-search'); -} - - var toolItem1 = { - prefixIcon: 'e-icons e-save', - id: 'download', - text: 'Save', - tooltipText: 'Save button', - align: 'Left' -}; - - function toolbarClick(args){ - var viewer = document.getElementById('container').ej2_instances[0]; - if (args.item && args.item.id === 'download') { - viewer.download(); - } - }; -return (
    -
    - - {/* Inject the required services */} - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/add-signature.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/add-signature.md index de744c915a..cdfb24b65a 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/add-signature.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/add-signature.md @@ -69,56 +69,6 @@ Follow these steps {% endraw %} {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - - - - - - function fieldClick(args) { - var viewer = document.getElementById('container').ej2_instances[0]; - if (viewer) { - args.cancel = true; - if (args.field.type === 'SignatureField') { - var forms = viewer.formFieldCollections; - forms.map((r) => { - if (r.id === args.field.id) { - console.log(args.field.value); - var el = document.getElementById(r.id); - if (el) { - if (el.style.textAlign !== 'center') { - el.style.textAlign = 'center'; - } - if (el.style.fontStyle !== 'italic') { - el.style.fontStyle = 'italic'; - } - if (el.style.fontWeight !== 'italic') { - el.style.fontWeight = 'italic'; - } - if (args.field.value !== '' && args.field.value) { - args.field.value = ''; - viewer.updateFormFieldsValue(args.field); - } else { - args.field.signatureType = ['Type']; - args.field.value = 'DA FIRMARE'; - args.cancel = true; - viewer.updateFormFieldsValue(args.field); - } - } - } - }); - } - } - } -{% endraw %} -{% endhighlight %} {% endtabs %} Find the Sample [how to add signature in signature field](https://stackblitz.com/edit/react-ce6gat?file=src%2Findex.js) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/change-author-name-using-annotation-settings.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/change-author-name-using-annotation-settings.md index e7711d4014..19cdfebc3a 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/change-author-name-using-annotation-settings.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/change-author-name-using-annotation-settings.md @@ -41,18 +41,5 @@ viewer.annotationSettings = { author: 'syncfusion', minHeight: 30, maxHeight: 50 viewer.freeTextSettings = { allowTextOnly : true }; viewer.appendTo("#pdfViewer"); -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, Print, Annotation, FormFields } from "../src/index"; - -PdfViewer.Inject(Toolbar, Magnification, Navigation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, Print, Annotation, FormFields); -let viewer: PdfViewer = new PdfViewer(); -viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/"; -viewer.load('https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', null); -viewer.annotationSettings = { author: 'syncfusion', minHeight: 30, maxHeight: 500, minWidth: 30, maxWidth: 500, isLock: false, isPrint: true, isDownload: true }; -viewer.freeTextSettings = { allowTextOnly : true }; -viewer.appendTo("#pdfViewer"); - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/configure-annotation-selector-setting.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/configure-annotation-selector-setting.md index 566d1adc16..6d10c60602 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/configure-annotation-selector-setting.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/configure-annotation-selector-setting.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Configure annotation selector settings +# Configure annotation selector settings in React Use the [annotationSelectorSettings](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/annotationSelectorSettings/) property to customize the appearance and interaction behavior of the annotation selector in the react PDF Viewer UI. diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md index e3bbaf1f88..bab655c6d0 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/convert-pdf-library-bounds-to-pdf-viewer-bounds.md @@ -1,6 +1,6 @@ --- layout: post -title: Convert PDF Library bounds to PDF Viewer bounds | Syncfusion +title: Convert PDF Library bounds to PDF Viewer bounds in React | Syncfusion description: Learn how to convert PDF Library bounds into PDF Viewer bounds when exporting annotations, ensuring accurate placement in the React PDF Viewer. control: PDF Viewer platform: document-processing @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Convert PDF Library bounds to PDF Viewer bounds +# Convert PDF Library bounds to PDF Viewer bounds in React When exporting annotations from the PDF Library, convert the annotation bounds into the PDF Viewer coordinate system so exported annotations appear at the correct position and scale in the viewer. @@ -124,7 +124,7 @@ class App extends React.Component { ref={this.viewerRef} id="PdfViewer" documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" + resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" style={{ height: '640px' }} exportSuccess={this.handleExportSuccess} > diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/download-start-event.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/download-start-event.md index b8a3e8208a..293894a822 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/download-start-event.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/download-start-event.md @@ -49,44 +49,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function downloadStart(args){ - // Your custom logic here - args.cancel = true; // Prevent download action - }; - return (
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - downloadStart={downloadStart} - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/enable-local-storage.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/enable-local-storage.md index 65d446d9f5..3387428f6e 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/enable-local-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/enable-local-storage.md @@ -30,9 +30,8 @@ export function App() { diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/get-base64.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/get-base64.md index 135b9a507b..c156a139e4 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/get-base64.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/get-base64.md @@ -97,81 +97,6 @@ class App extends React.Component { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import { - PdfViewerComponent, - Toolbar, - Magnification, - Navigation, - Annotation, - TextSelection, - TextSearch, - FormFields, - FormDesigner, - PageOrganizer, - Inject -} from '@syncfusion/ej2-react-pdfviewer'; - -class App extends React.Component { - constructor(props) { - super(props); - this.viewerRef = React.createRef(); - } - - // Function to get Base64 of the loaded document - base64ofloadedDocument = () => { - this.viewerRef.current.saveAsBlob().then((blobData) => { - const reader = new FileReader(); - reader.onload = () => { - const base64data = reader.result; - console.log(base64data); - }; - reader.readAsDataURL(blobData); - }); - }; - - render() { - return ( -
    -
    - - - - -
    -
    - ); - } -} - -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/load-document.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/load-document.md index 2fb413e95c..429d0aa21a 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/load-document.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/load-document.md @@ -75,35 +75,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/load-n-number-page.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/load-n-number-page.md index 4c7e839fa2..a330b90694 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/load-n-number-page.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/load-n-number-page.md @@ -8,7 +8,7 @@ documentation: ug domainurl: ##DomainURL## --- -# Load N pages initially +# Load N pages initially in React Control the number of pages the PDF Viewer renders on the initial load to improve perceived performance and reduce initial memory usage. Additional pages are rendered dynamically as the user scrolls through the document, allowing quick access to early pages without loading the entire file. @@ -43,36 +43,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/lock-annotation.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/lock-annotation.md index 56d4df8895..1035845942 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/lock-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/lock-annotation.md @@ -37,7 +37,7 @@ The PDF Viewer supports locking annotations to prevent users from moving, resizi diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/min-max-zoom.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/min-max-zoom.md index 708b52f3e7..47c08d771c 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/min-max-zoom.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/min-max-zoom.md @@ -48,38 +48,6 @@ export function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, Annotation, TextSearch, FormFields, FormDesigner,PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -export function App() { - return (
    -
    - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -130,49 +98,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer Inject } from '@syncfusion/ej2-react-pdfviewer'; -import {Browser} from '@syncfusion/ej2-base'; - -function App() { - function documentLoaded(){ - var viewer = document.getElementById('container').ej2_instances[0]; - if (Browser.isDevice && !viewer.enableDesktopMode) { - viewer.maxZoom = 100; - viewer.minZoom = 10; - } - else { - viewer.zoomMode = 'Default'; - } - } - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/pagerenderstarted-pagerendercompleted-event.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/pagerenderstarted-pagerendercompleted-event.md index ea4e226402..4b7f04f4c2 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/pagerenderstarted-pagerendercompleted-event.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/pagerenderstarted-pagerendercompleted-event.md @@ -58,51 +58,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function pageRenderInitiate(args){ - // This method is called when the page rendering starts - console.log('Rendering of pages started'); - console.log(args); - }; - function pageRenderComplete(args){ - // This method is called when the page rendering completes - console.log('Rendering of pages completed'); - console.log(args); - }; - return (
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - pageRenderInitiate={pageRenderInitiate} - pageRenderComplete={pageRenderComplete} - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/perform-form-field-double-click-event.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/perform-form-field-double-click-event.md index d261d8f4bb..a7980b44b3 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/perform-form-field-double-click-event.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/perform-form-field-double-click-event.md @@ -28,24 +28,6 @@ This article demonstrates how to handle a double-click on a PDF form field by us style={{ height: '640px' }}>
    -function formFieldDoubleClick(args) { - //Prints the argument value in the console window - console.log(args); - } - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - - - - function formFieldDoubleClick(args) { //Prints the argument value in the console window console.log(args); diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/restricting-zoom-in-mobile-mode.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/restricting-zoom-in-mobile-mode.md index e8d543cd5a..254e4b9ddb 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/restricting-zoom-in-mobile-mode.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/restricting-zoom-in-mobile-mode.md @@ -7,7 +7,7 @@ platform: document-processing documentation: ug --- -# Restrict zoom percentage on mobile devices +# Restrict zoom percentage on mobile devices in React Use `minZoom` and `maxZoom` to restrict zoom levels on mobile devices and improve scrolling performance and perceived load time. Restricting zoom prevents extreme zoom levels that can degrade rendering performance on constrained devices. @@ -53,49 +53,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer Inject } from '@syncfusion/ej2-react-pdfviewer'; -import {Browser} from '@syncfusion/ej2-base'; - -function App() { - function documentLoaded(){ - var viewer = document.getElementById('container').ej2_instances[0]; - if (Browser.isDevice && !viewer.enableDesktopMode) { - viewer.maxZoom = 100; - viewer.minZoom = 10; - } - else { - viewer.zoomMode = 'Default'; - } - } - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/show-custom-stamp-item.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/show-custom-stamp-item.md index 4e6c94ed61..c8b18c1931 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/show-custom-stamp-item.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/show-custom-stamp-item.md @@ -8,7 +8,7 @@ documentation: ug --- -# Display custom stamp items in the custom stamp dropdown +# Display custom stamp items in the custom stamp dropdown in React ### Overview @@ -98,83 +98,6 @@ class App extends React.Component { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import { - PdfViewerComponent, - Toolbar, - Magnification, - Navigation, - Annotation, - TextSelection, - TextSearch, - FormFields, - FormDesigner, - PageOrganizer, - Inject -} from '@syncfusion/ej2-react-pdfviewer'; - -class App extends React.Component { - constructor(props) { - super(props); - this.viewerRef = React.createRef(); - } - - render() { - const customStampSettings = { - isAddToMenu: true, - customStamps: [ - { - customStampName: 'Image1', - customStampImageSource: 'data:image/png;base64,...' // Provide a valid base64 or URL for the image - }, - { - customStampName: 'Image2', - customStampImageSource: 'data:image/png;base64,...' // Provide a valid base64 or URL for the image - } - ], - enableCustomStamp: true, - opacity: 1 - }; - - return ( -
    -
    - - - -
    -
    - ); - } -} - -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/how-to/signatureselect-signatureunselect.md b/Document-Processing/PDF/PDF-Viewer/react/how-to/signatureselect-signatureunselect.md index ef181814ad..ba5d2cb9db 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/how-to/signatureselect-signatureunselect.md +++ b/Document-Processing/PDF/PDF-Viewer/react/how-to/signatureselect-signatureunselect.md @@ -63,48 +63,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, FormFields, FormDesigner, - PageOrganizer, Inject} from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - - function signatureSelect(args){ - console.log('Signature selected:', args); - }; - function signatureUnselect(args){ - console.log('Signature unselected:', args); - }; - return (
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - signatureSelect={signatureSelect} - signatureUnselect={signatureUnselect} - style={{ 'height': '640px' }}> - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/interaction-mode.md b/Document-Processing/PDF/PDF-Viewer/react/interaction-mode.md index eba7f3b02f..85f694a6a5 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/interaction-mode.md +++ b/Document-Processing/PDF/PDF-Viewer/react/interaction-mode.md @@ -52,36 +52,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -149,51 +119,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const switchToPan = () => { - pdfViewerRef.current.interactionMode = 'Pan'; - }; - - const switchToTextSelection = () => { - pdfViewerRef.current.interactionMode = 'TextSelection'; - }; - - return (
    -
    - - -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -231,36 +156,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -322,60 +217,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - const [isAnnotating, setIsAnnotating] = React.useState(false); - - const handleOpenAnnotationTool = () => { - // Switch to TextSelection mode when opening annotation tool - pdfViewerRef.current.interactionMode = 'TextSelection'; - setIsAnnotating(true); - }; - - const handleCloseAnnotationTool = () => { - // Switch back to Pan mode - pdfViewerRef.current.interactionMode = 'Pan'; - setIsAnnotating(false); - }; - - return (
    -
    - - -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/bookmark.md b/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/bookmark.md index 74a0074602..df59f0d9d1 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/bookmark.md +++ b/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/bookmark.md @@ -242,7 +242,7 @@ export default function App() { - **Bookmarks button is not enabled**: confirm the PDF actually contains bookmarks and [`enableBookmark={true}`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#enablebookmark) is set. - **[`goToBookmark`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/bookmarkview#gotobookmark) throws an error**: ensure the target page index and coordinates exist; validate values before calling. -- **Missing features**: add [`BookmarkView`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/bookmarkview) to the `` list and include [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) when required. +- **Missing features**: add [`BookmarkView`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/bookmarkview) to the `` list and include [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/page-thumbnail.md b/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/page-thumbnail.md index 97d3469335..38c825efca 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/page-thumbnail.md +++ b/Document-Processing/PDF/PDF-Viewer/react/interactive-pdf-navigation/page-thumbnail.md @@ -108,7 +108,7 @@ export default function App() { ## Troubleshooting - **Thumbnail panel not appearing**: Ensure [`ThumbnailView`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/thumbnailview) is included in the `Inject` services array. -- **WASM or service endpoint errors**: Verify that [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (for standalone) or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) (for server-backed) is correctly configured and accessible. +- **WASM or service endpoint errors**: Verify that [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (for standalone) is correctly configured and accessible. ## See Also diff --git a/Document-Processing/PDF/PDF-Viewer/react/keyboard-accessibility.md b/Document-Processing/PDF/PDF-Viewer/react/keyboard-accessibility.md deleted file mode 100644 index 440b7265ca..0000000000 --- a/Document-Processing/PDF/PDF-Viewer/react/keyboard-accessibility.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -layout: post -title: Keyboard accessibility in React Pdfviewer component | Syncfusion -description: Learn here all about Keyboard accessibility in Syncfusion React Pdfviewer component of Syncfusion Essential JS 2 and more. -control: PDF Viewer -platform: document-processing -documentation: ug -domainurl: ##DomainURL## ---- - -# Keyboard accessibility in React PDF Viewer component - -The React PDF Viewer supports the keyboard interactions listed below. - -|**Action**|**Windows**|**Macintosh**| -|--|--|--| -|**Shortcuts for page navigation**||| -|Navigate to the first page|Home|Function + Left arrow| -|Navigate to the last page|End|Function + Right arrow| -|Navigate to the previous page|Up Arrow|Up Arrow| -|Navigate to the next page|Down Arrow|Down Arrow| -|**Shortcuts for zooming**||| -|Perform zoom-in operation|CONTROL + =|COMMAND + =| -|Perform zoom-out operation|CONTROL + -|COMMAND + -| -|Reset zoom to 100%|CONTROL + 0|COMMAND + 0| -|**Shortcut for text search**||| -|Open the search toolbar|CONTROL + F|COMMAND + F| -|**Shortcuts for text selection**||| -|Copy the selected text, annotation, or form field|CONTROL + C|COMMAND + C| -|Cut the selected text, annotation, or form field|CONTROL + X|COMMAND + X| -|Paste the selected text, annotation, or form field|CONTROL + Y|COMMAND + Y| -|**Shortcuts for general operations**||| -|Undo the action|CONTROL + Z|COMMAND + Z| -|Redo the action|CONTROL + Y|COMMAND + Y| -|Print the document|CONTROL + P|COMMAND + P| -|Delete annotations and form fields|Delete|Delete| - -{% tabs %} -{% highlight js tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import {PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import {PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, Annotation, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/magnification/fitmode.md b/Document-Processing/PDF/PDF-Viewer/react/magnification/fitmode.md index 63a73c930d..d1869f96a4 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/magnification/fitmode.md +++ b/Document-Processing/PDF/PDF-Viewer/react/magnification/fitmode.md @@ -56,47 +56,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const handleFitPage = () => { - // Fit entire page to viewport - pdfViewerRef.current.magnification.fitToPage(); - }; - - return (
    -
    - -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -145,47 +104,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const handleFitWidth = () => { - // Fit page width to viewport - pdfViewerRef.current.magnification.fitToWidth(); - }; - - return (
    -
    - -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -230,40 +148,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - return (
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -332,67 +216,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - const [currentFitMode, setCurrentFitMode] = React.useState('width'); - - const handleFitPage = () => { - pdfViewerRef.current.magnification.fitToPage(); - setCurrentFitMode('page'); - }; - - const handleFitWidth = () => { - pdfViewerRef.current.magnification.fitToWidth(); - setCurrentFitMode('width'); - }; - - return (
    -
    - - -

    - Current mode: {currentFitMode === 'page' ? 'Fit Page' : 'Fit Width'} -

    -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -463,69 +286,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - const [lastZoom, setLastZoom] = React.useState(100); - - const handleFitPage = () => { - // Fit mode overrides last zoom - pdfViewerRef.current.magnification.fitToPage(); - }; - - const handleFitWidth = () => { - // Fit mode overrides last zoom - pdfViewerRef.current.magnification.fitToWidth(); - }; - - const handleRestoreZoom = () => { - // Restore previously saved zoom level - pdfViewerRef.current.magnification.zoomTo(lastZoom); - }; - - const onZoomChange = (args) => { - // Capture user's manual zoom level - setLastZoom(Math.round(args.previousZoomValue)); - }; - - return (
    -
    - - - -

    - Fit modes override zoom. Use Restore to return to last manual zoom. -

    -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/magnification/magnification.md b/Document-Processing/PDF/PDF-Viewer/react/magnification/magnification.md index 0fccd986e6..33afb8bb09 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/magnification/magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/react/magnification/magnification.md @@ -71,37 +71,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer with magnification enabled */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/magnification/zoom.md b/Document-Processing/PDF/PDF-Viewer/react/magnification/zoom.md index 0b09840d9c..95d231337b 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/magnification/zoom.md +++ b/Document-Processing/PDF/PDF-Viewer/react/magnification/zoom.md @@ -48,37 +48,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer with magnification enabled */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -133,51 +102,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const handleZoomIn = () => { - pdfViewerRef.current.magnification.zoomIn(); - }; - - const handleZoomOut = () => { - pdfViewerRef.current.magnification.zoomOut(); - }; - - return (
    -
    - - -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -235,56 +159,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const handleZoom150 = () => { - pdfViewerRef.current.magnification.zoomTo(150); - }; - - const handleZoom200 = () => { - pdfViewerRef.current.magnification.zoomTo(200); - }; - - const handleZoom75 = () => { - pdfViewerRef.current.magnification.zoomTo(75); - }; - - return (
    -
    - - - -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -331,45 +205,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const onDocumentLoaded = () => { - // Set default zoom to 150% when document is loaded - pdfViewerRef.current.magnification.zoomTo(150); - }; - - return (
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -466,95 +301,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { - PdfViewerComponent, - Toolbar, - Magnification, - Navigation, - LinkAnnotation, - BookmarkView, - ThumbnailView, - Print, - TextSelection, - TextSearch, - Inject, -} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - - const handleZoom150 = () => { - pdfViewerRef.current.magnification.zoomTo(150); - }; - - const handleZoom200 = () => { - pdfViewerRef.current.magnification.zoomTo(200); - }; - - return ( -
    - {/* Custom Application Toolbar */} -
    - - -

    - Zoom level is controlled by the application. -

    -
    - - {/* PDF Viewer */} - - - -
    - ); -} - -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -605,49 +351,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - const pdfViewerRef = React.useRef(null); - const [zoomLevel, setZoomLevel] = React.useState(100); - - const onZoomChange = (args) => { - // Update custom UI with new zoom level from magnification event - setZoomLevel(Math.round(args.zoomValue)); - }; - - return (
    -
    - Current Zoom: {zoomLevel}% -
    -
    - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -694,38 +397,6 @@ const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); {% endraw %} {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import './index.css'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, - ThumbnailView, Print, TextSelection, TextSearch, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return ( -
    -
    - - - - -
    -
    - ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); -{% endraw %} -{% endhighlight %} {% endtabs %} The [zoomTo()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/magnification#zoomto) method will clamp values outside the configured `minZoom`/`maxZoom` range to the nearest valid limit. diff --git a/Document-Processing/PDF/PDF-Viewer/react/mobile-toolbar.md b/Document-Processing/PDF/PDF-Viewer/react/mobile-toolbar.md index 87a766bdaa..03f658bf6e 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/mobile-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/react/mobile-toolbar.md @@ -84,38 +84,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - enableDesktopMode={true} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -155,39 +123,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('sample')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, - BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, - FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; -let pdfviewer; - -function App() { - return (
    -
    - { pdfviewer = scope; }} - id="container" - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - enableDesktopMode={true} - enableTextSelection={false} - style={{ 'height': '640px' }}> - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-amazon-s3.md b/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-amazon-s3.md index aafc0add07..308e07fd58 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-amazon-s3.md +++ b/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-amazon-s3.md @@ -71,153 +71,4 @@ loadDocument() { N> Install the `aws-sdk` package in your application to use the previous code example. Do not embed AWS credentials in client-side code for production—use a server-backed approach or secure token service instead. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using the server-backed PDF Viewer - -Follow these steps to load a PDF from AWS S3 using the server-backed PDF Viewer. - -**Step 1:** Create a PDF Viewer sample in React - -Create a basic PDF Viewer sample by following the getting started guide: https://help.syncfusion.com/document-processing/pdf/pdf-viewer/react/getting-started - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` - -5. Modify the [Load()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#load) method to load the PDF files from AWS S3. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  - -public async Task Load([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - - string document = jsonObject["document"]; - - // Specify the document name or retrieve it from a different source - var response = await s3Client.GetObjectAsync(_bucketName, document); - - Stream responseStream = response.ResponseStream; - responseStream.CopyTo(stream); - stream.Seek(0, SeekOrigin.Begin); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - - jsonResult = pdfviewer.Load(stream, jsonObject); - - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace the placeholders with the actual AWS credentials and bucket name. When storing secrets in `appsettings.json`, follow secure secrets-management practices (for example, environment variables or a secrets store) in production. - -**Step 3:** Configure the PDF Viewer component - -Set the [serviceUrl](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#serviceurl) to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from AWS S3. Ensure the document name matches an object in your bucket. - -{% raw %} - -```ts - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, Annotation, TextSearch, Inject, FormDesigner, FormFields} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -``` -{% endraw %} - -N> Install the `AWSSDK.S3` NuGet package in your web service project to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-azure-blob-storage.md b/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-azure-blob-storage.md index 098c1ca893..e6530a8644 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-azure-blob-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-azure-blob-storage.md @@ -90,135 +90,4 @@ function blobToBase64(blob) { } ``` -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using the server-backed PDF Viewer - -Follow these steps to load a PDF from Azure Blob Storage using the server-backed PDF Viewer. - -**Step 1:** Create a PDF Viewer sample in React - -Start by following the steps provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/react/getting-started) to create a simple PDF viewer sample in React. This will give you a basic setup of the PDF viewer component. - -**Step 2:** Modify the `PdfViewerController.cs` File in the Web Service Project - -1. Create a web service project in .NET Core 3.0 or above. You can refer to this [link](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on how to create a web service project. - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private readonly string _storageConnectionString; -private readonly string _storageContainerName; -private readonly ILogger _logger; - -public PdfViewerController(IConfiguration configuration, ILogger logger) -{ - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); - _logger = logger; -} -``` - -5. Modify the `Load()` method to load PDF files from Azure Blob Storage. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  -  -public IActionResult Load([FromBody] Dictionary jsonObject) -{ - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.TryParse(jsonObject["isFileName"], out bool isFileName) && isFileName) - { - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - string fileName = jsonObject["document"]; - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - BlockBlobClient blockBlobClient = containerClient.GetBlockBlobClient(fileName); - blockBlobClient.DownloadTo(stream); - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -N> Replace the placeholders with the actual Azure storage connection string and container name. Use secure configuration sources (environment variables or a secrets store) in production. - -**Step 3:** Configure the PDF Viewer component - -Modify the `serviceUrl` property of the PDF viewer component with the accurate URL of your web service project, replacing `https://localhost:44396/pdfviewer` with the actual URL of your server. Set the `documentPath` property of the PDF viewer component to the desired name of the PDF file you wish to load from Azure Blob Storage. Ensure that you correctly pass the document name from the files available in your azure contanier to the documentPath property. - -{% raw %} - -```ts - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, Annotation, TextSearch, Inject, FormDesigner, FormFields} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -``` -{% endraw %} - -N> Install the `Azure.Storage.Blobs` NuGet package in the server project to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-dropbox-cloud-file-storage.md b/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-dropbox-cloud-file-storage.md index d21416a24c..2db1eb08cf 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-dropbox-cloud-file-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/react/open-pdf-file/from-dropbox-cloud-file-storage.md @@ -59,151 +59,4 @@ function blobToBase64(blob){ N> Install the Dropbox JavaScript SDK via npm (`npm install dropbox`) before using the standalone example. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) - -## Using the server-backed PDF Viewer - -To load a PDF file from Dropbox cloud file storage in a PDF Viewer, you can follow the steps below. - -**Step 1:** Create a Dropbox API app - -Create an API app in the Dropbox App Console. Follow the Dropbox tutorial for app creation and obtain an access token or configure OAuth 2.0 for server-side authentication. Ensure the app has the scopes required to read files from the target folder and register an appropriate redirect URI when using OAuth flows. - -**Step 2:** Create a PDF Viewer sample in React - -Start by following the steps provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/react/getting-started) to create a simple PDF viewer sample in React. This will give you a basic setup of the PDF viewer component. - -**Step 3:** Modify the PdfViewerController.cs file in the web service project - -1. Create a web service project in .NET Core 3.0 or above. Ensure the project runs over HTTPS in production and configure CORS to allow requests from the client origin. You can refer to this [guide](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above) for instructions on creating the web service project. Install the Dropbox SDK NuGet package (for example: `Install-Package Dropbox.Api`). - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Dropbox.Api; -using Dropbox.Api.Files; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp - -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _folderName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _folderName = _configuration.GetValue("FolderName"); -} -``` - -5. Modify the `Load()` method to load the PDF from Dropbox cloud file storage. - -```csharp - -[HttpPost("Load")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Load")] -//Post action for Loading the PDF documents  - -public async Task Load([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - MemoryStream stream = new MemoryStream(); - object jsonResult = new object(); - if (jsonObject != null && jsonObject.ContainsKey("document")) - { - if (bool.Parse(jsonObject["isFileName"])) - { - // Get the file name from the jsonObject, which should contain the Dropbox file name - string fileName = jsonObject["document"]; - - using (var dropBox = new DropboxClient(_accessToken)) - { - using (var response = await dropBox.Files.DownloadAsync(_folderName + "/" + fileName)) - { - var byteArray = await response.GetContentAsByteArrayAsync(); - - // Load the PDF file into the PDF viewer - stream = new MemoryStream(byteArray); - } - } - } - else - { - byte[] bytes = Convert.FromBase64String(jsonObject["document"]); - stream = new MemoryStream(bytes); - } - } - jsonResult = pdfviewer.Load(stream, jsonObject); - return Content(JsonConvert.SerializeObject(jsonResult)); -} -``` - -6. Open the `appsettings.json` file in your web service project, Add the following lines below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Dropbox_Access_Token", - "FolderName": "Your_Folder_Name" -} -``` - -N> Replace the placeholders with actual Dropbox values (Access Token and Folder Name). Do not store secrets in plaintext for production—use environment variables or a secure secret store (for example, Azure Key Vault). Implement token refresh logic and add robust error handling for API failures and missing resources. - -**Step 4:** Configure the PDF Viewer component - -Set the [serviceUrl](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#serviceurl) to your web service endpoint (replace the localhost URL with your server URL). Set documentPath to the PDF file name to load from Dropbox. Ensure the document name exists in your Dropbox folder. - -{% raw %} - -```ts - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, Annotation, TextSearch, Inject, FormDesigner, FormFields} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -``` -{% endraw %} - -N> Install the **Dropbox.Api** NuGet package in the web service project to use the server example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Server-Backed) +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/import-pages.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/import-pages.md index 2834aaff43..019544eaea 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/import-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/import-pages.md @@ -20,7 +20,7 @@ This guide explains how to import pages from another PDF into the current docume - EJ2 React PDF Viewer installed - PDF Viewer is injected with `PageOrganizer` service -- [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (standalone) or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) (server-backed) configured when required +- [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (standalone) ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/insert-blank-pages.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/insert-blank-pages.md index 3b5ab21e79..bbd69617ea 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/insert-blank-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/insert-blank-pages.md @@ -20,7 +20,7 @@ This guide describes inserting new blank pages into a PDF using the **Organize P - EJ2 React PDF Viewer installed - `PageOrganizer` services injected into `PdfViewerComponent` -- [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) for standalone mode or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) for server-backed mode configured as required +- [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) for standalone mode ## Steps @@ -57,7 +57,7 @@ To enable or disable the **Insert Pages** button in the page thumbnails, update ## Troubleshooting - **Organize Pages button missing**: Verify `PageOrganizer` is included in `Inject` and `Toolbar` is enabled. -- **Inserted page not saved**: Confirm [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) is configured for your selected processing mode. +- **Inserted page not saved**: Confirm [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) is configured for your selected processing mode. - **Insert options disabled**: Ensure [`pageOrganizerSettings.canInsert`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/pageorganizersettingsmodel#caninsert) is set to `true` to enable insert option. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/programmatic-support.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/programmatic-support.md index 5e981f2dda..14f5e67d08 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/programmatic-support.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/programmatic-support.md @@ -35,25 +35,6 @@ export default function App() { ); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -export default function App() { - return ( - - - - ); -} - {% endhighlight %} {% endtabs %} @@ -80,25 +61,6 @@ export default function App() { ); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -export default function App() { - return ( - - - - ); -} - {% endhighlight %} {% endtabs %} @@ -126,26 +88,6 @@ export default function App() { ); } -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} - -import React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -export default function App() { - const pageOrganizerSettings = { canDelete: true, canInsert: true, canRotate: true, canCopy: true, canRearrange: true, canImport: true, imageZoom: 1, showImageZoomingSlider: true, imageZoomMin: 1, imageZoomMax: 5 }; - return ( - - - - ); -} - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/remove-pages.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/remove-pages.md index 3567584d8a..48af570658 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/remove-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/remove-pages.md @@ -19,7 +19,7 @@ This guide shows how to delete single or multiple pages from a PDF using the **O ## Prerequisites - EJ2 React PDF Viewer installed in your project -- Basic PDF Viewer setup ([`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) for standalone mode or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) for server-backed mode) +- Basic PDF Viewer setup [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) for standalone mode. ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/reorder-pages.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/reorder-pages.md index b8826fc7c5..21dc333fc7 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/reorder-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/reorder-pages.md @@ -58,7 +58,7 @@ To enable or disable the **Reorder pages** option in the Organize Pages, update ## Troubleshooting - **Thumbnails won't move**: Confirm [`pageOrganizerSettings.canRearrange`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/pageorganizersettingsmodel#canrearrange) is is not set to `false`. -- **Changes not saved**: Verify [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) (server) or [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (standalone) is configured correctly. +- **Changes not saved**: Verify [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (standalone) is configured correctly. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/rotate-pages.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/rotate-pages.md index 0c9b2eeaa4..30e6955759 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/rotate-pages.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/rotate-pages.md @@ -19,8 +19,7 @@ This guide explains how to rotate individual or multiple pages using the **Organ ## Prerequisites - EJ2 React PDF Viewer installed -- PDF Viewer configured with [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (standalone) or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) (server-backed) - +- PDF Viewer configured with [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) (standalone) ## Steps 1. Open the Organize Pages view @@ -66,7 +65,7 @@ To enable or disable the **Rotate Pages** button in the Organize Pages toolbar, ## Troubleshooting - **Rotate controls disabled**: Ensure [`pageOrganizerSettings.canRotate`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/pageorganizersettingsmodel#canrotate) is not set to `false`. -- **Rotation not persisted**: Click **Save** after rotating. For server-backed setups ensure [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) is set so server-side save can persist changes. +- **Rotation not persisted**: Click **Save** after rotating. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/toolbar.md b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/toolbar.md index 0d172c9269..70de9dd01d 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/organize-pages/toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/react/organize-pages/toolbar.md @@ -43,34 +43,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('PdfViewer')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - -import * as React from 'react'; -import * as ReactDOM from 'react-dom/client'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - let pdfviewer; - return ( - { pdfviewer = scope; }} - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - serviceUrl='https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' - pageOrganizerSettings={{ canInsert: false }} - style={{ height: '640px' }} - > - - - ); -} - -const root = ReactDOM.createRoot(document.getElementById('PdfViewer')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -106,34 +78,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('PdfViewer')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - -import * as React from 'react'; -import * as ReactDOM from 'react-dom/client'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - let pdfviewer; - return ( - { pdfviewer = scope; }} - serviceUrl='https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - pageOrganizerSettings={{ canDelete: false }} - style={{ height: '640px' }} - > - - - ); -} - -const root = ReactDOM.createRoot(document.getElementById('PdfViewer')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} @@ -169,34 +113,6 @@ function App() { const root = ReactDOM.createRoot(document.getElementById('PdfViewer')); root.render(); -{% endraw %} -{% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - -import * as React from 'react'; -import * as ReactDOM from 'react-dom/client'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject } from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - let pdfviewer; - return ( - { pdfviewer = scope; }} - serviceUrl='https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer/' - documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" - pageOrganizerSettings={{ canRotate: false }} - style={{ height: '640px' }} - > - - - ); -} - -const root = ReactDOM.createRoot(document.getElementById('PdfViewer')); -root.render(); - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-amazon-s3.md b/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-amazon-s3.md index 266365b51d..14123c9c2b 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-amazon-s3.md +++ b/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-amazon-s3.md @@ -115,143 +115,4 @@ function saveDocument() { N> Install the AWS SDK package to use the browser example. Run `npm install aws-sdk` for the v2 bundle, or prefer the AWS SDK v3 modular packages for smaller client bundles and better tree-shaking. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). - -## Using server-backed PDF Viewer - -To save a PDF file to AWS S3, you can follow the steps below - -**Step 1:** Create a PDF Viewer sample in React - -Follow the instructions provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/react/getting-started) to create a simple PDF Viewer sample in React. This will set up the basic structure of your PDF Viewer application. - -**Step 2:** Modify the `PdfViewerController.cs` file in the web service project - -1. Create a web service project in .NET Core 3.0 or later. For instructions, see this article: https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Amazon; -using Amazon.S3; -using Amazon.S3.Model; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private IConfiguration _configuration; -public readonly string _accessKey; -public readonly string _secretKey; -public readonly string _bucketName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessKey = _configuration.GetValue("AccessKey"); - _secretKey = _configuration.GetValue("SecretKey"); - _bucketName = _configuration.GetValue("BucketName"); -} -``` - -5. Modify the [Download()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#download) method to save the downloaded PDF file to the AWS S3 bucket. - -```csharp - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public IActionResult Download([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - RegionEndpoint bucketRegion = RegionEndpoint.USEast1; - - // Configure the AWS SDK with your access credentials and other settings - var s3Client = new AmazonS3Client(_accessKey, _secretKey, bucketRegion); - string bucketName = _bucketName; - string documentName = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentName); - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - using (MemoryStream stream = new MemoryStream(bytes)) - { - var request = new PutObjectRequest - { - BucketName = bucketName, - Key = result + "_downloaded.pdf", - InputStream = stream, - }; - // Upload the PDF document to AWS S3 - var response = s3Client.PutObjectAsync(request).Result; - } - return Content(documentBase); -} -``` - -6. Open the `appsettings.json` file in the web service project and add the following lines below the existing `"AllowedHosts"` configuration. - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessKey": "Your Access Key from AWS S3", - "SecretKey": "Your Secret Key from AWS S3", - "BucketName": "Your Bucket name from AWS S3" -} -``` - -N> Replace the placeholders with the appropriate AWS credentials and bucket name. For enhanced security, avoid storing long-lived credentials in configuration files; use environment variables or a secrets manager instead. - -**Step 3:** Set the PDF Viewer properties in the React PDF Viewer component - -Modify the [serviceUrl](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#serviceurl) property of the PDF Viewer component with the accurate URL of the web service, replacing `https://localhost:44396/pdfviewer` with the actual server URL. Set the `documentPath` property to the desired PDF file name to load from AWS S3, and ensure that the document exists in the target bucket. - -{% tabs %} -{% highlight ts tabtitle="Standalone" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, Annotation, TextSearch, Inject, FormDesigner, FormFields} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -N> The `AWSSDK.S3` NuGet package must be installed in the web service project to use the server example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Server-Backend) \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-aws-s3/tree/master/Open%20and%20Save%20PDF%20in%20AWS%20S3%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-azure-blob-storage.md b/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-azure-blob-storage.md index 2cf896d8b7..9bc83fea82 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-azure-blob-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-azure-blob-storage.md @@ -101,137 +101,4 @@ function saveDocument() { N> Install the Azure Storage Blob client package for browser use: `npm install @azure/storage-blob`. For server-side operations use `dotnet add package Azure.Storage.Blobs`. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). - -## Using server-backed PDF Viewer - -To save a PDF file to Azure Blob Storage, you can follow the steps below: - -**Step 1:** Create a PDF Viewer sample in React - -Follow the instructions provided in this [link](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/react/getting-started) to create a simple PDF Viewer sample in React. This sets up the basic structure of the PDF Viewer application. - -**Step 2:** Modify the `PdfViewerController.cs` file in the web service project - -1. Create a web service project in .NET Core 3.0 or later. For instructions, see this article: https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Azure.Storage.Blobs; -using Azure.Storage.Blobs.Specialized; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class, In the constructor, assign the values from the configuration to the corresponding fields - -```csharp -private readonly string _storageConnectionString; -private readonly string _storageContainerName; -private readonly ILogger _logger; - -public PdfViewerController(IConfiguration configuration, ILogger logger) -{ - _storageConnectionString = configuration.GetValue("connectionString"); - _storageContainerName = configuration.GetValue("containerName"); - _logger = logger; -} -``` - -5. Modify the [Download()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#download) method to save the downloaded PDF file to the Azure Blob Storage container. - -```csharp - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public IActionResult Download([FromBody] Dictionary jsonObject) -{ - // Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - string document = jsonObject["documentId"]; - - BlobServiceClient blobServiceClient = new BlobServiceClient(_storageConnectionString); - - BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(_storageContainerName); - - string result = Path.GetFileNameWithoutExtension(document); - // Get a reference to the blob - BlobClient blobClient = containerClient.GetBlobClient(result + "_downloaded.pdf"); - - // Convert the document base64 string to bytes - byte[] bytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - // Upload the document to Azure Blob Storage - using (MemoryStream stream = new MemoryStream(bytes)) - { - blobClient.Upload(stream, true); - } - return Content(documentBase); -} -``` - -6. Open the `appsettings.json` file in the web service project and add the following lines below the existing `"AllowedHosts"` configuration. - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "connectionString": "*Your Connection string from Azure*", - "containerName": "*Your container name in Azure*" -} -``` - -N> Replace the placeholders with the actual Azure Storage connection string and container name. - -**Step 3:** Set the PDF Viewer properties in the React PDF Viewer component - -Modify the [serviceUrl](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/#serviceurl) property of the PDF Viewer component with the accurate URL of the web service, replacing `https://localhost:44396/pdfviewer` with the actual server URL. Set the `documentPath` property to the desired PDF file name to load from Azure Blob Storage, and ensure that the document exists in the target container. - -{% tabs %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, Annotation, TextSearch, Inject, FormDesigner, FormFields} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -N> Install the Azure.Storage.Blobs NuGet package in the web service application to use the previous code example. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Server-Backend). \ No newline at end of file +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-azure-blob-storage/tree/master/Open%20and%20Save%20PDF%20in%20Azure%20Blob%20Storage%20using%20Standalone). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-dropbox-cloud-file-storage.md b/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-dropbox-cloud-file-storage.md index e673e1ac9a..6b21b9d0a7 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-dropbox-cloud-file-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/react/save-pdf-file/to-dropbox-cloud-file-storage.md @@ -103,147 +103,4 @@ N> Replace **Your Access Token** with the actual access token for the Dropbox ap N> Install the `dropbox` package in the React project before running the sample: `npm install dropbox`. -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) - -## Using server-backed PDF Viewer - -To save a PDF file to Dropbox cloud file storage, you can follow the steps below - -**Step 1:** Create a Dropbox API app - -To create a Dropbox API app, follow the Dropbox .NET tutorial: [Dropbox .NET tutorial](https://www.dropbox.com/developers/documentation/dotnet#tutorial). Use the Dropbox App Console to register an app and obtain the necessary access token and permissions. - -**Step 2:** Create a PDF Viewer sample in React - -Follow the Syncfusion getting-started instructions for the React PDF Viewer: [React PDF Viewer getting started](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/react/getting-started). This sets up the basic PDF Viewer application structure. - -**Step 3:** Modify the `PdfViewerController.cs` file in the web service project - -1. Create a web service project in .NET Core 3.0 or above. Refer to the Syncfusion knowledge base article on creating a PDF Viewer web service: [Create a PDF Viewer web service in .NET Core 3.0 and above](https://www.syncfusion.com/kb/11063/how-to-create-pdf-viewer-web-service-in-net-core-3-0-and-above). - -2. Open the `PdfViewerController.cs` file in your web service project. - -3. Import the required namespaces at the top of the file: - -```csharp -using System.IO; -using Dropbox.Api; -using Dropbox.Api.Files; -``` - -4. Add the following private fields and constructor parameters to the `PdfViewerController` class. In the constructor, assign configuration values to the corresponding fields. - -```csharp - -private IConfiguration _configuration; -public readonly string _accessToken; -public readonly string _folderName; - -public PdfViewerController(IWebHostEnvironment hostingEnvironment, IMemoryCache cache, IConfiguration configuration) -{ - _hostingEnvironment = hostingEnvironment; - _cache = cache; - _configuration = configuration; - _accessToken = _configuration.GetValue("AccessToken"); - _folderName = _configuration.GetValue("FolderName"); -} -``` - -5. Modify the `Download()` method to save the downloaded PDF files to Dropbox cloud storage - -```csharp - -[HttpPost("Download")] -[Microsoft.AspNetCore.Cors.EnableCors("MyPolicy")] -[Route("[controller]/Download")] -//Post action for downloading the PDF documents - -public async Task Download([FromBody] Dictionary jsonObject) -{ - //Initialize the PDF Viewer object with memory cache object - PdfRenderer pdfviewer = new PdfRenderer(_cache); - - string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject); - byte[] documentBytes = Convert.FromBase64String(documentBase.Split(",")[1]); - - string documentId = jsonObject["documentId"]; - string result = Path.GetFileNameWithoutExtension(documentId); - string fileName = result + "_downloaded.pdf"; - - using (var dropBox = new DropboxClient(_accessToken)) - { - using (var stream = new MemoryStream(documentBytes)) - { - // Upload the document to Dropbox - var uploadedFile = await dropBox.Files.UploadAsync( - _folderName + "/" + fileName, - WriteMode.Overwrite.Instance, - body: stream - ); - } - } - return Content(documentBase); -} - -``` - -6. Open the `appsettings.json` file in the web service project and add the following entries below the existing `"AllowedHosts"` configuration - -```json -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "AccessToken": "Your_Dropbox_Access_Token", - "FolderName": "Your_Folder_Name" -} -``` - -N> Replace the placeholders with the actual Dropbox access token and folder name. - -**Step 4:** Set the PDF Viewer properties in the React PDF Viewer component - -Modify the `serviceUrl` property of the PDF Viewer component with the accurate URL of the web service, replacing `https://localhost:44396/pdfviewer` with the actual server URL. Set the `documentPath` property to the desired PDF file name to load from Dropbox, and ensure that the document exists in the target folder. - -{% tabs %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} - -import * as ReactDOM from 'react-dom'; -import * as React from 'react'; -import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, - Print, TextSelection, Annotation, TextSearch, Inject, FormDesigner, FormFields} from '@syncfusion/ej2-react-pdfviewer'; - -function App() { - return (
    -
    - {/* Render the PDF Viewer */} - - - - -
    -
    ); -} -const root = ReactDOM.createRoot(document.getElementById('sample')); -root.render(); - -{% endraw %} -{% endhighlight %} -{% endtabs %} - -N> Install the `Dropbox.Api` NuGet package in the web service application to use the previous code example. - -N> Replace `PDF_Succinctly.pdf` with the actual document name stored in Dropbox and pass that name to the `documentPath` property of the PDF Viewer component. - -[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Server-Backed) +[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-dropbox-cloud-file-storage/tree/master/Open%20and%20Save%20PDF%20in%20Drop%20Box%20using%20Standalone) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/annotation-toolbar.md b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/annotation-toolbar.md index 60553f1188..090160baea 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/annotation-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/annotation-toolbar.md @@ -19,7 +19,7 @@ This guide shows how to show or hide the annotation toolbar and how to choose wh ## Prerequisites - EJ2 React PDF Viewer installed and added in your project. See [getting started guide](../getting-started) -- A valid [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) or [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) for viewer assets when running locally +- A valid [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl). ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/custom-toolbar.md b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/custom-toolbar.md index 2e8a38c9ce..95018ca1c7 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/custom-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/custom-toolbar.md @@ -82,67 +82,6 @@ render() { } {% endraw %} {% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} -render() { - function template() { - return ( -
    of 0
    - ); - } - function inputTemplate() { - return ( -
    - ); - } - return (
    -
    -
    -
    - { this.toolbar = scope; }} clicked={this.clickHandler.bind(this)}> - - - - - - - - - - -
    - {/* Render the PDF Viewer */} - { this.viewer = scope; }} - enableToolbar={false} - documentLoad={this.documentLoaded} - pageChange={this.onPageChange} - documentPath="https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'display': 'block', 'height': '640px' }}> - - - -
    - - - - - - - -
    -
    -
    -
    ); -} -{% endraw %} -{% endhighlight %} {% endtabs %} **Step 3: Import and inject the necessary modules.** @@ -180,21 +119,6 @@ Hide the default toolbar using `enableToolbar` and `enableThumbnail` properties:
    -{% endraw %} -{% endhighlight %} -{% highlight js tabtitle="Server-Backed" %} -{% raw %} - { this.viewer = scope; }} - enableToolbar={false} - documentLoad={this.documentLoaded} - pageChange={this.onPageChange} - documentPath="https://cdn.syncfusion.com/content/pdf/hive-succinctly.pdf" - serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" - style={{ 'display': 'block', 'height': '640px' }}> - - {% endraw %} {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/form-designer-toolbar.md b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/form-designer-toolbar.md index 246d0a031f..1d580453ce 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/form-designer-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/form-designer-toolbar.md @@ -19,7 +19,7 @@ This guide shows how to show or hide the form designer toolbar, and how to confi ## Prerequisites - EJ2 React PDF Viewer installed and added in project. See [getting started guide](../getting-started) -- If using standalone WASM mode, provide [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#resourceurl) or a [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#serviceurl) for server mode. +- If using standalone WASM mode, provide [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#resourceurl). ## Steps diff --git a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/mobile-toolbar.md b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/mobile-toolbar.md index bf6c2b05a9..d605d326f4 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/mobile-toolbar.md +++ b/Document-Processing/PDF/PDF-Viewer/react/toolbar-customization/mobile-toolbar.md @@ -18,7 +18,6 @@ This how-to explains how to enable the desktop toolbar on mobile devices running - EJ2 React PDF Viewer installed and imported in your React app. - For standalone mode: a valid [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) hosting the PDF Viewer assets. -- For server-backed mode: a working [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) endpoint. ## Steps @@ -54,29 +53,6 @@ export default function App() { } {% endraw %} {% endhighlight %} -{% highlight ts tabtitle="Server-Backed" %} -{% raw %} -import { - PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer, Inject -} from '@syncfusion/ej2-react-pdfviewer'; -export default function App() { - return ( -
    - - - -
    - ); -} -{% endraw %} -{% endhighlight %} {% endtabs %} ## Troubleshooting @@ -84,7 +60,6 @@ export default function App() { - Print option not visible on mobile: set [`enableDesktopMode`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#enabledesktopmode) to `true`; otherwise the mobile toolbar omits Print. - Touch scrolling is jerky after enabling desktop toolbar: set [`enableTextSelection`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#enabletextselection) to `false` to avoid text-selection capturing touch events. - Missing assets or broken UI: confirm [`resourceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#resourceurl) points to the correct version of the `ej2-pdfviewer-lib` and is reachable from the device. -- Server errors in server-backed mode: verify [`serviceUrl`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#serviceurl) CORS configuration and that the back end is running. ## Related topics diff --git a/Document-Processing/PDF/PDF-Viewer/react/troubleshooting/document-loading-issues.md b/Document-Processing/PDF/PDF-Viewer/react/troubleshooting/document-loading-issues.md index 9a468aa4f1..0a13c2173a 100644 --- a/Document-Processing/PDF/PDF-Viewer/react/troubleshooting/document-loading-issues.md +++ b/Document-Processing/PDF/PDF-Viewer/react/troubleshooting/document-loading-issues.md @@ -25,7 +25,7 @@ let pdfviewer; function App() { function documentLoad() { var viewer = document.getElementById('container').ej2_instances[0]; - viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer"; + viewer.resourceUrl="https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib"; viewer.dataBind(); viewer.load("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf",null); } @@ -53,10 +53,10 @@ root.render(); Troubleshooting checklist (in order) 1. Initialization order: call `dataBind()` before `load()` (required in v23.1+). If using React refs, ensure the ref is available before calling these methods. -2. Verify the document source: confirm the `documentPath`, `serviceUrl`, or `resourceUrl` is correct and returns the expected content. +2. Verify the document source: confirm the `documentPath`, or `resourceUrl` is correct and returns the expected content. 3. Network connectivity: confirm the browser can reach the document URL (check network tab for failed requests). 4. Console errors: inspect the browser console for CORS errors, 4xx/5xx responses, or runtime exceptions. -5. CORS configuration: for cross-origin `serviceUrl` or document URLs, ensure the server sets `Access-Control-Allow-Origin` and allows the `Authorization` header if used. +5. CORS configuration: for cross-origin document URLs, ensure the server sets `Access-Control-Allow-Origin` and allows the `Authorization` header if used. 6. Content Security Policy: confirm CSP allows loading resources from the target origins (scripts, fonts, and media). 7. Version and cache: update to the latest PDF Viewer release and clear caches (browser/Service Worker) to rule out stale assets. 8. Server behavior: if the viewer uses a backend service, verify the service is running and returns correct responses for PDF requests. diff --git a/Document-Processing/PDF/PDF-Viewer/vue/accessibility.md b/Document-Processing/PDF/PDF-Viewer/vue/accessibility.md index 8b0e53e0f4..2c836d5f36 100644 --- a/Document-Processing/PDF/PDF-Viewer/vue/accessibility.md +++ b/Document-Processing/PDF/PDF-Viewer/vue/accessibility.md @@ -237,136 +237,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} diff --git a/Document-Processing/PDF/PDF-Viewer/vue/annotation/free-text-annotation.md b/Document-Processing/PDF/PDF-Viewer/vue/annotation/free-text-annotation.md index bb51d3ef14..e06cbb31bb 100644 --- a/Document-Processing/PDF/PDF-Viewer/vue/annotation/free-text-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/vue/annotation/free-text-annotation.md @@ -108,85 +108,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -301,110 +222,6 @@ export default { -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -506,96 +323,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -731,70 +458,5 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/vue/annotation/ink-annotation.md b/Document-Processing/PDF/PDF-Viewer/vue/annotation/ink-annotation.md index 439912e273..596b6b52f8 100644 --- a/Document-Processing/PDF/PDF-Viewer/vue/annotation/ink-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/vue/annotation/ink-annotation.md @@ -109,87 +109,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -287,95 +206,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -481,103 +311,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -674,70 +407,5 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/vue/annotation/measurement-annotation.md b/Document-Processing/PDF/PDF-Viewer/vue/annotation/measurement-annotation.md index 4bbd28f99e..1881eddc23 100644 --- a/Document-Processing/PDF/PDF-Viewer/vue/annotation/measurement-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/vue/annotation/measurement-annotation.md @@ -116,87 +116,6 @@ export default { } -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - {% endhighlight %} {% endtabs %} @@ -285,339 +204,9 @@ const addVolumeAnnotation = function () {
    - - - - - -
    - - - - -{% endhighlight %} -{% highlight html tabtitle="Composition API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Server-Backed)" %} - - - - - -{% endhighlight %} -{% endtabs %} - -## Edit an existing measurement annotation programmatically - -To modify an existing measurement annotation programmatically, use the editAnnotation() method. - -Here is an example of using editAnnotation(): - -{% tabs %} -{% highlight html tabtitle="Composition API (Standalone)" %} - - - - - -{% endhighlight %} -{% highlight html tabtitle="Options API (Standalone)" %} - -