We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcfef7d commit d314640Copy full SHA for d314640
1 file changed
src/pwa/src/fileParser/pdf.ts
@@ -36,14 +36,11 @@ export const handlePdf = async (file: File): Promise<ImgFile[]> => {
36
plimit(
37
range(pdf.numPages, (i) => async () => {
38
const page = await pdf.getPage(i + 1);
39
- const [, , width, height] = page.view;
+ const [, , width] = page.view;
40
let scale = 1;
41
42
- // 缩放图片适应屏幕
43
- if (height > width) {
44
- if (height < document.body.clientHeight)
45
- scale = document.body.clientHeight / height;
46
- } else if (width < document.body.clientWidth)
+ // 缩放图片适应页宽
+ if (width < document.body.clientWidth)
47
scale = document.body.clientWidth / width;
48
49
const viewport = page.getViewport({ scale });
0 commit comments