Class: Ruport::Renderer::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



87
88
89
90
# File 'lib/ruport/util/invoice.rb', line 87

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


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

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



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

def build_invoice_headers
  build_company_header
  build_customer_header
  build_title
  build_order_header
end

#finalize_invoiceObject



117
118
119
# File 'lib/ruport/util/invoice.rb', line 117

def finalize_invoice
  output << pdf_writer.render
end