mirror of
https://gitee.com/Donal/ofd.js.git
synced 2024-11-29 18:38:55 +08:00
调整width
This commit is contained in:
parent
0f808226da
commit
24acd9dfd2
@ -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渲染",
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user