sandal/prawn — Issue #293: page layout ignored when generating pdf from template pdf
Author: ckhall
Created: 2011-11-01 15:12:02+00:00
State: open

this happens in both prawn 0.12.0 and 1.0.0rc1

code sample to show issue:

# generate a landscaped pdf page and save it
Prawn::Document.generate 'landscape.pdf', :page_layout => :landscape do
font 'Helvetica'
text 'hello world'
start_new_page # generates new page with proper page layout
text 'page still in landscape'
end

Prawn::Document.generate 'test1.pdf', :template => 'landscape.pdf' do
font 'Helvetica'
go_to_page(page_count)
start_new_page # generates page, but ignores layout of template
text 'adding page to template not using :page_layout'
end

Prawn::Document.generate 'test2.pdf', :template => 'landscape.pdf', :page_layout => :landscape do
font 'Helvetica'
go_to_page(page_count)
start_new_page # generates page, but ignores layout of template and :page_layout option
text 'adding page to template and using :page_layout => :landscape in #generate'
start_new_page(:page_layout => :landscape)
text 'adding another page and using :page_layout => :landscape in #start_new_page'
end