Commit b47879fb authored by zhengke's avatar zhengke

预览PDF 尺寸调整

parent a0dc2ea2
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<ThumbnailSlide <ThumbnailSlide
class="thumbnail" class="thumbnail"
:slide="currentSlide" :slide="currentSlide"
:size="1600" :size="viewportRatio<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE"
v-if="rangeType === 'current'" v-if="rangeType === 'current'"
/> />
<template v-else> <template v-else>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
v-for="(slide, index) in slides" v-for="(slide, index) in slides"
:key="slide.id" :key="slide.id"
:slide="slide" :slide="slide"
:size="1600" :size="viewportRatio<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE"
/> />
</template> </template>
</div> </div>
...@@ -66,6 +66,7 @@ import { ref } from 'vue' ...@@ -66,6 +66,7 @@ import { ref } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useSlidesStore } from '@/store' import { useSlidesStore } from '@/store'
import { print } from '@/utils/print' import { print } from '@/utils/print'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue' import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import Switch from '@/components/Switch.vue' import Switch from '@/components/Switch.vue'
...@@ -87,9 +88,10 @@ const padding = ref(true) ...@@ -87,9 +88,10 @@ const padding = ref(true)
const expPDF = () => { const expPDF = () => {
if (!pdfThumbnailsRef.value) return if (!pdfThumbnailsRef.value) return
const width = viewportRatio<1 ? VIEWPORT_SIZE : VIEWPORT_VER_SIZE
const pageSize = { const pageSize = {
width: 1600, width: width,
height: rangeType.value === 'all' ? 1600 * viewportRatio.value * count.value : 1600 * viewportRatio.value, height: rangeType.value === 'all' ? width * viewportRatio.value * count.value : width * viewportRatio.value,
margin: padding.value ? 50 : 0, margin: padding.value ? 50 : 0,
} }
print(pdfThumbnailsRef.value, pageSize) 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