vue-pdf-eurlanda
Advanced tools
Comparing version 1.0.35 to 1.0.36
@@ -31,3 +31,3 @@ { | ||
"scripts": {}, | ||
"version": "1.0.35" | ||
"version": "1.0.36" | ||
} |
@@ -124,2 +124,4 @@ import resizeSensor from 'vue-resize-sensor' | ||
let docheight = document.getElementById(this.container).offsetHeight; | ||
console.log("-------获取的高度----------"); | ||
console.log(docheight); | ||
this.pdf.setCanvasHeight(docheight + "px"); | ||
@@ -126,0 +128,0 @@ this.pdf.loadDocument(this.src); |
@@ -230,6 +230,7 @@ import { CMapCompressionType } from 'pdfjs-dist/lib/shared/util'; | ||
var docWidth = document.getElementById(container).offsetWidth; | ||
var docOffset = document.getElementById(container).offsetHeight; | ||
var scale = docWidth / pdfPage.getViewport(1).width * (window.devicePixelRatio || 1); | ||
//如果按照宽度计算下来的比例。大于容器的高度,那么按照容器高度来进行比例计算 | ||
if (pdfPage.getViewport(1).height * scale > canvasElt.offsetHeight) { | ||
scale = canvasElt.offsetHeight / pdfPage.getViewport(1).height * (window.devicePixelRatio || 1); | ||
scale = docOffset / pdfPage.getViewport(1).height * (window.devicePixelRatio || 1); | ||
} | ||
@@ -236,0 +237,0 @@ var viewport = pdfPage.getViewport(scale, rotate); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32616
538