groupdocs 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +51 -0
- data/examples/api-samples/Gemfile +1 -1
- data/examples/api-samples/Gemfile.lock +43 -0
- data/examples/api-samples/public/docs/{sample2.html → sample01.html} +39 -19
- data/examples/api-samples/public/docs/{sample3.html → sample02.html} +28 -22
- data/examples/api-samples/public/docs/sample03.html +285 -0
- data/examples/api-samples/public/docs/{sample4.html → sample04.html} +30 -36
- data/examples/api-samples/public/docs/{sample5.html → sample05.html} +68 -31
- data/examples/api-samples/public/docs/sample06.html +299 -0
- data/examples/api-samples/public/docs/{sample7.html → sample07.html} +53 -18
- data/examples/api-samples/public/docs/{sample8.html → sample08.html} +64 -41
- data/examples/api-samples/public/docs/sample09.html +260 -0
- data/examples/api-samples/public/docs/sample10.html +67 -28
- data/examples/api-samples/public/docs/sample11.html +171 -55
- data/examples/api-samples/public/docs/sample12.html +53 -17
- data/examples/api-samples/public/docs/sample13.html +52 -16
- data/examples/api-samples/public/docs/sample14.html +51 -8
- data/examples/api-samples/public/docs/sample15.html +46 -10
- data/examples/api-samples/public/docs/sample16.html +81 -7
- data/examples/api-samples/public/docs/sample17.html +103 -15
- data/examples/api-samples/public/docs/sample18.html +117 -41
- data/examples/api-samples/public/docs/sample19.html +410 -36
- data/examples/api-samples/public/docs/sample20.html +46 -10
- data/examples/api-samples/public/docs/sample21.html +504 -45
- data/examples/api-samples/public/docs/sample22.html +166 -28
- data/examples/api-samples/public/docs/sample23.html +61 -25
- data/examples/api-samples/public/docs/sample24.html +100 -12
- data/examples/api-samples/public/docs/sample25.html +123 -49
- data/examples/api-samples/public/docs/sample26.html +41 -8
- data/examples/api-samples/public/docs/sample27.html +125 -50
- data/examples/api-samples/public/docs/sample28.html +27 -9
- data/examples/api-samples/public/docs/sample29.html +10 -10
- data/examples/api-samples/public/docs/sample30.html +70 -14
- data/examples/api-samples/public/docs/sample31.html +108 -67
- data/examples/api-samples/public/docs/sample32.html +71 -99
- data/examples/api-samples/public/docs/sample33.html +107 -32
- data/examples/api-samples/public/docs/{sample1.html → sample34.html} +58 -18
- data/examples/api-samples/public/docs/sample35.html +666 -0
- data/examples/api-samples/public/docs/{sample6.html → sample36.html} +56 -37
- data/examples/api-samples/public/docs/sample37.html +815 -0
- data/examples/api-samples/public/docs/sample38.html +508 -0
- data/examples/api-samples/public/docs/sample39.html +921 -0
- data/examples/api-samples/public/docs/sample40.html +510 -0
- data/examples/api-samples/public/docs/sample41.html +452 -0
- data/examples/api-samples/public/docs/sample42.html +311 -0
- data/examples/api-samples/public/templates/test_all_fields2.pdf +0 -0
- data/examples/api-samples/samples/sample01.rb +37 -0
- data/examples/api-samples/samples/sample02.rb +41 -0
- data/examples/api-samples/samples/sample03.rb +73 -0
- data/examples/api-samples/samples/sample04.rb +47 -0
- data/examples/api-samples/samples/{sample5.rb → sample05.rb} +26 -14
- data/examples/api-samples/samples/sample06.rb +80 -0
- data/examples/api-samples/samples/sample07.rb +52 -0
- data/examples/api-samples/samples/sample08.rb +69 -0
- data/examples/api-samples/samples/sample09.rb +83 -0
- data/examples/api-samples/samples/sample10.rb +29 -15
- data/examples/api-samples/samples/sample11.rb +89 -37
- data/examples/api-samples/samples/sample12.rb +22 -11
- data/examples/api-samples/samples/sample13.rb +22 -10
- data/examples/api-samples/samples/sample14.rb +23 -5
- data/examples/api-samples/samples/sample15.rb +18 -7
- data/examples/api-samples/samples/sample16.rb +28 -4
- data/examples/api-samples/samples/sample17.rb +31 -5
- data/examples/api-samples/samples/sample18.rb +36 -8
- data/examples/api-samples/samples/sample19.rb +138 -18
- data/examples/api-samples/samples/sample20.rb +14 -3
- data/examples/api-samples/samples/sample21.rb +162 -23
- data/examples/api-samples/samples/sample22.rb +73 -22
- data/examples/api-samples/samples/sample23.rb +17 -6
- data/examples/api-samples/samples/sample24.rb +34 -7
- data/examples/api-samples/samples/sample25.rb +37 -12
- data/examples/api-samples/samples/sample26.rb +12 -5
- data/examples/api-samples/samples/sample27.rb +38 -12
- data/examples/api-samples/samples/sample28.rb +25 -6
- data/examples/api-samples/samples/sample29.rb +12 -12
- data/examples/api-samples/samples/sample30.rb +27 -15
- data/examples/api-samples/samples/sample31.rb +44 -33
- data/examples/api-samples/samples/sample32.rb +43 -41
- data/examples/api-samples/samples/sample33.rb +42 -14
- data/examples/api-samples/samples/sample34.rb +40 -0
- data/examples/api-samples/samples/sample35.rb +224 -0
- data/examples/api-samples/samples/sample36.rb +58 -0
- data/examples/api-samples/samples/sample37.rb +229 -0
- data/examples/api-samples/samples/sample38.rb +128 -0
- data/examples/api-samples/samples/sample39.rb +252 -0
- data/examples/api-samples/samples/sample40.rb +164 -0
- data/examples/api-samples/samples/sample41.rb +118 -0
- data/examples/api-samples/samples/sample42.rb +97 -0
- data/examples/api-samples/views/_others_samples.haml +25 -11
- data/examples/api-samples/views/index.haml +23 -11
- data/examples/api-samples/views/popup.haml +32 -0
- data/examples/api-samples/views/{sample1.haml → sample01.haml} +12 -7
- data/examples/api-samples/views/{sample2.haml → sample02.haml} +20 -15
- data/examples/api-samples/views/sample03.haml +83 -0
- data/examples/api-samples/views/sample04.haml +49 -0
- data/examples/api-samples/views/{sample5.haml → sample05.haml} +19 -14
- data/examples/api-samples/views/sample06.haml +53 -0
- data/examples/api-samples/views/sample07.haml +47 -0
- data/examples/api-samples/views/{sample8.haml → sample08.haml} +17 -12
- data/examples/api-samples/views/{sample9.haml → sample09.haml} +19 -4
- data/examples/api-samples/views/sample10.haml +18 -13
- data/examples/api-samples/views/sample11.haml +48 -19
- data/examples/api-samples/views/sample12.haml +26 -21
- data/examples/api-samples/views/sample13.haml +18 -12
- data/examples/api-samples/views/sample14.haml +21 -15
- data/examples/api-samples/views/sample15.haml +16 -9
- data/examples/api-samples/views/sample16.haml +18 -5
- data/examples/api-samples/views/sample17.haml +14 -9
- data/examples/api-samples/views/sample18.haml +13 -7
- data/examples/api-samples/views/sample19.haml +37 -8
- data/examples/api-samples/views/sample20.haml +13 -8
- data/examples/api-samples/views/sample21.haml +71 -13
- data/examples/api-samples/views/sample22.haml +53 -16
- data/examples/api-samples/views/sample23.haml +9 -4
- data/examples/api-samples/views/sample24.haml +9 -4
- data/examples/api-samples/views/sample25.haml +18 -13
- data/examples/api-samples/views/sample26.haml +8 -3
- data/examples/api-samples/views/sample27.haml +20 -14
- data/examples/api-samples/views/sample28.haml +16 -10
- data/examples/api-samples/views/sample29.haml +4 -4
- data/examples/api-samples/views/sample30.haml +16 -10
- data/examples/api-samples/views/sample31.haml +39 -32
- data/examples/api-samples/views/sample32.haml +25 -36
- data/examples/api-samples/views/sample33.haml +14 -17
- data/examples/api-samples/views/sample34.haml +48 -0
- data/examples/api-samples/views/sample35.haml +95 -0
- data/examples/api-samples/views/sample36.haml +64 -0
- data/examples/api-samples/views/sample37.haml +124 -0
- data/examples/api-samples/views/sample38.haml +115 -0
- data/examples/api-samples/views/sample39.haml +236 -0
- data/examples/api-samples/views/sample40.haml +95 -0
- data/examples/api-samples/views/{sample4.haml → sample41.haml} +90 -72
- data/examples/api-samples/views/sample42.haml +59 -0
- data/lib/groupdocs/api/helpers/rest_helper.rb +13 -1
- data/lib/groupdocs/datasource.rb +2 -1
- data/lib/groupdocs/document.rb +101 -13
- data/lib/groupdocs/document/annotation.rb +28 -13
- data/lib/groupdocs/document/annotation/marker.rb +18 -0
- data/lib/groupdocs/document/annotation/reply.rb +9 -2
- data/lib/groupdocs/document/field.rb +5 -1
- data/lib/groupdocs/job.rb +12 -2
- data/lib/groupdocs/questionnaire.rb +174 -4
- data/lib/groupdocs/questionnaire/collector.rb +21 -0
- data/lib/groupdocs/questionnaire/question.rb +19 -0
- data/lib/groupdocs/questionnaire/question/answer.rb +5 -0
- data/lib/groupdocs/questionnaire/question/conditions.rb +20 -0
- data/lib/groupdocs/signature.rb +36 -308
- data/lib/groupdocs/signature/envelope.rb +146 -4
- data/lib/groupdocs/signature/field.rb +20 -1
- data/lib/groupdocs/signature/field/location.rb +18 -7
- data/lib/groupdocs/signature/form.rb +199 -10
- data/lib/groupdocs/signature/shared/document_methods.rb +38 -0
- data/lib/groupdocs/signature/shared/entity_methods.rb +0 -1
- data/lib/groupdocs/signature/shared/field_methods.rb +13 -38
- data/lib/groupdocs/signature/shared/recipient_methods.rb +8 -0
- data/lib/groupdocs/signature/template.rb +3 -1
- data/lib/groupdocs/storage.rb +4 -1
- data/lib/groupdocs/storage/file.rb +18 -1
- data/lib/groupdocs/subscription.rb +8 -3
- data/lib/groupdocs/user.rb +8 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/document/annotation_spec.rb +1 -14
- data/spec/groupdocs/subscription_spec.rb +2 -2
- metadata +86 -32
- checksums.yaml +0 -15
- data/examples/api-samples/public/docs/sample9.html +0 -200
- data/examples/api-samples/samples/sample1.rb +0 -25
- data/examples/api-samples/samples/sample2.rb +0 -29
- data/examples/api-samples/samples/sample3.rb +0 -33
- data/examples/api-samples/samples/sample4.rb +0 -51
- data/examples/api-samples/samples/sample6.rb +0 -49
- data/examples/api-samples/samples/sample7.rb +0 -42
- data/examples/api-samples/samples/sample8.rb +0 -61
- data/examples/api-samples/samples/sample9.rb +0 -48
- data/examples/api-samples/views/sample3.haml +0 -44
- data/examples/api-samples/views/sample6.haml +0 -49
- data/examples/api-samples/views/sample7.haml +0 -42
@@ -0,0 +1,59 @@
|
|
1
|
+
%h3{:style => 'text-align:center;'}
|
2
|
+
%a{:href => '/'} GroupDocs Ruby SDK Samples
|
3
|
+
\- Sample42
|
4
|
+
.samplecontent{:style => 'padding:10px;'}
|
5
|
+
%span.description
|
6
|
+
%i
|
7
|
+
This sample will show how to download document with annotations using GroupDocs Ruby SDK.
|
8
|
+
|
9
|
+
%br/
|
10
|
+
%br/
|
11
|
+
/
|
12
|
+
%span.documentation
|
13
|
+
%a{:href => '/docs/sample42.html'} Builtin documentation for this sample
|
14
|
+
|
15
|
+
%br/
|
16
|
+
%br/
|
17
|
+
%p
|
18
|
+
You entered:
|
19
|
+
%p
|
20
|
+
ClientID = #{(defined? userId) ? userId : ''}
|
21
|
+
%p
|
22
|
+
PrivateKey = #{(defined? privateKey) ? privateKey : ''}
|
23
|
+
%p
|
24
|
+
%font{:color => 'red'} #{(defined? err) ? err : ''}
|
25
|
+
%br/
|
26
|
+
#requestForm{:style => 'padding:20px; border:1px solid black;'}
|
27
|
+
%p Enter data for request and press "Make request" button
|
28
|
+
%form{:action => '/sample42', :enctype => 'multipart/form-data', :method => 'post'}
|
29
|
+
%label{:for => 'clientId'} GroupDocs ClientID
|
30
|
+
%br/
|
31
|
+
%input{:type=>'text', :name=>'clientId'}
|
32
|
+
%br/
|
33
|
+
%label{:for => 'privateKey'} GroupDocs PrivateKey
|
34
|
+
%br/
|
35
|
+
%input{:type=>'text', :name=>'privateKey'}
|
36
|
+
%br/
|
37
|
+
%label{:for=>'fileId', :id=>'guid'} File ID (GUID)
|
38
|
+
%br/
|
39
|
+
%input{:type=>'text', :name=>'fileId'}
|
40
|
+
%br/
|
41
|
+
%label{:for => 'basePath'} Base Path
|
42
|
+
%span{:class => 'optional'} (Optional)
|
43
|
+
%br/
|
44
|
+
%input{:type=>'text', :name=>'basePath'}
|
45
|
+
%br/
|
46
|
+
%br/
|
47
|
+
%input{:type => 'submit', :value => 'Make request'}
|
48
|
+
|
49
|
+
%br/
|
50
|
+
%br/
|
51
|
+
%br/
|
52
|
+
%div{:style => 'padding:20px; border:1px solid black;'}
|
53
|
+
%p
|
54
|
+
Results:
|
55
|
+
%br/
|
56
|
+
#{(defined? message)? message : ''}
|
57
|
+
#{(defined? iframe) ? iframe : ''}
|
58
|
+
|
59
|
+
= partial :_others_samples
|
@@ -37,12 +37,15 @@ module GroupDocs
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
#
|
41
|
+
# Changed in release 1.5.8
|
40
42
|
#
|
41
43
|
# Sends request to API server.
|
42
44
|
#
|
43
45
|
# @api private
|
44
46
|
#
|
45
47
|
def send_request
|
48
|
+
|
46
49
|
self.response = case options[:method]
|
47
50
|
when :get, :download
|
48
51
|
resource[options[:path]].get(options[:headers])
|
@@ -51,7 +54,16 @@ module GroupDocs
|
|
51
54
|
when :put
|
52
55
|
resource[options[:path]].put(options[:request_body], options[:headers])
|
53
56
|
when :delete
|
54
|
-
|
57
|
+
if options[:request_body]
|
58
|
+
url = GroupDocs.api_server + options[:path]
|
59
|
+
RestClient::Request.execute(options.merge(
|
60
|
+
:method => :delete,
|
61
|
+
:url => url,
|
62
|
+
:payload => options[:request_body],
|
63
|
+
:headers => options[:headers]))
|
64
|
+
else
|
65
|
+
resource[options[:path]].delete(options[:headers])
|
66
|
+
end
|
55
67
|
else
|
56
68
|
raise UnsupportedMethodError, "Unsupported HTTP method: #{options[:method].inspect}"
|
57
69
|
end
|
data/lib/groupdocs/datasource.rb
CHANGED
data/lib/groupdocs/document.rb
CHANGED
@@ -178,7 +178,6 @@ module GroupDocs
|
|
178
178
|
metadata.views_count = json[:views_count]
|
179
179
|
if json[:last_view]
|
180
180
|
metadata.last_view = json[:last_view]
|
181
|
-
|
182
181
|
end
|
183
182
|
end
|
184
183
|
end
|
@@ -590,7 +589,7 @@ module GroupDocs
|
|
590
589
|
# @example
|
591
590
|
# file = GroupDocs::Storage::Folder.list!.last
|
592
591
|
# document = file.to_document
|
593
|
-
# document.
|
592
|
+
# document.representations! first_page: 0, page_count: 1, passwordSalt: ***
|
594
593
|
#
|
595
594
|
# @param [Hash] options
|
596
595
|
# @option options [Integer] :page_number Start page to return image for (starting with 0)
|
@@ -645,7 +644,7 @@ module GroupDocs
|
|
645
644
|
api = Api::Request.new do |request|
|
646
645
|
request[:access] = access
|
647
646
|
request[:method] = :PUT
|
648
|
-
request[:path] = "/doc/{{client_id}}/files/#{file.
|
647
|
+
request[:path] = "/doc/{{client_id}}/files/#{file.id}/accessinfo"
|
649
648
|
end
|
650
649
|
api.add_params(:mode => ACCESS_MODES[mode])
|
651
650
|
json = api.execute!
|
@@ -1061,6 +1060,7 @@ module GroupDocs
|
|
1061
1060
|
end
|
1062
1061
|
|
1063
1062
|
#
|
1063
|
+
# Changed in release 1.5.8
|
1064
1064
|
# Returns document details.
|
1065
1065
|
#
|
1066
1066
|
# @param [Hash] access Access credentials
|
@@ -1072,13 +1072,14 @@ module GroupDocs
|
|
1072
1072
|
api = Api::Request.new do |request|
|
1073
1073
|
request[:access] = access
|
1074
1074
|
request[:method] = :GET
|
1075
|
-
request[:path] = "/comparison/{{client_id}}
|
1075
|
+
request[:path] = "/comparison/{{client_id}}document"
|
1076
1076
|
end
|
1077
1077
|
api.add_params(:guid => file.guid)
|
1078
1078
|
api.execute!
|
1079
1079
|
end
|
1080
1080
|
|
1081
1081
|
#
|
1082
|
+
# Changed in release 1.5.8
|
1082
1083
|
# Schedules a job for comparing document with given.
|
1083
1084
|
#
|
1084
1085
|
# @param [GroupDocs::Document] document
|
@@ -1096,7 +1097,7 @@ module GroupDocs
|
|
1096
1097
|
api = Api::Request.new do |request|
|
1097
1098
|
request[:access] = access
|
1098
1099
|
request[:method] = :GET
|
1099
|
-
request[:path] = "/comparison/{{client_id}}/
|
1100
|
+
request[:path] = "/comparison/{{client_id}}/compare"
|
1100
1101
|
end
|
1101
1102
|
api.add_params(:source => file.guid, :target => document.file.guid, :callback => callback)
|
1102
1103
|
json = api.execute!
|
@@ -1124,10 +1125,9 @@ module GroupDocs
|
|
1124
1125
|
api = Api::Request.new do |request|
|
1125
1126
|
request[:access] = access
|
1126
1127
|
request[:method] = :PUT
|
1127
|
-
request[:path] = "/comparison/{
|
1128
|
+
request[:path] = "/comparison/public/#{file.guid}/changes"
|
1128
1129
|
request[:request_body] = changes
|
1129
1130
|
end
|
1130
|
-
api.add_params(:resultFileId => file.guid)
|
1131
1131
|
json = api.execute!
|
1132
1132
|
|
1133
1133
|
json[:changes].map do |change|
|
@@ -1136,6 +1136,7 @@ module GroupDocs
|
|
1136
1136
|
end
|
1137
1137
|
|
1138
1138
|
#
|
1139
|
+
# @Changed in realese 1.5.8
|
1139
1140
|
# Returns an array of changes in document.
|
1140
1141
|
#
|
1141
1142
|
# @example
|
@@ -1154,9 +1155,8 @@ module GroupDocs
|
|
1154
1155
|
api = Api::Request.new do |request|
|
1155
1156
|
request[:access] = access
|
1156
1157
|
request[:method] = :GET
|
1157
|
-
request[:path] = '/comparison/{
|
1158
|
+
request[:path] = '/comparison/public/#{file.guid}/changes'
|
1158
1159
|
end
|
1159
|
-
api.add_params(:resultFileId => file.guid)
|
1160
1160
|
json = api.execute!
|
1161
1161
|
|
1162
1162
|
json[:changes].map do |change|
|
@@ -1165,11 +1165,19 @@ module GroupDocs
|
|
1165
1165
|
end
|
1166
1166
|
|
1167
1167
|
#
|
1168
|
+
# Changed in realese 1.5.8
|
1168
1169
|
# Download comparison result file.
|
1169
1170
|
#
|
1171
|
+
# @example
|
1172
|
+
# document_one = GroupDocs::Storage::Folder.list![0].to_document
|
1173
|
+
# document_two = GroupDocs::Storage::Folder.list![1].to_document
|
1174
|
+
# job = document_one.compare!(document_two)
|
1175
|
+
# sleep(5) # wait for server to finish comparing
|
1176
|
+
# result = job.documents![:outputs].first
|
1177
|
+
# result.download!("#{File.dirname(__FILE__)}", {:format => 'pdf'})
|
1178
|
+
#
|
1170
1179
|
# @param [Hash] options
|
1171
|
-
# @option format [String] :format Comparison result file GUID
|
1172
|
-
# @option resultFileId [String] :resultFileId Comparison result file GUID
|
1180
|
+
# @option format [String] :format Comparison result file GUID #
|
1173
1181
|
# @param [Hash] access Access credentials
|
1174
1182
|
# @option access [String] :client_id
|
1175
1183
|
# @option access [String] :private_key
|
@@ -1179,12 +1187,17 @@ module GroupDocs
|
|
1179
1187
|
api = Api::Request.new do |request|
|
1180
1188
|
request[:access] = access
|
1181
1189
|
request[:method] = :DOWNLOAD
|
1182
|
-
request[:path] = "/comparison/{
|
1190
|
+
request[:path] = "/comparison/public/#{file.guid}/download"
|
1183
1191
|
end
|
1184
1192
|
api.add_params(options)
|
1185
1193
|
response = api.execute!
|
1186
1194
|
|
1187
|
-
|
1195
|
+
if file.name.split('.').last != options[:format]
|
1196
|
+
file_name = file.name.delete!(file.name.split('.').last) + options[:format]
|
1197
|
+
else
|
1198
|
+
file_name = file.name
|
1199
|
+
end
|
1200
|
+
filepath = "#{path}/#{file_name}"
|
1188
1201
|
Object::File.open(filepath, 'wb') do |file|
|
1189
1202
|
file.write(response)
|
1190
1203
|
end
|
@@ -1357,6 +1370,7 @@ module GroupDocs
|
|
1357
1370
|
# Pass all unknown methods to file.
|
1358
1371
|
#
|
1359
1372
|
|
1373
|
+
|
1360
1374
|
def method_missing(method, *args, &blk)
|
1361
1375
|
file.respond_to?(method) ? file.send(method, *args, &blk) : super
|
1362
1376
|
end
|
@@ -1365,5 +1379,79 @@ module GroupDocs
|
|
1365
1379
|
super or file.respond_to?(method)
|
1366
1380
|
end
|
1367
1381
|
|
1382
|
+
|
1383
|
+
#
|
1384
|
+
# added in release 1.5.8
|
1385
|
+
#
|
1386
|
+
# Returns document hyperlinks
|
1387
|
+
#
|
1388
|
+
# @param [Hash] access Access credentials
|
1389
|
+
# @option access [String] :client_id
|
1390
|
+
# @option access [String] :private_key
|
1391
|
+
#
|
1392
|
+
def hyperlinks!(access = {})
|
1393
|
+
json = Api::Request.new do |request|
|
1394
|
+
request[:access] = access
|
1395
|
+
request[:method] = :GET
|
1396
|
+
request[:path] = "/doc/{{client_id}}/files/#{file.guid}/hyperlinks"
|
1397
|
+
end.execute!
|
1398
|
+
|
1399
|
+
json[:links]
|
1400
|
+
end
|
1401
|
+
|
1402
|
+
#
|
1403
|
+
# Changed in release 1.5.8
|
1404
|
+
#
|
1405
|
+
#
|
1406
|
+
# Public Sign document
|
1407
|
+
#
|
1408
|
+
# @param [String] document Document GUID
|
1409
|
+
# @param [Hash] settings Settings of the signing document
|
1410
|
+
# @param settings [String] waterMarkText
|
1411
|
+
# @param settings [String] waterMarkImage
|
1412
|
+
# @param settings [String] name (required)
|
1413
|
+
# @param settings [Double] top (required)
|
1414
|
+
# @param settings [Double] left (required)
|
1415
|
+
# @param settings [Double] width (required)
|
1416
|
+
# @param settings [Double] height (required)
|
1417
|
+
# @param settings [String] placeSignatureOn (required)
|
1418
|
+
# @param settings [String] data
|
1419
|
+
# @param [Hash] access Access credentials
|
1420
|
+
# @option access [String] :client_id
|
1421
|
+
# @option access [String] :private_key
|
1422
|
+
# @return [Array]
|
1423
|
+
#
|
1424
|
+
def public_sign_document!(options = {}, access = {})
|
1425
|
+
json = Api::Request.new do |request|
|
1426
|
+
request[:access] = access
|
1427
|
+
request[:method] = :POST
|
1428
|
+
request[:path] = "/signature/public/documents/#{file.guid}/sign"
|
1429
|
+
request[:request_body] = options
|
1430
|
+
end.execute!
|
1431
|
+
|
1432
|
+
json[:jobId]
|
1433
|
+
end
|
1434
|
+
|
1435
|
+
#
|
1436
|
+
# Changed in release 1.5.8
|
1437
|
+
#
|
1438
|
+
#
|
1439
|
+
# Get document fields
|
1440
|
+
#
|
1441
|
+
# @param [String] document Document GUID
|
1442
|
+
# @param [Hash] settings Settings of the signing document
|
1443
|
+
# @param [Hash] access Access credentials
|
1444
|
+
# @option access [String] :client_id
|
1445
|
+
# @option access [String] :private_key
|
1446
|
+
# @return [Array]
|
1447
|
+
#
|
1448
|
+
def self.public_fields!(access = {})
|
1449
|
+
Api::Request.new do |request|
|
1450
|
+
request[:access] = access
|
1451
|
+
request[:method] = :GET
|
1452
|
+
request[:path] = "/signature/public/documents/#{file.guid}/fields"
|
1453
|
+
end.execute!
|
1454
|
+
end
|
1455
|
+
|
1368
1456
|
end # Document
|
1369
1457
|
end # GroupDocs
|
@@ -6,6 +6,8 @@ module GroupDocs
|
|
6
6
|
|
7
7
|
include Api::Helpers::AccessMode
|
8
8
|
|
9
|
+
#AnnotationType = { Text: 0, Area: 1, Point: 2, TextStrikeout: 3, Polyline: 4, TextField: 5, Watermark: 6 }
|
10
|
+
|
9
11
|
TYPES = %w(Text Area Point TextStrikeout Polyline)
|
10
12
|
|
11
13
|
# @attr [GroupDocs::Document] document
|
@@ -44,6 +46,13 @@ module GroupDocs
|
|
44
46
|
#@attr [String]Font Color
|
45
47
|
attr_accessor :fontColor
|
46
48
|
|
49
|
+
#added in release 1.5.8
|
50
|
+
#@attr [Int]pageNumber
|
51
|
+
attr_accessor :pageNumber
|
52
|
+
#@attr [Long] serverTime
|
53
|
+
attr_accessor :serverTime
|
54
|
+
#attr [Array]
|
55
|
+
|
47
56
|
# Compatibility with response JSON
|
48
57
|
alias_method :annotationGuid=, :guid=
|
49
58
|
|
@@ -54,8 +63,10 @@ module GroupDocs
|
|
54
63
|
alias_accessor :reply_guid, :replyGuid
|
55
64
|
alias_accessor :created_on, :createdOn
|
56
65
|
alias_accessor :annotation_position, :annotationPosition
|
57
|
-
|
58
|
-
|
66
|
+
|
67
|
+
#added in release 1.5.8
|
68
|
+
alias_accessor :page_number, :pageNumber
|
69
|
+
alias_accessor :server_time, :serverTime
|
59
70
|
|
60
71
|
#
|
61
72
|
# Creates new GroupDocs::Document::Annotation.
|
@@ -196,7 +207,7 @@ module GroupDocs
|
|
196
207
|
# @option access [String] :client_id
|
197
208
|
# @option access [String] :private_key
|
198
209
|
#
|
199
|
-
def
|
210
|
+
def remove!(access = {})
|
200
211
|
Api::Request.new do |request|
|
201
212
|
request[:access] = access
|
202
213
|
request[:method] = :DELETE
|
@@ -240,28 +251,33 @@ module GroupDocs
|
|
240
251
|
self.annotation_position = { :x => x, :y => y }
|
241
252
|
end
|
242
253
|
|
254
|
+
#
|
255
|
+
# Changed in release 1.5.8
|
243
256
|
#
|
244
257
|
# Moves annotation marker to given coordinates.
|
245
258
|
#
|
246
|
-
# @param [
|
247
|
-
# @param [Integer, Float] y
|
259
|
+
# @param [GroupDocs::Annotation::Marker] marker Marker position
|
248
260
|
# @param [Hash] access Access credentials
|
249
261
|
# @option access [String] :client_id
|
250
262
|
# @option access [String] :private_key
|
251
263
|
#
|
252
|
-
def move_marker!(
|
264
|
+
def move_marker!(marker, access = {})
|
265
|
+
marker.is_a?(GroupDocs::Document::Annotation::MarkerPosition) or raise ArgumentError,
|
266
|
+
"Marker should be GroupDocs::Document::Annotation::MarkerPosition object, received: #{marker.inspect}"
|
253
267
|
Api::Request.new do |request|
|
254
268
|
request[:access] = access
|
255
269
|
request[:method] = :PUT
|
256
270
|
request[:path] = "/ant/{{client_id}}/annotations/#{guid}/markerPosition"
|
257
|
-
request[:request_body] =
|
271
|
+
request[:request_body] = marker
|
258
272
|
end.execute!
|
259
273
|
|
260
|
-
if box
|
261
|
-
box.x = x
|
262
|
-
box.y = y
|
274
|
+
if box && page_number
|
275
|
+
box.x = marker.position[:x]
|
276
|
+
box.y = marker.position[:y]
|
277
|
+
page_number = marker.page
|
263
278
|
else
|
264
|
-
self.box = { :x => x, :y => y }
|
279
|
+
self.box = { :x => marker.position[:x], :y => marker.position[:y] }
|
280
|
+
self.page_number = marker.page
|
265
281
|
end
|
266
282
|
end
|
267
283
|
|
@@ -300,9 +316,8 @@ module GroupDocs
|
|
300
316
|
request[:path] = "/ant/{{client_id}}/annotations/#{guid}/size"
|
301
317
|
request[:request_body] = { :width => x, :height => y }
|
302
318
|
end.execute!
|
319
|
+
self.box = { :width => x, :height => y }
|
303
320
|
|
304
|
-
self.width = x
|
305
|
-
self.height = y
|
306
321
|
end
|
307
322
|
|
308
323
|
#
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# added in release 1.5.8
|
2
|
+
module GroupDocs
|
3
|
+
class Document::Annotation::MarkerPosition
|
4
|
+
|
5
|
+
#
|
6
|
+
# example
|
7
|
+
# marker = GroupDocs::Document::Annotation::MarkerPosition.new()
|
8
|
+
# marker.position = {:x => 100, :y => 100}
|
9
|
+
# marker.page = 1
|
10
|
+
|
11
|
+
# @attr [Array](x,y) position
|
12
|
+
attr_accessor :position
|
13
|
+
|
14
|
+
# @attr [Int] page
|
15
|
+
attr_accessor :page
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
@@ -49,16 +49,23 @@ module GroupDocs
|
|
49
49
|
attr_accessor :userGuid
|
50
50
|
# @attr [String] userName
|
51
51
|
attr_accessor :userName
|
52
|
-
# @attr [String] text
|
53
|
-
attr_accessor :text
|
54
52
|
# @attr [Time] repliedOn
|
55
53
|
attr_accessor :repliedOn
|
56
54
|
|
55
|
+
# added in release 1.5.8
|
56
|
+
# @attr [String] parentReplyGuid
|
57
|
+
attr_accessor :parentReplyGuid
|
58
|
+
# @attr [Boolean] isAvatarExist
|
59
|
+
attr_accessor :isAvatarExist
|
60
|
+
|
57
61
|
# Human-readable accessors
|
58
62
|
alias_accessor :annotation_guid, :annotationGuid
|
59
63
|
alias_accessor :user_guid, :userGuid
|
60
64
|
alias_accessor :user_name, :userName
|
61
65
|
alias_accessor :replied_on, :repliedOn
|
66
|
+
# added in release 1.5.8
|
67
|
+
alias_accessor :parent_reply_guid, :parentReplyGuid
|
68
|
+
alias_accessor :is_avatar_exist, :isAvatarExist
|
62
69
|
|
63
70
|
#
|
64
71
|
# Creates new GroupDocs::Document::Annotation.
|