Styled box with text

370 views
Skip to first unread message

lewy

unread,
Mar 28, 2011, 4:11:51 PM3/28/11
to Prawn
Hello I try to build styled Box with text inside.

I want set :border_color,:font_size,:text_align,:text_color

http://stackoverflow.com/questions/5436497/prawn-styling-cell-object
=> more explanation

I tried use Prawn::Table::Cell:Text

Prawn::Table::Cell::Text.new(self.pdf,[10,10],:content => "My
text",:text_color => "xxx",:width => 300)

and it works but it also overlaps another bounding box. Also I don't
know how to turn on borders (I try use :inline_format => true)

Here is code

ps: method make_header should do all work

http://pastie.org/1727740

prawn (0.11.1.pre 8ed4c22)

Brad Ediger

unread,
Mar 28, 2011, 4:53:33 PM3/28/11
to prawn...@googlegroups.com, lewy
On Mon, Mar 28, 2011 at 3:11 PM, lewy <lew...@gmail.com> wrote:
> Hello I try to build styled Box with text inside.
>
> I want set :border_color,:font_size,:text_align,:text_color
>
> http://stackoverflow.com/questions/5436497/prawn-styling-cell-object
> => more explanation
>
> I tried use Prawn::Table::Cell:Text
>
> Prawn::Table::Cell::Text.new(self.pdf,[10,10],:content => "My
> text",:text_color => "xxx",:width => 300)

You're using Prawn's old table syntax with a new release of Prawn.
Look here for examples on the new syntax in 0.10+:

https://github.com/sandal/prawn/tree/master/examples/table

Brad

Reply all
Reply to author
Forward
0 new messages