lib/pdf/merger/jruby.rb in pdf-merger-0.1.2 vs lib/pdf/merger/jruby.rb in pdf-merger-0.2.0
- old
+ new
@@ -1,8 +1,8 @@
# = pdf/merger/rjb.rb -- PDF template stamping.
#
-# Copyright (c) 2010 Paul Schreiber
+# Copyright 2010-12 Paul Schreiber
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'ext'))
require 'java'
require 'iText-4.2.0.jar'
@@ -20,9 +20,11 @@
copy = PdfCopyFields.new(filestream)
@files_to_merge.each do |f|
copy.addDocument(PdfReader.new(f))
end
+
+ copy.addJavaScript(@js) if @js.present?
copy.close()
PdfReader.new(output_file_path).getNumberOfPages
end