lib/hexapdf/encryption/security_handler.rb in hexapdf-0.17.3 vs lib/hexapdf/encryption/security_handler.rb in hexapdf-0.18.0

- old
+ new

@@ -211,10 +211,12 @@ raise HexaPDF::EncryptionError, "Could not find a suitable security handler" end end handler = handler.new(document) - document.trailer[:Encrypt] = handler.set_up_decryption(dict, **options) + dict = document.trailer[:Encrypt] = handler.set_up_decryption(dict, **options) + HexaPDF::Object.make_direct(dict.value) + document.revisions.current.update(dict) document.revisions.each do |r| loader = r.loader r.loader = lambda do |xref_entry| obj = loader.call(xref_entry) xref_entry.compressed? ? obj : handler.decrypt(obj)