summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-02 13:03:42 +0900
committerRandy Morgan <[email protected]>2012-09-02 13:03:42 +0900
commitccbb0925fc4b4bae863e5be6a37d4c51f280836a (patch)
treefb2f12c7d89158d3a993afb27a59553b4798abab /examples
parent8f237fdc5aa18c17b5474e8d2b5454a87c89cb56 (diff)
downloadcaxlsx-ccbb0925fc4b4bae863e5be6a37d4c51f280836a.tar.gz
caxlsx-ccbb0925fc4b4bae863e5be6a37d4c51f280836a.zip
implement paper_size as at least some version of office ignore the paper width and paper height page setup attributes.
See PageSetup#paper_size for a list of sizes supported in the specification.
Diffstat (limited to 'examples')
-rw-r--r--examples/page_setup.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/page_setup.rb b/examples/page_setup.rb
new file mode 100644
index 00000000..964ed10d
--- /dev/null
+++ b/examples/page_setup.rb
@@ -0,0 +1,9 @@
+$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
+require 'axlsx'
+xls = Axlsx::Package.new
+wb = xls.workbook
+wb.add_worksheet do |ws|
+ ws.page_setup.set :paper_width => "210mm", :paper_size => 10, :paper_height => "297mm", :orientation => :landscape
+ ws.add_row %w(AXLSX is cool)
+end
+xls.serialize "page_setup.xlsx"