@@ -239,7 +239,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
239239 Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer])
240240
241241const documentLoad = () => {
242- const viewer = this . $refs . pdfviewer .ej2Instances ;
242+ const viewer = pdfviewer . value .ej2Instances ;
243243 document .getElementById (' set' ).addEventListener (' click' , () => {
244244 viewer .annotation .setAnnotationMode (' Highlight' );
245245 });
@@ -329,7 +329,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
329329 Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer])
330330
331331const documentLoad = () => {
332- const viewer = this . $refs . pdfviewer .ej2Instances ;
332+ const viewer = pdfviewer . value .ej2Instances ;
333333 document .getElementById (' set' ).addEventListener (' click' , () => {
334334 viewer .annotation .setAnnotationMode (' Highlight' );
335335 });
@@ -425,7 +425,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
425425 ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer])
426426
427427const addAnnotation = function () {
428- const viewer = this . $refs . pdfviewer .ej2Instances ;
428+ const viewer = pdfviewer . value .ej2Instances ;
429429 viewer .annotation .addAnnotation (" Highlight" , {
430430 bounds: [{ x: 97 , y: 110 , width: 350 , height: 14 }],
431431 pageNumber: 1
@@ -947,7 +947,7 @@ Programmatically add underlines using the [addAnnotation](https://ej2.syncfusion
947947Example:
948948
949949{% tabs %}
950- {% highlight html tabtitle="Composition API (~ /src/App.vue )" %}
950+ {% highlight html tabtitle="Composition API (Standalone )" %}
951951
952952<template >
953953 <div id =" app " >
@@ -983,7 +983,7 @@ const addAnnotation = function () {
983983</script >
984984
985985{% endhighlight %}
986- {% highlight html tabtitle="Standalone" %}
986+ {% highlight html tabtitle="Options API ( Standalone) " %}
987987
988988<template >
989989 <div id =" app " >
@@ -1162,7 +1162,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
11621162 Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer])
11631163
11641164const documentLoad = () => {
1165- const viewer = this . $refs . pdfviewer .ej2Instances ;
1165+ const viewer = pdfviewer . value .ej2Instances ;
11661166 document .getElementById (' set' ).addEventListener (' click' , () => {
11671167 viewer .annotation .setAnnotationMode (' Strikethrough' );
11681168 });
@@ -1216,7 +1216,7 @@ export default {
12161216</script >
12171217
12181218{% endhighlight %}
1219- {% highlight html tabtitle="Composition API (~ /src/App.vue )" %}
1219+ {% highlight html tabtitle="Composition API (Server-Backed )" %}
12201220
12211221<template >
12221222 <div id =" app " >
@@ -1686,7 +1686,7 @@ In the pan mode, if the squiggly mode is entered, the PDF Viewer control will sw
16861686Refer to the following code snippet to switch to squiggly mode.
16871687
16881688{% tabs %}
1689- {% highlight html tabtitle="Composition API (~ /src/App.vue )" %}
1689+ {% highlight html tabtitle="Composition API (Standalone )" %}
16901690
16911691<template >
16921692 <div id =" app " >
@@ -1713,7 +1713,7 @@ provide('PdfViewer', [Toolbar, Magnification, Navigation, LinkAnnotation, Bookma
17131713 Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer])
17141714
17151715const documentLoad = () => {
1716- const viewer = this . $refs . pdfviewer .ej2Instances ;
1716+ const viewer = pdfviewer . value .ej2Instances ;
17171717 document .getElementById (' set' ).addEventListener (' click' , () => {
17181718 viewer .annotation .setAnnotationMode (' Squiggly' );
17191719 });
@@ -1767,7 +1767,7 @@ export default {
17671767</script >
17681768
17691769{% endhighlight %}
1770- {% highlight html tabtitle="Composition API (~ /src/App.vue )" %}
1770+ {% highlight html tabtitle="Composition API (Server-Backed )" %}
17711771
17721772<template >
17731773 <div id =" app " >
@@ -2426,45 +2426,35 @@ Refer to the following code snippet for calling undo and redo actions from the c
24262426 <button id="undo">Undo</button>
24272427 <button id="redo">Redo</button>
24282428 <ejs-pdfviewer id="pdfViewer" ref="pdfviewer" :documentPath="documentPath" :resourceUrl="resourceUrl"
2429- :documentLoad="documentLoad">
2429+ :documentLoad="documentLoad" :style="{ height: '800px', width: '1200px' }" >
24302430 </ejs-pdfviewer>
24312431 </div >
24322432</template >
24332433
24342434<script setup >
24352435
24362436import {
2437- PdfViewerComponent , Toolbar , Magnification , Navigation , LinkAnnotation ,
2437+ PdfViewerComponent as EjsPdfviewer , Toolbar , Magnification , Navigation , LinkAnnotation ,
24382438 BookmarkView , Annotation , ThumbnailView , Print , TextSelection ,
24392439 TextSearch , FormFields , FormDesigner , PageOrganizer
24402440} from ' @syncfusion/ej2-vue-pdfviewer' ;
2441+ import { provide , ref } from ' vue' ;
24412442
2442- export default {
2443- name: " App" ,
2444- components: {
2445- " ejs-pdfviewer" : PdfViewerComponent
2446- },
2447- data () {
2448- return {
2449- documentPath: " https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" ,
2450- resourceUrl: ' https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib' ,
2451- };
2452- },
2453- provide: {
2454- PdfViewer: [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,
2455- Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer]
2456- },
2457- methods: {
2458- documentLoad () {
2459- viewer = this .$refs .pdfviewer .ej2Instances ;
2460- document .getElementById (' undo' ).addEventListener (' click' , () => {
2461- viewer .undo ();
2462- });
2463- document .getElementById (' redo' ).addEventListener (' click' , () => {
2464- viewer .redo ();
2465- });
2466- }
2467- }
2443+ const documentPath = " https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" ;
2444+ const resourceUrl = ' https://cdn.syncfusion.com/ej2/31.2.2/dist/ej2-pdfviewer-lib' ;
2445+ const pdfviewer = ref (null );
2446+
2447+ provide (' PdfViewer' , [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,
2448+ Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer])
2449+
2450+ const documentLoad = function () {
2451+ const viewer = pdfviewer .value .ej2Instances ;
2452+ document .getElementById (' undo' ).addEventListener (' click' , () => {
2453+ viewer .undo ();
2454+ });
2455+ document .getElementById (' redo' ).addEventListener (' click' , () => {
2456+ viewer .redo ();
2457+ });
24682458}
24692459</script >
24702460
@@ -2506,7 +2496,7 @@ export default {
25062496 },
25072497 methods: {
25082498 documentLoad () {
2509- viewer = this .$refs .pdfviewer .ej2Instances ;
2499+ const viewer = this .$refs .pdfviewer .ej2Instances ;
25102500 document .getElementById (' undo' ).addEventListener (' click' , () => {
25112501 viewer .undo ();
25122502 });
@@ -2519,7 +2509,7 @@ export default {
25192509</script >
25202510
25212511{% endhighlight %}
2522- {% highlight html tabtitle="Composition API (~ /src/App.vue )" %}
2512+ {% highlight html tabtitle="Composition API (Server-Backed )" %}
25232513
25242514<template >
25252515 <div id =" app " >
@@ -2538,16 +2528,17 @@ import {
25382528 BookmarkView , Annotation , ThumbnailView , Print , TextSelection ,
25392529 TextSearch , FormFields , FormDesigner , PageOrganizer
25402530} from ' @syncfusion/ej2-vue-pdfviewer' ;
2541- import { provide } from ' vue' ;
2531+ import { provide , ref } from ' vue' ;
25422532
25432533const serviceUrl = " https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer" ;
25442534const documentPath = " https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" ;
2535+ const pdfviewer = ref (null );
25452536
25462537provide (' PdfViewer' , [Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,
25472538 Print, TextSelection, TextSearch, Annotation, FormFields, FormDesigner, PageOrganizer])
25482539
25492540const documentLoad = function () {
2550- const viewer = this . $refs . pdfviewer .ej2Instances ;
2541+ const viewer = pdfviewer . value .ej2Instances ;
25512542 document .getElementById (' undo' ).addEventListener (' click' , () => {
25522543 viewer .undo ();
25532544 });
@@ -2559,7 +2550,7 @@ const documentLoad = function () {
25592550</script >
25602551
25612552{% endhighlight %}
2562- {% highlight html tabtitle="Server-Backed" %}
2553+ {% highlight html tabtitle="Options API ( Server-Backed) " %}
25632554
25642555<template >
25652556 <div id =" app " >
0 commit comments