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.3 to 1.0.4

2

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

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

@@ -102,3 +102,9 @@ import resizeSensor from 'vue-resize-sensor'

this.$on('loaded', function() {
let docheight = document.getElementById(this.container).offsetHeight;
let calHeight = this.pdf.getCanvas().offsetWidth * (this.pdf.getCanvas().height / this.pdf.getCanvas().width);
if (calHeight > docheight) {
calHeight = docheight;
}
this.pdf.setCanvasHeight(calHeight + 'px');
this.pdf.loadPage(this.page, this.rotate);

@@ -105,0 +111,0 @@ });

@@ -230,4 +230,2 @@ import { CMapCompressionType } from 'pdfjs-dist/lib/shared/util';

console.log("-------容器的大小--------");
console.log(canvasElt.offsetWidth, canvasElt.offsetHeight);
var scale = canvasElt.offsetWidth / pdfPage.getViewport(1).width * (window.devicePixelRatio || 1);

@@ -245,4 +243,3 @@ //如果按照宽度计算下来的比例。大于容器的高度,那么按照容器高度来进行比例计算

canvasElt.height = viewport.height;
console.log("------计算后的大小------");
console.log(viewport.width, viewport.height);
canvasElt.style.width = viewport.width + "px";
pdfRender = pdfPage.render({

@@ -249,0 +246,0 @@ canvasContext: canvasElt.getContext('2d'),

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