|
| 1 | +<template> |
| 2 | + <div id="app"> |
| 3 | + <ejs-pdfviewer |
| 4 | + id="pdfViewer" |
| 5 | + ref="pdfviewer" |
| 6 | + :documentPath="documentPath" |
| 7 | + :resourceUrl="resourceUrl" |
| 8 | + @annotationAdd="handleAnnotationAdd"> |
| 9 | + </ejs-pdfviewer> |
| 10 | + </div> |
| 11 | +</template> |
| 12 | + |
| 13 | +<script> |
| 14 | +
|
| 15 | +import { PdfViewerComponent, Toolbar, Magnification, Navigation, |
| 16 | + LinkAnnotation, BookmarkView, Annotation, ThumbnailView, |
| 17 | + Print, TextSelection, TextSearch, FormFields, FormDesigner,PageOrganizer } from '@syncfusion/ej2-vue-pdfviewer'; |
| 18 | +
|
| 19 | +
|
| 20 | +export default { |
| 21 | + name: 'App', |
| 22 | + components: { |
| 23 | + "ejs-pdfviewer": PdfViewerComponent |
| 24 | + }, |
| 25 | + data () { |
| 26 | + return { |
| 27 | + resourceUrl:"https://cdn.syncfusion.com/ej2/27.2.2/dist/ej2-pdfviewer-lib", |
| 28 | + documentPath:"https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf" |
| 29 | + }; |
| 30 | + }, |
| 31 | + provide: { |
| 32 | + PdfViewer: [ Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, Annotation, |
| 33 | + ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer ]}, |
| 34 | +
|
| 35 | + methods: { |
| 36 | + handleAnnotationAdd(args) { |
| 37 | + console.log(args); // Log the event arguments |
| 38 | + } |
| 39 | + } |
| 40 | +} |
| 41 | +</script> |
| 42 | + |
| 43 | +<style> |
| 44 | + @import "../node_modules/@syncfusion/ej2-base/styles/material.css"; |
| 45 | + @import "../node_modules/@syncfusion/ej2-buttons/styles/material.css"; |
| 46 | + @import "../node_modules/@syncfusion/ej2-dropdowns/styles/material.css"; |
| 47 | + @import "../node_modules/@syncfusion/ej2-inputs/styles/material.css"; |
| 48 | + @import "../node_modules/@syncfusion/ej2-navigations/styles/material.css"; |
| 49 | + @import "../node_modules/@syncfusion/ej2-popups/styles/material.css"; |
| 50 | + @import "../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css"; |
| 51 | + @import "../node_modules/@syncfusion/ej2-vue-pdfviewer/styles/material.css"; |
| 52 | +</style> |
0 commit comments