Class: Statement::PdfGenerator

Inherits:
BaseService
  • Object
show all
Includes:
Pdf::Base
Defined in:
app/services/statement/pdf_generator.rb

Defined Under Namespace

Classes: Result

Constant Summary

Constants included from Pdf::Base

Pdf::Base::FONT, Pdf::Base::NIMBUS_SANS_PATH, Pdf::Base::NIMBUS_SANS_PATH_BOLD, Pdf::Base::WY_LOGO_PATH

Instance Method Summary collapse

Instance Method Details

#process(soa, results, _options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/services/statement/pdf_generator.rb', line 8

def process(soa, results, _options = {})
  customer  = soa.customer
  composer  = build_composer
  draw_body(composer, customer, results)
  insert_headers_and_footers(composer, customer)
  io = StringIO.new
  composer.write(io, optimize: true)
  Result.new(pdf: io.string)
end