Get rid of last empty page in PDFs
This commit is contained in:
parent
68f56a55e5
commit
d1ece157c6
3 changed files with 9 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue