Permalink
Browse files

allow manual paging

  • Loading branch information...
1 parent 5044af3 commit cd0e58ac363a764ec3640d27d68763bd1996f37b @darkhelmet darkhelmet committed Jan 5, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/pdf/label/batch.rb
View
@@ -7,7 +7,9 @@
module Pdf
module Label
class Batch
- attr_accessor :template, :label, :pdf, :barcode_font
+ attr_accessor :template, :label, :pdf, :barcode_font, :manual_new_page
+ attr_reader :labels_per_page
+
@@gt = nil
def initialize(template_name, pdf_opts = {})
unless @template = gt.find_template(template_name)
@@ -234,8 +236,8 @@ def setup_add_label_options(options)
if position > @zero_based_labels_per_page
position = position % @labels_per_page
# if remainder is zero, we're dealing with the first label of a new page
- @pdf.new_page if position.zero?
- end
+ @pdf.new_page if position.zero? unless manual_new_page
+ end
label_x, label_y = position_to_x_y(position)
elsif((label_x = options[:x]) && (label_y = options[:y]))
else

0 comments on commit cd0e58a

Please sign in to comment.