Template for automatically generated pages #273

Closed
leolezner opened this Issue Aug 30, 2011 · 1 comment

Comments

Projects
None yet
2 participants

I'm trying to implement a template for my small invoicing script. I intend to have a more complex template on first page and simple template for all following pages (just the company logo with some lines). If I create the new page with start_new_page, prawn shows the template. But if the content breaks out of the bounding box, the new page will be generated without my template. I've look deeper in the gem, into the file "bounding_box.rb".

  def move_past_bottom
    if @document.page_number == @document.page_count
      @document.start_new_page
    else
      @document.go_to_page(@document.page_number + 1)
    end
  end

The new page is generated without any templates... I would like to use for further pages the second page of my template.

  def move_past_bottom
    if @document.page_number == @document.page_count
      @document.start_new_page :template => 'tpl_invoice.pdf', :template_page => 2
    else
      @document.go_to_page(@document.page_number + 1)
    end
  end
Member

yob commented Dec 8, 2012

Thanks for the report, I'll close this in favour of #375 as there's more discussion there.

@yob yob closed this Dec 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment