Sha256: 2eff29dfc7d49eec140f5c3dbefee991f00232643236488dda658373e8e07aa5

Contents?: true

Size: 989 Bytes

Versions: 3

Compression:

Stored size: 989 Bytes

Contents

require 'os'

require 'libis/tools/extend/string'
require 'libis/tools/logger'
require 'libis/tools/command'

require 'libis/format/config'

module Libis
  module Format
    module Tool

      class PdfSplit
        include ::Libis::Tools::Logger

        def self.run(source, target, options = [])
          self.new.run source, target, options
        end

        def run(source, target, options = [])
          tool_dir = File.absolute_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'tools'))
          jar_file = File.join(tool_dir, 'PdfTool.jar')
          if OS.java?
            # TODO: import library and execute in current VM. For now do exactly as in MRI.
          end

          Libis::Tools::Command.run(
              Libis::Format::Config[:java_path],
              '-cp', jar_file,
              'SplitPdf',
              '--file_input', source,
              '--file_output', target,
              *options
          )

        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
libis-format-0.9.46 lib/libis/format/tool/pdf_split.rb
libis-format-0.9.45 lib/libis/format/tool/pdf_split.rb
libis-format-0.9.44 lib/libis/format/tool/pdf_split.rb