Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-pdf-eurlanda

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-pdf-eurlanda - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "vue-pdf-eurlanda",
"version": "1.0.5",
"version": "1.0.6",
"description": "vue.js pdf viewer",

@@ -5,0 +5,0 @@ "main": "src/vuePdfNoSss.vue",

@@ -73,2 +73,3 @@ import resizeSensor from 'vue-resize-sensor'

return;
let calHeight = this.pdf.getCanvas().offsetWidth * (this.pdf.getCanvas().height / this.pdf.getCanvas().width);

@@ -116,3 +117,2 @@ if (calHeight > height) {

//let width = document.getElementById(this.container).offsetWidth;
tnis.pdf.getCanvas().style.width = width + "px";
let docheight = document.getElementById(this.container).offsetHeight;

@@ -119,0 +119,0 @@ let calHeight = this.pdf.getCanvas().offsetWidth * (this.pdf.getCanvas().height / this.pdf.getCanvas().width);

@@ -229,9 +229,14 @@ import { CMapCompressionType } from 'pdfjs-dist/lib/shared/util';

}
var scale = canvasElt.offsetWidth / 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);
//这里先使用高度作为缩放比例
var scale = canvasElt.offsetHeight / pdfPage.getViewport(1).width * (window.devicePixelRatio || 1);
//计算如果使用高度作为缩放比例,计算宽度
var calWidth = pdfPage.getViewport(1) * scale;
//如果使用宽度比例计算下来的宽度大于容器的宽度,那么使用宽度作为缩放比例
if (calWidth > canvasElt.offsetWidth) {
scale = canvasElt.offsetWidth / 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);
}
}
var viewport = pdfPage.getViewport(scale, rotate);

@@ -243,2 +248,3 @@

canvasElt.height = viewport.height;
canvasElt.style.width = viewport.width + 'px';
pdfRender = pdfPage.render({

@@ -391,3 +397,3 @@ canvasContext: canvasElt.getContext('2d'),

annotationLayerElt.style.transformOrigin = '0 0';
//annotationLayerElt.style.transformOrigin = '0 0';
}

@@ -394,0 +400,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc