Prawn 0.10.0 :template apply to all pages

121 views
Skip to first unread message

Krule

unread,
Jun 29, 2010, 1:11:58 PM6/29/10
to Prawn
Hello all,

I am trying to have a preexisting pdf template as something to draw on
on all pages. However, as soon as I start_new_page it's nowhere to be
found.

template = "#{RAILS_ROOT}/pdf/template.pdf"
pdf = Prawn::Document.new(:template => template, :page_size => 'A4')

Any ideas?

Brad Ediger

unread,
Jun 29, 2010, 1:18:30 PM6/29/10
to prawn...@googlegroups.com

The name "template" might be a bit misleading here. Templates don't
apply to new pages -- they are just a way to base a Prawn document on
an existing one. Any additions you make to that document are your own.
We don't really have a way yet to use a template PDF on all pages of a
Prawn document.

-be

Krule

unread,
Jun 29, 2010, 1:29:51 PM6/29/10
to Prawn
Too bad :(

But not the greatest problem, I will just have to generate document
containing all the elements as one in template.

Would a neat feature to have in some future ver.

jonsgreen

unread,
Jun 30, 2010, 4:18:02 AM6/30/10
to Prawn
Yes, this is a feature that I had working on a local branch on my fork
with an earlier version of templates but I have not figured out how to
implement it now that the templates feature was finally merged into
Prawn. I need to get up with James Healy at some point to figure out
where I am getting stuck.
Reply all
Reply to author
Forward
0 new messages