Sorry for responding to a very ancient post, I almost never read the
Rails list...

On Jan 6, 9:22 am, Tom Lobato <[email protected]> wrote:
> How to achieve this, like a horiz. align to center?
>
> I`m tryingPrawnto generate PDFs, but having a problem to place a
> short text (3 words) at the horiz. middle of the page. This code
> places the text 2 or 3 centimeters right from the middle.
>
> Prawn::Document.generate('public/' + dir +
> "certificado.pdf", :page_size => "A4", :page_layout => :landscape) do
>       bounding_box([0,430], :width => 800, :height => 600) do
>         text nome, :size => 28, :align => :center
>       end
> end
>
> As I change ":width => 800" value, the distance from the middle
> changes. I tried to remove width and heigth options, hoping the
> bounding_box to fit all the page, but I got a error.

Get rid of the bounding box entirely and just do:  text nome, :size =>
28, :align => :center

You were centering your text within the box, not within the page.

> PS: I tried to subscribe tohttp://groups.google.com/group/prawn-ruby
> but it appears it is not accepting subscriptions.

Please re-subscribe.  You probably missed the "Are you human" form
field, which caused you to be denied.

-greg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to