Class: Prawn::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/prawn/security.rb

Instance Method Summary collapse

Instance Method Details

#encrypted_object(key) ⇒ Object

Returns the object definition for the object this references, keyed from key.



240
241
242
243
244
245
246
247
248
249
250
# File 'lib/prawn/security.rb', line 240

def encrypted_object(key)
  @on_encode.call(self) if @on_encode
  output = "#{@identifier} #{gen} obj\n" <<
           Prawn::EncryptedPdfObject(data, key, @identifier, gen) << "\n"
  if @stream
    output << "stream\n" <<
      Document::Security.encrypt_string(@stream, key, @identifier, gen) <<
      "\nendstream\n"
  end
  output << "endobj\n"
end