Commit b47879fb authored by zhengke's avatar zhengke

预览PDF 尺寸调整

parent a0dc2ea2
......@@ -5,7 +5,7 @@
<ThumbnailSlide
class="thumbnail"
:slide="currentSlide"
:size="1600"
:size="viewportRatio<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE"
v-if="rangeType === 'current'"
/>
<template v-else>
......@@ -15,7 +15,7 @@
v-for="(slide, index) in slides"
:key="slide.id"
:slide="slide"
:size="1600"
:size="viewportRatio<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE"
/>
</template>
</div>
......@@ -66,6 +66,7 @@ import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useSlidesStore } from '@/store'
import { print } from '@/utils/print'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import Switch from '@/components/Switch.vue'
......@@ -87,9 +88,10 @@ const padding = ref(true)
const expPDF = () => {
if (!pdfThumbnailsRef.value) return
const width = viewportRatio<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE
const pageSize = {
width: 1600,
height: rangeType.value === 'all' ? 1600 * viewportRatio.value * count.value : 1600 * viewportRatio.value,
width: width,
height: rangeType.value === 'all' ? width * viewportRatio.value * count.value : width * viewportRatio.value,
margin: padding.value ? 50 : 0,
}
print(pdfThumbnailsRef.value, pageSize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment