Sha256: 661b9b407e1addab57df59d67365466692da9d8e1622a03c978fe06c0480324d

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

# encoding: utf-8
#
# Example of two ways of indenting paragraphs
#
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate "indent_paragraphs.pdf" do |pdf|
  hello = "hello " * 50
  world = "world " * 50
  pdf.text(hello + "\n" + world, :indent_paragraphs => 60)

  pdf.move_cursor_to(pdf.font.height)
  pdf.text(hello + "\n" + world, :indent_paragraphs => 60)

  pdf.move_cursor_to(pdf.font.height * 3)
  pdf.text(hello + "\n" + world, :indent_paragraphs => 60)

  # can also indent using a non-breaking space
  nbsp = Prawn::Text::NBSP
  pdf.text("\n" * 10 + hello + "\n#{nbsp * 10}" + world)
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
prawn-0.11.1.pre examples/text/indent_paragraphs.rb
goodwill-prawn-edge-0.10.0 examples/text/indent_paragraphs.rb
alphasights-prawn-0.10.4 examples/text/indent_paragraphs.rb
alphasights-prawn-0.10.3 examples/text/indent_paragraphs.rb
alphasights-prawn-0.10.2 examples/text/indent_paragraphs.rb
alphasights-prawn-0.10.1 examples/text/indent_paragraphs.rb
alphasights-prawn-0.10.0 examples/text/indent_paragraphs.rb