Sha256: d782b10ae3661d56682dacf099e7658bcbecc7c5c6a3baa8af6b3d9734c6741a

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

# = pdf/merger.rb -- PDF merging
#
#  Copyright 2010-12 Paul Schreiber

require 'rbconfig'
require 'fileutils'
require 'tmpdir'

include FileUtils

module PDF
  class Merger
    VERSION = "0.3.1"
    
    if RUBY_PLATFORM =~ /java/ # ifdef to check if your using JRuby
      require 'pdf/merger/jruby'
    else
      require 'pdf/merger/rjb'
    end
    # PDF::Merger provides an interface into iText allowing for the
    # merging of PDFs.
    #
    # == Example
    #
    # pdf = PDF::Merger.new
    # pdf.add_file "foo.pdf"
    # pdf.add_file "bar.pdf"
    # pdf.save_as "combined.pdf"
    
    def initialize
      @files_to_merge = []
      @js = nil
    end
    
    def add_javascript(js)
      @js = js
    end
    
    def add_file(file_path)
      @files_to_merge << file_path
    end
        
  end
end
    

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pdf-merger-0.3.1 lib/pdf/merger.rb