diff --git a/lib/prawn/js.rb b/lib/prawn/js.rb index 8008692..1858749 100644 --- a/lib/prawn/js.rb +++ b/lib/prawn/js.rb @@ -5,6 +5,7 @@ # Copyright March 2009, James Healy. All Rights Reserved. # # This is free software. Please see the LICENSE file for details. +require 'pdf/core/utils' module Prawn module JS @@ -81,11 +82,11 @@ def aa # See section 3.6.3 and table 3.28 in the PDF spec. # def javascript - names.data[:JavaScript] ||= ref!(Prawn::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT)) + names.data[:JavaScript] ||= ref!(PDF::Core::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT)) end end end -require 'prawn/document' -Prawn::Document.send(:include, Prawn::JS) +require 'pdf/core' +PDF::Core::Renderer.send(:include, Prawn::JS) diff --git a/prawn-js.gemspec b/prawn-js.gemspec index 6352474..45bae40 100644 --- a/prawn-js.gemspec +++ b/prawn-js.gemspec @@ -18,5 +18,5 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.rubyforge_project = %q{prawn} s.summary = %q{A small extension to prawn that makes it possible to embed JavaScript fragment in your document that respond to events.} - s.add_dependency('prawn-core', '>=0.6.1') + s.add_dependency('pdf-core', '>=0.7.0') end