diff --git a/lib/prawn/security.rb b/lib/prawn/security.rb index f9902fe13..1070b075d 100644 --- a/lib/prawn/security.rb +++ b/lib/prawn/security.rb @@ -209,7 +209,7 @@ module PDF module Core module_function - # Like PdfObject, but returns an encrypted result if required. + # Like pdf_object, but returns an encrypted result if required. # For direct objects, requires the object identifier and generation number # from the indirect object referencing obj. # @@ -232,7 +232,7 @@ def encrypted_pdf_object(obj, key, id, gen, in_content_stream = false) ).gsub(/[\\\n\(\)]/) { |m| "\\#{m}" } "(#{obj})" when String - PdfObject( + pdf_object( ByteString.new( Prawn::Document::Security.encrypt_string(obj, key, id, gen) ), @@ -245,17 +245,17 @@ def encrypted_pdf_object(obj, key, id, gen, in_content_stream = false) raise PDF::Core::Errors::FailedObjectConversion, 'A PDF Dictionary must be keyed by names' end - output << PdfObject(k.to_sym, in_content_stream) << ' ' << + output << pdf_object(k.to_sym, in_content_stream) << ' ' << encrypted_pdf_object(v, key, id, gen, in_content_stream) << "\n" end output << '>>' when NameTree::Value - PdfObject(obj.name) + ' ' + + pdf_object(obj.name) + ' ' + encrypted_pdf_object(obj.value, key, id, gen, in_content_stream) when PDF::Core::OutlineRoot, PDF::Core::OutlineItem encrypted_pdf_object(obj.to_hash, key, id, gen, in_content_stream) - else # delegate back to PdfObject - PdfObject(obj, in_content_stream) + else # delegate back to pdf_object + pdf_object(obj, in_content_stream) end end diff --git a/prawn.gemspec b/prawn.gemspec index 241d7051a..1b5f88248 100644 --- a/prawn.gemspec +++ b/prawn.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.licenses = %w[PRAWN GPL-2.0 GPL-3.0] spec.add_dependency('ttfunk', '~> 1.5') - spec.add_dependency('pdf-core', '~> 0.6.1') + spec.add_dependency('pdf-core', '~> 0.7.0') spec.add_development_dependency('pdf-inspector', '~> 1.2.1') spec.add_development_dependency('yard') diff --git a/spec/manual_spec.rb b/spec/manual_spec.rb index 042375b1c..3245e2db3 100644 --- a/spec/manual_spec.rb +++ b/spec/manual_spec.rb @@ -5,9 +5,9 @@ MANUAL_HASH = case RUBY_ENGINE when 'ruby' - 'b213efa532c7f2a159f69ee5559efe95333810e302ea09f60772ffdea6bb74eb477d6e7411454ba58376cf75e17bc6f7181eee991ac5d7d0c0bac71c9892a41c' + 'b55f154c9093c60f38051c75920c8157c775b946b0c77ffafc0a8a634ad5401e8ceafd0b96942839f82bacd726a690af3fdd1fd9e185616f67c6c0edfcfd0460' when 'jruby' - '0d65981e685d44c83d4ed1b0c7266da0d2b2d7c749d5d332b6837a29d44a808d03ee2ed09a9a6cf9105cf90f8a6af44dad4a5f152e6a11b05561a74ddf54b643' + 'd2eb71ea3ddc35acb185de671a6fa48862ebad5727ce372e3a742f45d31447765c4004fbe5fbfdc1f5a32903ac87182c75e6abe021ab003c8af6e6cc33e0d01e' end # rubocop: enable Metrics/LineLength