vue-pdf-eurlanda
Advanced tools
Comparing version 1.0.14 to 1.0.15
{ | ||
"name": "vue-pdf-eurlanda", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "vue.js pdf viewer", | ||
@@ -5,0 +5,0 @@ "main": "src/vuePdfNoSss.vue", |
@@ -59,3 +59,3 @@ import { CMapCompressionType } from 'pdfjs-dist/lib/shared/util'; | ||
var canvasElt = document.createElement('canvas'); | ||
canvasElt.style.display = 'block'; | ||
canvasElt.style = { 'display': flex, 'justify-content': 'center' }; | ||
canvasElt.style.width = '100%'; | ||
@@ -84,3 +84,2 @@ canvasParent.appendChild(canvasElt); | ||
this.setCanvasHeight = function(h) { | ||
console.log("setCanvasHeight:" + h); | ||
canvasElt.style.height = h | ||
@@ -233,7 +232,3 @@ } | ||
var docWidth = document.getElementById(container).offsetWidth; | ||
console.log("------屏幕宽度------"); | ||
console.log(docWidth); | ||
var scale = docWidth / pdfPage.getViewport(1).width * (window.devicePixelRatio || 1); | ||
console.log("实际高度:" + canvasElt.offsetHeight); | ||
console.log("计算后的高度:" + pdfPage.getViewport(1).height * scale); | ||
//如果按照宽度计算下来的比例。大于容器的高度,那么按照容器高度来进行比例计算 | ||
@@ -250,3 +245,2 @@ if (pdfPage.getViewport(1).height * scale > canvasElt.offsetHeight) { | ||
canvasElt.height = viewport.height; | ||
console.log("给canvas赋值:" + viewport.height); | ||
canvasElt.style.width = viewport.width + "px"; | ||
@@ -253,0 +247,0 @@ canvasElt.style.height = viewport.height + "px"; |
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
32439
534