lib/groupdocs/document.rb in groupdocs-1.8.0 vs lib/groupdocs/document.rb in groupdocs-1.8.1
- old
+ new
@@ -71,11 +71,13 @@
template.merge!(:file => Storage::File.new(template))
Document.new(template)
end
end
- #
+ # Changed in version 1.8.1
+ #
+ #
# Signs given documents with signatures.
#
# @example
# # prepare documents
# file_one = GroupDocs::Storage::File.new(name: 'document_one.doc', local_path: '~/Documents/document_one.doc')
@@ -84,11 +86,13 @@
# document_two = file_two.to_document
# # prepare signatures
# signature_one = GroupDocs::Signature.new(name: 'John Smith', image_path: '~/Documents/signature_one.png')
# signature_two = GroupDocs::Signature.new(name: 'Sara Smith', image_path: '~/Documents/signature_two.png')
# signature_one.position = { top: 0.1, left: 0.07, width: 50, height: 50 }
+ # signature_one.email = "test1@mail.com"
# signature_two.position = { top: 0.2, left: 0.2, width: 100, height: 100 }
+ # signature_one.email = "test1@mail.com"
# # sign documents and download results
# signed_documents = GroupDocs::Document.sign_documents!([document_one, document_two], [signature_one, signature_two])
# signed_documents.each do |document|
# document.file.download! '~/Documents'
# end
@@ -126,11 +130,13 @@
contents = Base64.strict_encode64(contents)
signer = { :name => signature.name, :data => "data:#{mime_type(signature.image_path)};base64,#{contents}" }
signer.merge!(signature.position)
# place signature on is not implemented yet
signer.merge!(:placeSignatureOn => nil)
+ signer.merge!(:email => signature.email)
signers << signer
+
end
json = Api::Request.new do |request|
request[:access] = access