Class: Ruport::Controller::Invoice::PDF

Inherits:
Formatter::PDF show all
Includes:
InvoiceHelpers
Defined in:
lib/ruport/util/invoice.rb

Instance Method Summary collapse

Methods included from InvoiceHelpers

#add_title, #build_company_header, #build_customer_header, #build_order_header, #build_title, #horizontal_line

Methods inherited from Formatter::PDF

#draw_graph

Instance Method Details

#build_invoice_bodyObject



85
86
87
88
# File 'lib/ruport/util/invoice.rb', line 85

def build_invoice_body
  move_cursor_to 600
  draw_table data, :width => options.body_width || 450
end


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/ruport/util/invoice.rb', line 90

def build_invoice_footer
 # footer
  pdf_writer.open_object do |footer|
    pdf_writer.save_state
    pdf_writer.stroke_color! Color::RGB::Black
    pdf_writer.stroke_style! ::PDF::Writer::StrokeStyle::DEFAULT
    if options.comments  
      
      move_cursor_to 60

      horizontal_line left_boundary + 20, right_boundary - 25

      move_cursor(-10)

      add_text(options.comments,:justification => :center, 
                                :left => 0, :right => 0 )
                                
    end

    pdf_writer.restore_state
    pdf_writer.close_object
    pdf_writer.add_object(footer, :all_pages)
  end
end

#build_invoice_headersObject



78
79
80
81
82
83
# File 'lib/ruport/util/invoice.rb', line 78

def build_invoice_headers
  build_company_header
  build_customer_header
  build_title
  build_order_header
end

#finalize_invoiceObject



115
116
117
# File 'lib/ruport/util/invoice.rb', line 115

def finalize_invoice
  output << pdf_writer.render
end