lib/hexapdf/document.rb in hexapdf-0.20.4 vs lib/hexapdf/document.rb in hexapdf-0.21.0
- old
+ new
@@ -636,10 +636,13 @@
#
# The signing handler to be used is determined by the +handler+ argument together with the rest
# of the keyword arguments (see HexaPDF::Document::Signatures#handler for details).
#
# If not changed, the default signing handler is HexaPDF::Document::Signatures::DefaultHandler.
+ #
+ # *Note*: Once signing is done the document cannot be changed anymore since it was written. If a
+ # document needs to be signed multiple times, it needs to be loaded again after writing.
def sign(file_or_io, handler: :default, signature: nil, write_options: {}, **handler_options)
handler = signatures.handler(name: handler, **handler_options)
signatures.add(file_or_io, handler, signature: signature, write_options: write_options)
end
@@ -710,9 +713,13 @@
if file_or_io.kind_of?(String)
File.open(file_or_io, 'w+') {|file| Writer.write(self, file, incremental: incremental) }
else
Writer.write(self, file_or_io, incremental: incremental)
end
+ end
+
+ def inspect #:nodoc:
+ "<#{self.class.name}:#{object_id}>"
end
end
end