要在弹窗打开时将内容缩放为80%,可以使用CSS的'zoom'属性来实现。修改代码如下:

let base = data.rxFile;
let bstr = atob(base);
let n = bstr.length;
let u8arr = new Uint8Array(n);
while (n--) {
    u8arr[n] = bstr.charCodeAt(n);
}
let blob = new Blob([u8arr], {type: 'application/pdf;chartset=UTF-8'});
let url = window.URL.createObjectURL(blob);
let popup = window.open(url);
popup.document.body.style.zoom = '80%';

在上述代码中,我们在打开的弹窗中设置了body元素的'zoom'属性为'80%',这将使弹窗内容缩放为80%。

JavaScript弹窗内容缩放:如何将弹窗内容缩放为80%

原文地址: https://www.cveoy.top/t/topic/cTXr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录