modules/claims_api/lib/claims_api/poa_pdf_constructor/base.rb
def insert_signatures(page_template, signatures)
        stamp_path = "#{::Common::FileHelpers.random_file_path}.pdf"

        Prawn::Document.generate(stamp_path, margin: [0, 0]) do |pdf|
          signatures.each do |signature|
            pdf.image signature.path, at: [signature.x, signature.y], height: signature.height
          end
        end

        stamp(page_template, stamp_path, delete_source: false)
      rescue Prawn::Errors::UnsupportedImageType
        raise ClaimsApi::StampSignatureError.new(
          message: 'One or more signatures could not be inserted',
          detail: 'One or more signatures did not have a recognized image format'
        )
      end
#
# Attach signature images to single page of pdf.
#
# @param page_template [String] Path to single page template of pdf
# @param signatures [Array(ClaimsApi::PoaPdfConstructor::Signature)] List of signatures to attach
#
# @return [type] [description]
Attach signature images to single page of pdf.
Attach signature images to single page of pdf .
def insert_signatures(page_template, signatures)
        stamp_path = "#{::Common::FileHelpers.random_file_path}.pdf"
        Prawn::Document.generate(stamp_path, margin: [0, 0]) do |pdf|
          signatures.each do |signature|
            pdf.image signature.path, at: [signature.x, signature.y], height: signature.height
          end
        end
        stamp(page_template, stamp_path, delete_source: false)
      rescue Prawn::Errors::UnsupportedImageType
        raise ClaimsApi::StampSignatureError.new(
          message: 'One or more signatures could not be inserted',
          detail: 'One or more signatures did not have a recognized image format'
        )
      end
def insert_signatures ( page_template , signatures ) stamp_path = "#{::Common::FileHelpers.random_file_path}.pdf" Prawn :: Document . generate ( stamp_path , margin : [ 0 , 0 ] ) do | pdf | signatures . each do | signature | pdf . image signature . path , at : [ signature . x , signature . y ] , height : signature . height end end stamp ( page_template , stamp_path , delete_source : false ) rescue Prawn :: Errors :: UnsupportedImageType raise ClaimsApi :: StampSignatureError . new ( message : 'One or more signatures could not be inserted' , detail : 'One or more signatures did not have a recognized image format' ) end
Attach signature images to single page of pdf.
Attach signature images to single page of pdf .
None
type
page_template
Path to single page template of pdf
Path to single page template of pdf
signatures
List of signatures to attach
List of signatures to attach