modules/claims_api/lib/claims_api/poa_pdf_constructor/base.rb
#
# Fill in pdf form fields based on data provided.
#
# @param data [Hash] Data to fill in pdf form with
Fill in pdf form fields based on data provided.
Fill in pdf form fields based on data provided .
def fill_pdf(data)
        pdftk = PdfForms.new(Settings.binaries.pdftk)
        temp_path = Rails.root.join('tmp', "poa_#{Time.now.to_i}_page_1.pdf")
        pdftk.fill_form(
          @page1_path,
          temp_path,
          page1_options(data),
          flatten: true
        )
        @page1_path = temp_path
        temp_path = Rails.root.join('tmp', "poa_#{Time.now.to_i}_page_2.pdf")
        pdftk.fill_form(
          @page2_path,
          temp_path,
          page2_options(data),
          flatten: true
        )
        @page2_path = temp_path
      end
def fill_pdf ( data ) pdftk = PdfForms . new ( Settings . binaries . pdftk ) temp_path = Rails . root . join ( 'tmp' , "poa_#{Time.now.to_i}_page_1.pdf" ) pdftk . fill_form ( @page1_path , temp_path , page1_options ( data ) , flatten : true ) @page1_path = temp_path temp_path = Rails . root . join ( 'tmp' , "poa_#{Time.now.to_i}_page_2.pdf" ) pdftk . fill_form ( @page2_path , temp_path , page2_options ( data ) , flatten : true ) @page2_path = temp_path end
Fill in pdf form fields based on data provided.
Fill in pdf form fields based on data provided .
data
Data to fill in pdf form with
Data to fill in pdf form with