| | |
| | | Header: typeof import('./src/components/Header/index.vue')['default'] |
| | | HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] |
| | | NormalHeader: typeof import('./src/components/NormalHeader/index.vue')['default'] |
| | | PDFViewer: typeof import('./src/components/PDFViewer/index.vue')['default'] |
| | | PDFVIewer: typeof import('./src/components/PDFVIewer/index.vue')['default'] |
| | | RouterLink: typeof import('vue-router')['RouterLink'] |
| | | RouterView: typeof import('vue-router')['RouterView'] |
| | |
| | | <title>Vite + Vue</title> |
| | | <!-- 生产版本换源 --> |
| | | <script src='https://meet.jit.si/external_api.js'></script> |
| | | <script src='./public/pdfjs/build/pdf.mjs'></script> |
| | | </head> |
| | | <body> |
| | | <div id="app"></div> |
| | |
| | | <script> |
| | | window.onload = () => { |
| | | window.JitsiMeetExternalAPI = JitsiMeetExternalAPI; |
| | | window.pdfjsLib = pdfjsLib; |
| | | } |
| | | </script> |
| | | </body> |
| | |
| | | </span> |
| | | <span id="numPages" class="toolbarLabel"></span> |
| | | </div> |
| | | <div id="toolbarViewerRight"> |
| | | <div id="toolbarViewerRight" style="display: none;"> |
| | | <div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup"> |
| | | <button id="editorHighlight" class="toolbarButton" hidden="true" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button"> |
| | | <span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span> |
| | |
| | | <template> |
| | | <div class="pdf-container"> |
| | | <canvas ref="pdfCanvas" class="pdf-canvas"></canvas> |
| | | <iframe :src="fileUrl" width="100%" height="100%"></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | type: String, |
| | | required: true |
| | | } |
| | | }) |
| | | const pdfCanvas = ref(null); |
| | | }); |
| | | const viewerUrl = '/pdfjs/web/viewer.html?file='; // pdfjs文件地址 |
| | | |
| | | const fileUrl = ref(''); |
| | | |
| | | |
| | | const renderPDF = () => { |
| | | const url = props.pdfUrl; |
| | | console.log(window.pdfjsLib); |
| | | } |
| | | fileUrl.value = viewerUrl + encodeURIComponent(props.pdfUrl); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | renderPDF(); |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="pdf-container"> |
| | | <PDFViewer :pdfUrl="'/helloworld.pdf'"></PDFViewer> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | |
| | | .pdf-container { |
| | | width: 800px; |
| | | height: 800px; |
| | | position: absolute; |
| | | z-index: 2; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | </style> |