Menno
Menno

Reputation: 35

How to indent a complete paragraph with Prawn?

Is it possible to indent a complete paragraph of text with Prawn?

So not just the first line of a paragraph like :indent_paragraphs => some_number does? But all the text in that paragraph.

Upvotes: 2

Views: 2637

Answers (1)

James Healy
James Healy

Reputation: 15168

Try this:

Prawn::Document.generate('indented.pdf') do |pdf|
  pdf.indent(20) do
    pdf.text "indented paragraph"
  end
end

Upvotes: 15

Related Questions