Skip to content

Instantly share code, notes, and snippets.

@pocari
Created June 22, 2022 16:54
Show Gist options
  • Save pocari/b9cc556530b45e7d9ddddeee2a160f4a to your computer and use it in GitHub Desktop.
Save pocari/b9cc556530b45e7d9ddddeee2a160f4a to your computer and use it in GitHub Desktop.
require 'prawn'
require 'prawn/table'
Prawn::Document.generate("output.pdf") do
str1 = <<~EOS
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
EOS
data = [
['header1', 'header2', 'header3', 'header4'],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", {content: str1, rowspan: 2}, ''],
['hoge', "fuga\npiyo", '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
['hoge', "fuga\npiyo", 'foo', '', ],
]
table(data, header: true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment