Sha256: 7c74c3bb78b67ca72c2562744e65d3a94da6b808da888838197d09a490c42945

Contents?: true

Size: 992 Bytes

Versions: 41

Compression:

Stored size: 992 Bytes

Contents

module Platformx
  
  # PDF helpers module
  # @author Tim Mushen
	module PdfHelpers

    # Fill pdf helper
    # @todo Figure out what this method does and returns
    # @param source_pdf [String] source pdf
    # @param target_file_path [String] target file path
    # @param new_pdf_name [String] new name of the pdf
    # @param pdf_variables [String] pdf variables
    # @param flatten [String] if to flatten or not 
def x_fill_pdf(source_pdf: "", target_file_path: "", new_pdf_name: "", pdf_variables: {}, flatten: true)
	# include pdftk
	pdftk = PdfForms.new(settings.pdftk_path)

	#find out the field names that are present in form.pdf
	#pdftk.get_field_names 'pdfs/cover_opt.pdf'
	#pdf_name = Time.new.to_i
	pdf_name = @proposal.id
	
	#Fill Out the forms
	pdftk.fill_form source_pdf, "#{target_file_path}/#{pdf_name}", 
		{
		Client: @proposal.client, 
		proposalDate: "#{format_date(Date.today)}", 
		expires: format_date(1.month.from_now)
		}, 
		:flatten => flatten
end

	end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
platformx-0.0.9.7.2 lib/platformx/pdf.rb
platformx-0.0.9.7.1 lib/platformx/pdf.rb
platformx-0.0.9.6.6.7 lib/platformx/pdf.rb
platformx-0.0.9.6.6.6 lib/platformx/pdf.rb
platformx-0.0.9.6.6.5 lib/platformx/pdf.rb
platformx-0.0.9.6.6.4 lib/platformx/pdf.rb
platformx-0.0.9.6.6.3 lib/platformx/pdf.rb
platformx-0.0.9.6.6.2 lib/platformx/pdf.rb
platformx-0.0.9.6.6.1 lib/platformx/pdf.rb
platformx-0.0.9.6.4 lib/platformx/pdf.rb
platformx-0.0.9.6.3 lib/platformx/pdf.rb
platformx-0.0.9.6.2 lib/platformx/pdf.rb
platformx-0.0.9.6.1 lib/platformx/pdf.rb
platformx-0.0.9.6 lib/platformx/pdf.rb
platformx-0.0.9.5 lib/platformx/pdf.rb
platformx-0.0.9.4 lib/platformx/pdf.rb
platformx-0.0.9.3 lib/platformx/pdf.rb
platformx-0.0.9.2 lib/platformx/pdf.rb
platformx-0.0.9 lib/platformx/pdf.rb
platformx-0.0.8.9.9.9 lib/platformx/pdf.rb