调整width

This commit is contained in:
Donal 2020-09-27 11:40:33 +08:00
parent 0f808226da
commit 24acd9dfd2
4 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ofd.js",
"version": "0.1.5",
"version": "0.1.7",
"main": "lib/ofd.umd.min.js",
"author": "dltech21",
"description": "ofd渲染",

View File

@ -349,10 +349,11 @@ export default {
// this.$toast('error', " < 5M");
return;
}
let that = this;
let reader = new FileReader();
reader.readAsDataURL(this.file);
reader.onload = function (e) {
this.ofdBase64 = e.target.result.split(',')[1];
that.ofdBase64 = e.target.result.split(',')[1];
}
this.getOfdDocumentObj(this.file, this.screenWidth);
this.$refs.file.value = null;

View File

@ -77,8 +77,7 @@ export const calPageBox = function (screenWidth, document, page) {
}
}
let array = box.split(' ');
const scale = ((screenWidth - 5) / parseFloat(array[2])).toFixed(1);
console.log(scale)
const scale = ((screenWidth - 10) / parseFloat(array[2])).toFixed(1);
setMaxPageScal(scale);
setPageScal(scale);
box = parseStBox( box);

View File

@ -109,7 +109,7 @@ export const setMaxPageScal = function (scale) {
}
export const setPageScal = function (scale) {
scale = Math.ceil(scale);
// scale = Math.ceil(scale);
Scale = scale > 1 ? scale: 1;
Scale = Scale > MaxScale ? MaxScale: Scale;
}