<template>
|
<div class="pdf-container">
|
<canvas ref="pdfCanvas" class="pdf-canvas"></canvas>
|
</div>
|
</template>
|
|
<script setup>
|
import { ref,onMounted } from 'vue';
|
|
const props = defineProps({
|
pdfUrl: {
|
type: String,
|
required: true
|
}
|
})
|
const pdfCanvas = ref(null);
|
|
const renderPDF = () => {
|
const url = props.pdfUrl;
|
console.log(window.pdfjsLib);
|
}
|
|
onMounted(() => {
|
renderPDF();
|
})
|
|
</script>
|
|
<style lang="scss" scoped>
|
.pdf-container {
|
width: 100%;
|
height: 100%;
|
|
.pdf-canvas {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
</style>
|