Sha256: 06a758b1b6d95f0bddb247fd84367a1faadaac2cf553d532cde745c975d738e7

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

module Asposepdfjava
  module ConcatenatePdfFiles
    def initialize()
    	# The path to the documents directory.
        data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
                
        # Open the target document
        pdf1 = Rjb::import('com.aspose.pdf.Document').new(data_dir + 'input1.pdf')

        # Open the source document
        pdf2 = Rjb::import('com.aspose.pdf.Document').new(data_dir + 'input2.pdf')
        
        # Add the pages of the source document to the target document
        pdf1.getPages().add(pdf2.getPages())

        # Save the concatenated output file (the target document)
        pdf1.save(data_dir+ "Concatenate_output.pdf")

        puts "New document has been saved, please check the output file"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asposepdfjava-0.0.2 lib/asposepdfjava/Pages/concatenatepdffiles.rb
asposepdfjava-0.0.1 lib/asposepdfjava/Pages/concatenatepdffiles.rb