|
| 1 | +<template> |
| 2 | + <div id="app"> |
| 3 | + <ejs-pdfviewer |
| 4 | + id="pdfViewer" |
| 5 | + :documentPath="documentPath" |
| 6 | + :serviceUrl="serviceUrl" |
| 7 | + :printScaleFactor="printScaleFactor" |
| 8 | + > |
| 9 | + </ejs-pdfviewer> |
| 10 | + </div> |
| 11 | +</template> |
| 12 | + |
| 13 | +<script> |
| 14 | +import Vue from 'vue'; |
| 15 | +import { PdfViewerPlugin, Toolbar, Magnification, Navigation, |
| 16 | + Annotation, LinkAnnotation, BookmarkView, ThumbnailView, |
| 17 | + Print, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer } from '@syncfusion/ej2-vue-pdfviewer'; |
| 18 | + Vue.use(PdfViewerPlugin); |
| 19 | +
|
| 20 | + export default { |
| 21 | + name: 'app', |
| 22 | + data() { |
| 23 | + return { |
| 24 | + serviceUrl: "https://services.syncfusion.com/vue/production/api/pdfviewer", |
| 25 | + documentPath: "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf", |
| 26 | + //By Changing the printScaleFactor value we can adjust the quality of the PDF file. |
| 27 | + printScaleFactor: 0.5, |
| 28 | + }; |
| 29 | + }, |
| 30 | +
|
| 31 | + provide: { |
| 32 | + PdfViewer: [ Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, |
| 33 | + Print, TextSelection, TextSearch, Annotation, FormDesigner, FormFields, PageOrganizer ]}, |
| 34 | + |
| 35 | +} |
| 36 | +
|
| 37 | +</script> |
| 38 | + |
| 39 | +<style> |
| 40 | + @import "../node_modules/@syncfusion/ej2-base/styles/material.css"; |
| 41 | + @import "../node_modules/@syncfusion/ej2-buttons/styles/material.css"; |
| 42 | + @import "../node_modules/@syncfusion/ej2-dropdowns/styles/material.css"; |
| 43 | + @import "../node_modules/@syncfusion/ej2-inputs/styles/material.css"; |
| 44 | + @import "../node_modules/@syncfusion/ej2-navigations/styles/material.css"; |
| 45 | + @import "../node_modules/@syncfusion/ej2-popups/styles/material.css"; |
| 46 | + @import "../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css"; |
| 47 | + @import "../node_modules/@syncfusion/ej2-vue-pdfviewer/styles/material.css"; |
| 48 | +</style> |
0 commit comments