diff --git a/README.md b/README.md
index 8c5ada2..358f542 100644
--- a/README.md
+++ b/README.md
@@ -419,6 +419,7 @@ Special worksheet keys (accessible as `worksheet[key]`, each starting with `!`):
will write all cells in the merge range if they exist, so be sure that only
the first cell (upper-left) in the range is set.
+- `ws['!pageSetup']`: `{scale: '100', orientation: 'portrait'||'landscape'}
### Workbook Object
`workbook.SheetNames` is an ordered list of the sheets in the workbook
diff --git a/bits/67_wsxml.js b/bits/67_wsxml.js
index 1c4937c..a7cef3c 100644
--- a/bits/67_wsxml.js
+++ b/bits/67_wsxml.js
@@ -71,12 +71,14 @@ function write_ws_xml_merges(merges) {
}
function write_ws_xml_pagesetup(setup) {
- return writextag('pageSetup', {
- scale: setup.scale || 'scale',
+ var pageSetup = writextag('pageSetup', null, {
+ scale: setup.scale || '100',
orientation: setup.orientation || 'portrait',
horizontalDpi : setup.horizontalDpi || '4294967292',
verticalDpi : setup.verticalDpi || '4294967292'
})
+ console.log(pageSetup);
+ return pageSetup;
}
//
@@ -333,9 +335,10 @@ function write_ws_xml(idx, opts, wb) {
if(ws['!merges'] !== undefined && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));
+ if (ws['!pageSetup'] !== undefined) o[o.length] = write_ws_xml_pagesetup(ws['!pageSetup'])
if (ws['!rowBreaks'] !== undefined) o[o.length] = write_ws_xml_row_breaks(ws['!rowBreaks'])
if (ws['!colBreaks'] !== undefined) o[o.length] = write_ws_xml_col_breaks(ws['!colBreaks'])
- if (ws['!pageSetup'] !== undefined) o[o.length] = write_ws_xml_pagesetup(ws['!pageSetup'])
+
if(o.length>2) { o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
return o.join("");
@@ -356,7 +359,7 @@ function write_ws_xml_col_breaks(breaks) {
var brk = [];
for (var i=0; i
@@ -7858,9 +7860,10 @@ function write_ws_xml(idx, opts, wb) {
if(ws['!merges'] !== undefined && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));
+ if (ws['!pageSetup'] !== undefined) o[o.length] = write_ws_xml_pagesetup(ws['!pageSetup'])
if (ws['!rowBreaks'] !== undefined) o[o.length] = write_ws_xml_row_breaks(ws['!rowBreaks'])
if (ws['!colBreaks'] !== undefined) o[o.length] = write_ws_xml_col_breaks(ws['!colBreaks'])
- if (ws['!pageSetup'] !== undefined) o[o.length] = write_ws_xml_pagesetup(ws['!pageSetup'])
+
if(o.length>2) { o[o.length] = (''); o[1]=o[1].replace("/>",">"); }
return o.join("");
@@ -7881,7 +7884,7 @@ function write_ws_xml_col_breaks(breaks) {
var brk = [];
for (var i=0; i