We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在导出的Excel表在打印时的纸张尺寸默认是按照北美纸张Letter尺寸打印的,在宽高比上跟A4纸会有区别,看了一下源码,对比Excel的原始数据结构,发现对write_ws_xml_pagesetup做一点修改即可解决: function write_ws_xml_pagesetup(setup) { var pageSetup = writextag("pageSetup", null, { paperSize: setup.pagesize || "9", scale: setup.scale || "100", orientation: setup.orientation || "portrait", horizontalDpi: setup.horizontalDpi || "4294967293", verticalDpi: setup.verticalDpi || "4294967293" }); return pageSetup } 在pageSetup中增加paperSize: setup.pagesize || "9",这里面的9表示A4纸的尺寸,这样就解决问题了。
The text was updated successfully, but these errors were encountered:
赞赞赞~~~非常感谢,我找空写进去
Sorry, something went wrong.
@sysutt 话说,,我咋没在我这里的 xlsx.js 找到这个函数呢。。
xlsx.js
@wangerzi 我看了一下自己改的文件,原来write_ws_xml_pagesetup这个函数也是我自己加的。。。然后在代码里面找到/* pageSetup */,在后面加上if (ws['!pageSetup'] != null) o[o.length] = write_ws_xml_pagesetup(ws['!pageSetup']); 就OK了
No branches or pull requests
现在导出的Excel表在打印时的纸张尺寸默认是按照北美纸张Letter尺寸打印的,在宽高比上跟A4纸会有区别,看了一下源码,对比Excel的原始数据结构,发现对write_ws_xml_pagesetup做一点修改即可解决:
function write_ws_xml_pagesetup(setup) {
var pageSetup = writextag("pageSetup", null, {
paperSize: setup.pagesize || "9",
scale: setup.scale || "100",
orientation: setup.orientation || "portrait",
horizontalDpi: setup.horizontalDpi || "4294967293",
verticalDpi: setup.verticalDpi || "4294967293"
});
return pageSetup
}
在pageSetup中增加paperSize: setup.pagesize || "9",这里面的9表示A4纸的尺寸,这样就解决问题了。
The text was updated successfully, but these errors were encountered: