Class: SheetFiller::Pdf::Wrapper

Inherits:
Struct
  • Object
show all
Defined in:
lib/sheet_filler/pdf/wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#form_pathObject

Returns the value of attribute form_path

Returns:

  • (Object)

    the current value of form_path



5
6
7
# File 'lib/sheet_filler/pdf/wrapper.rb', line 5

def form_path
  @form_path
end

#output_pathObject

Returns the value of attribute output_path

Returns:

  • (Object)

    the current value of output_path



5
6
7
# File 'lib/sheet_filler/pdf/wrapper.rb', line 5

def output_path
  @output_path
end

Instance Method Details

#fill(data) ⇒ Object



14
15
16
17
# File 'lib/sheet_filler/pdf/wrapper.rb', line 14

def fill(data)
  parser.fill_form(form_path, output_path, data)
  output_path
end

#parse_fields(data) ⇒ Object



10
11
12
# File 'lib/sheet_filler/pdf/wrapper.rb', line 10

def parse_fields(data)
  parser.fields(form_path).map { |field| field.attributes["FieldName"] }
end

#parserObject



6
7
8
# File 'lib/sheet_filler/pdf/wrapper.rb', line 6

def parser
  @parser ||= PdftkForms::Wrapper.new
end