Marco
Marco

Reputation: 10823

Prawn text_box border

I'm using Prawn 2-0.2.4 to make pdf over Rails 3.1 application. I'm a great issue; I'm not able to see text_box border; this is my action:

def firma_conducente
  text_box "Firma Conducente ________  Firma Cessionario _____", :rotate => 270, :size => 10, :at=> [500,500], :width => 600, :height => 1200 do
    stroke_color = 'FFFF00'
  end
end

I can see text inside pdf generated file but I don't know how can I see border too. Moreover, is there a way to put this text_box on each document's page?

Upvotes: 1

Views: 9107

Answers (1)

0x4a6f4672
0x4a6f4672

Reputation: 28245

You can draw a bounding box around it and place the following commands in it:

stroke_color 'FFFF00'
stroke_bounds

for example like this

Prawn::Document.generate 'example.pdf' do
  bounding_box([0,750], :width => 550, :height => 750) do
    stroke_color 'FFFF00'
    stroke_bounds
    text_box "Firma Conducente ________  Firma Cessionario _____", 
          :size => 10, :at=> [50,700], :width => 550, :height => 750 
  end
end

Upvotes: 9

Related Questions