Sha256: ede220dd89c2fa4fd654457dd28ac2f5bc2572fe87803d28214f6b8b92517e18

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

require 'fileutils'
require 'rjb'

load_path = File.expand_path(File.dirname(__FILE__) + '/iText-2.1.7.jar')
options = ['-Djava.awt.headless=true'] 
Rjb::load load_path, options

FileOutputStream = Rjb::import('java.io.FileOutputStream')
PdfWriter        = Rjb::import('com.lowagie.text.pdf.PdfWriter')
PdfReader        = Rjb::import('com.lowagie.text.pdf.PdfReader')
PdfCopy          = Rjb::import('com.lowagie.text.pdf.PdfCopy')
PdfImportedPage  = Rjb::import('com.lowagie.text.pdf.PdfImportedPage')
Document         = Rjb::import('com.lowagie.text.Document')
Paragraph        = Rjb::import('com.lowagie.text.Paragraph')
AcroFields       = Rjb::import('com.lowagie.text.pdf.AcroFields')
PdfStamper       = Rjb::import('com.lowagie.text.pdf.PdfStamper')
HashMap          = Rjb::import('java.util.HashMap')

require 'pdf_filler/util_methods'
require 'pdf_filler/fill_pdf_template'
require 'pdf_filler/fill_pdf_collection'


module Kernel

  def PdfFiller(pdf_options = {})
    if(pdf_options.has_key?(:data) and pdf_options[:data].class.to_s == 'Array')
      p = Gbdev::PdfOperations::FillCollection.new(pdf_options)
    else  
      p = Gbdev::PdfOperations::FillTemplate.new(pdf_options)
    end
    p.compile_pdf
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gbdev-pdf_filler-0.1.0 lib/pdf_filler.rb
gbdev-pdf_filler-0.1.1 lib/pdf_filler.rb
gbdev-pdf_filler-0.1.2 lib/pdf_filler.rb