本方法适用于下载到本地的文件的xlsx.js
-
找到
xlsx.core.min.js
文件 -
搜索
write_ws_xml_pagesetup
方法 -
找到下面这行
write_ws_xml_pagesetup(setup){var pageSetup=writextag("pageSetup",null,{scale:setup.scale||"100",orientation:setup.orientation||"portrait",horizontalDpi:setup.horizontalDpi||"4294967292",verticalDpi:setup.verticalDpi||"4294967292"});
-
在
write_ws_xml_pagesetup
方法中添加paperSize: setup.pagesize || "9",
-
结果为:
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||"4294967292",verticalDpi:setup.verticalDpi||"4294967292"});
-
结构参考
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 }