forked from practicingruby/prawn-layout
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41985c3
commit f43750a
Showing
16 changed files
with
2,171 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
id,name,phone,street,town,state | ||
1,Inky,555-000-1234,Druary Lane,Union City,CT | ||
2,Blinky,525-0529-123,Apple Street,Robot Town,NJ | ||
3,Clyde,247-219-4820,Sandbox Hill,Alvin's Landing,PA | ||
4,Pacman,283-102-8293,Rat Avenue,Southford,VT | ||
5,Mrs. Pacman,214-892-1892,Conch Walk,New York,NY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# encoding: utf-8 | ||
# | ||
# Low level cell and row implementation, which form the basic building | ||
# blocks for Prawn tables. Only necessary to know about if you plan on | ||
# building your own table implementation from scratch or heavily modify | ||
# the existing table system. | ||
# | ||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib')) | ||
|
||
require "rubygems" | ||
require "prawn" | ||
require "prawn/layout" | ||
|
||
Prawn::Document.generate("cell.pdf") do | ||
cell = Prawn::Table::Cell.new( | ||
:border_width => 3, :padding => 10, :width => 75, | ||
:text => "You know that kittens are made of mud!", :document => self) | ||
cell2 = Prawn::Table::Cell.new( | ||
:border_width => 3, :padding => 10, | ||
:text => "And that puppies are made of gravy", :document => self, :font_size => 9) | ||
cell3 = Prawn::Table::Cell.new( | ||
:border_width => 3, :padding => 10, :width => 100, | ||
:text => "This is simply the way of the world", :document => self) | ||
|
||
3.times do | ||
cellblock = Prawn::Table::CellBlock.new(self) | ||
cellblock << cell << cell2 << cell3 | ||
cellblock.draw | ||
end | ||
|
||
move_down(20) | ||
|
||
cellblock = Prawn::Table::CellBlock.new(self) | ||
cellblock << Prawn::Table::Cell.new( | ||
:border_width => 3, | ||
:padding => 10, | ||
:borders => [:left, :top], | ||
:width => 100, | ||
:text => "This is simply the way of the world", :document => self) | ||
cellblock.draw | ||
|
||
stroke_line [100,100], [200,200] | ||
end |
Oops, something went wrong.