Sha256: 213e87865ff61a930c3ac6f85c2c0ba65efaf9bac5a3ae8d6879751bcc1a857f

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

# encoding: utf-8
#
# A PDF document is a collection of pages. When we create a new document be it
# with <code>Document.new</code> or on a <code>Document.generate</code> block
# one initial page is created for us.
#
# Some methods might create new pages automatically like <code>text</code> which
# will create a new page whenever the text string cannot fit on the current
# page.
#
# But what if you want to go to the next page by yourself? That is easy.
#
# Just use the <code>start_new_page</code> method and a shiny new page will be
# created for you just like in the following snippet.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  text "We are still on the initial page for this example. Now I'll ask " +
       "Prawn to gently start a new page. Please follow me to the next page."

  start_new_page

  text "See. We've left the previous page behind."
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
prawn-2.1.0 manual/basic_concepts/adding_pages.rb
prawn-git-2.0.1 manual/basic_concepts/adding_pages.rb
prawn-2.0.2 manual/basic_concepts/adding_pages.rb
prawn-2.0.1 manual/basic_concepts/adding_pages.rb
prawn-2.0.0 manual/basic_concepts/adding_pages.rb
prawn-1.3.0 manual/basic_concepts/adding_pages.rb
prawn-1.2.1 manual/basic_concepts/adding_pages.rb
prawn-1.1.0 manual/basic_concepts/adding_pages.rb