forked from prawnpdf/prawn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added template support on #start_new_page taking advantage of ObjectS…
…tore#import_page added specs, documentation, examples and some refactoring in start_new_page
- Loading branch information
jonathangreenberg
committed
Jan 14, 2011
1 parent
9a1cffe
commit 05d637d
Showing
7 changed files
with
215 additions
and
55 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# encoding: utf-8 | ||
# | ||
# This sample demonstrates the use of the :template option when using #start_new_page to add a | ||
# new page. Only one page of the template is currently imported for the template and which page of | ||
# the pdf template is used can be specified with the :template_page option which defaults to 1. | ||
|
||
require "#{File.dirname(__FILE__)}/../example_helper.rb" | ||
|
||
filename = "#{Prawn::BASEDIR}/data/pdfs/multipage_template.pdf" | ||
|
||
Prawn::Document.generate("page_template.pdf") do | ||
text "This is the first page and content is brand new", :size => 18, :align => :center | ||
start_new_page(:template => filename, :template_page => 2) | ||
move_down 20 | ||
text "Here is some content that has been added to the page template", :size => 18, :align => :center | ||
start_new_page(:template => filename, :template_page => 3) | ||
move_down 20 | ||
text "Here is content that has been added to page 3 of the template", :size => 18, :align => :center | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.