Class: Pdftk::Ruby::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/pdftk/ruby/cli.rb

Constant Summary collapse

JAR_FILE =
File.join(Pdftk::Ruby::JAR_DIR, 'pdftk-3.3.2/pdftk-all.jar')

Instance Method Summary collapse

Instance Method Details

#execute(args) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/pdftk/ruby/cli.rb', line 8

def execute(args)
  ret = system("java", "-jar", JAR_FILE, *args)
  if ret.nil?
    $stderr.write "Failed to execute pdftk.\n"
    exit 1
  end
  ret
end