Formatting text

0 views
Skip to first unread message

sk

unread,
Jun 26, 2009, 1:55:33 AM6/26/09
to Prawn
Hi
I tried like this

pdf.text "<b>Code: </b>#{@ticket.name}" And what I expected is Code
in bold but what printed is

<b>Code: </b> ticketname

Could anybody please help to solve this?
Thanks
sk

Gregory Brown

unread,
Jun 26, 2009, 3:01:02 AM6/26/09
to prawn...@googlegroups.com
On Fri, Jun 26, 2009 at 1:55 AM, sk<sijov...@gmail.com> wrote:
>
> Hi
>    I tried like this
>
> pdf.text "<b>Code: </b>#{@ticket.name}"   And what I expected is Code
> in bold but what printed is
>
> <b>Code: </b> ticketname

This is a prawn-format feature, not a feature of core Prawn.
Did you try:

require "prawn/format"

-greg

James Healy

unread,
Jun 26, 2009, 3:10:27 AM6/26/09
to prawn...@googlegroups.com
sk wrote:
> pdf.text "<b>Code: </b>#{@ticket.name}" And what I expected is Code
> in bold but what printed is
>
> <b>Code: </b> ticketname
>
> Could anybody please help to solve this?

Have you loaded prawn-format? Try adding the following line after you've
loaded prawn:

require 'prawn/format'

-- James Healy <jimmy-at-deefa-dot-com> Fri, 26 Jun 2009 16:56:37 +1000

sk

unread,
Jun 26, 2009, 3:41:01 AM6/26/09
to Prawn
Hi
Thanks for your reply. Is it a gem? May I ask one more question? I
am totally new to prawn..I have to create a pdf file acording to
certain roles and permissions To elabrate my PDF have suppose various
sections under differnt headings .For example suppose if it has two
headings

PrimaryContact
RequestDetails So if a person with only permission to view
RequestDeatis only those under that heading will be there in pdf
file ..But how can I do this? Wont Omitting such a heading section
from pdf affect the positions and all? For example

def show_primary_contact_heading
pdf.bounding_box([50,630], :width => 100) do
pdf.text "Contact Name:",:style => :bold,:size => 11, :font =>
"Arial"
end
------------------
end

So if login person has no permission to see this section and if remove
this from pdf all the positioning etc will be gone..
Am I right? Could anybody please tell me how can I do this? I
think you got my doubt..
Note: Is there any good help links to prawn?

sk


Reply all
Reply to author
Forward
0 new messages