Get rid of last empty page in PDFs

This commit is contained in:
wvengen 2015-01-03 00:14:38 +01:00
parent 68f56a55e5
commit d1ece157c6
3 changed files with 9 additions and 4 deletions

View file

@ -12,6 +12,7 @@ class OrderPdf < Prawn::Document
super(options)
@order = order
@options = options
@first_page = true
end
def to_pdf
@ -50,6 +51,10 @@ class OrderPdf < Prawn::Document
# add pagebreak or vertical whitespace, depending on configuration
def down_or_page(space=10)
if @first_page
@first_page = false
return
end
if pdf_add_page_breaks?
start_new_page
else