groupdocs 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/api-samples/README.md +17 -6
- data/examples/api-samples/app.rb +0 -2
- data/examples/api-samples/public/GroupDocs_Signature_Demo.pdf +0 -0
- data/examples/api-samples/public/docs/docco.css +192 -0
- data/examples/api-samples/public/docs/envelope-sample.html +132 -0
- data/examples/api-samples/public/docs/sample1.html +26 -0
- data/examples/api-samples/public/docs/sample10.html +49 -0
- data/examples/api-samples/public/docs/sample11.html +87 -0
- data/examples/api-samples/public/docs/sample12.html +40 -0
- data/examples/api-samples/public/docs/sample13.html +41 -0
- data/examples/api-samples/public/docs/sample14.html +30 -0
- data/examples/api-samples/public/docs/sample15.html +27 -0
- data/examples/api-samples/public/docs/sample16.html +25 -0
- data/examples/api-samples/public/docs/sample17.html +37 -0
- data/examples/api-samples/public/docs/sample18.html +62 -0
- data/examples/api-samples/public/docs/sample2.html +30 -0
- data/examples/api-samples/public/docs/sample3.html +34 -0
- data/examples/api-samples/public/docs/sample4.html +41 -0
- data/examples/api-samples/public/docs/sample5.html +56 -0
- data/examples/api-samples/public/docs/sample6.html +48 -0
- data/examples/api-samples/public/docs/sample7.html +43 -0
- data/examples/api-samples/public/docs/sample8.html +54 -0
- data/examples/api-samples/public/docs/sample9.html +31 -0
- data/examples/api-samples/samples/envelope-sample.rb +132 -0
- data/examples/api-samples/samples/sample1.rb +10 -2
- data/examples/api-samples/samples/sample10.rb +17 -5
- data/examples/api-samples/samples/sample11.rb +86 -0
- data/examples/api-samples/samples/sample12.rb +39 -0
- data/examples/api-samples/samples/sample13.rb +40 -0
- data/examples/api-samples/samples/sample14.rb +29 -0
- data/examples/api-samples/samples/sample15.rb +26 -0
- data/examples/api-samples/samples/sample16.rb +24 -0
- data/examples/api-samples/samples/sample17.rb +36 -0
- data/examples/api-samples/samples/sample18.rb +61 -0
- data/examples/api-samples/samples/sample2.rb +14 -4
- data/examples/api-samples/samples/sample3.rb +14 -4
- data/examples/api-samples/samples/sample4.rb +12 -3
- data/examples/api-samples/samples/sample5.rb +13 -2
- data/examples/api-samples/samples/sample6.rb +18 -6
- data/examples/api-samples/samples/sample7.rb +9 -0
- data/examples/api-samples/samples/sample8.rb +17 -4
- data/examples/api-samples/samples/sample9.rb +10 -2
- data/examples/api-samples/views/envelope_sample.haml +73 -0
- data/examples/api-samples/views/index.haml +18 -0
- data/examples/api-samples/views/sample1.haml +21 -0
- data/examples/api-samples/views/sample10.haml +21 -0
- data/examples/api-samples/views/sample11.haml +141 -0
- data/examples/api-samples/views/sample12.haml +94 -0
- data/examples/api-samples/views/sample13.haml +90 -0
- data/examples/api-samples/views/sample14.haml +86 -0
- data/examples/api-samples/views/sample15.haml +75 -0
- data/examples/api-samples/views/sample16.haml +68 -0
- data/examples/api-samples/views/sample17.haml +80 -0
- data/examples/api-samples/views/sample18.haml +87 -0
- data/examples/api-samples/views/sample2.haml +21 -0
- data/examples/api-samples/views/sample3.haml +23 -2
- data/examples/api-samples/views/sample4.haml +21 -0
- data/examples/api-samples/views/sample5.haml +21 -0
- data/examples/api-samples/views/sample6.haml +22 -1
- data/examples/api-samples/views/sample7.haml +21 -0
- data/examples/api-samples/views/sample8.haml +22 -1
- data/examples/api-samples/views/sample9.haml +21 -0
- data/lib/groupdocs/job.rb +5 -3
- data/lib/groupdocs/user.rb +33 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/job_spec.rb +5 -0
- data/spec/groupdocs/user_spec.rb +22 -0
- data/spec/support/json/update_account.json +10 -0
- metadata +45 -4
@@ -1,8 +1,11 @@
|
|
1
|
+
# GET request
|
1
2
|
get '/sample5' do
|
2
3
|
haml :sample5
|
3
4
|
end
|
4
5
|
|
6
|
+
# POST request
|
5
7
|
post '/sample5' do
|
8
|
+
# set variables
|
6
9
|
set :client_id, params[:client_id]
|
7
10
|
set :private_key, params[:private_key]
|
8
11
|
set :file_id, params[:file_id]
|
@@ -11,9 +14,13 @@ post '/sample5' do
|
|
11
14
|
set :dest_path, params[:dest_path]
|
12
15
|
|
13
16
|
begin
|
17
|
+
# check required variables
|
14
18
|
raise "Please enter all required parameters" if settings.client_id.empty? or settings.private_key.empty? or settings.file_id.empty?
|
15
19
|
|
20
|
+
# make a request to API using client_id and private_key
|
16
21
|
files_list = GroupDocs::Storage::Folder.list!('/', {}, { :client_id => settings.client_id, :private_key => settings.private_key})
|
22
|
+
|
23
|
+
# get file by file ID
|
17
24
|
manipulate_file = nil
|
18
25
|
files_list.each do |element|
|
19
26
|
if element.id == Integer(settings.file_id)
|
@@ -22,23 +29,27 @@ post '/sample5' do
|
|
22
29
|
end
|
23
30
|
raise "No file with such FileID" if manipulate_file.nil?
|
24
31
|
|
32
|
+
# copy file using request to API
|
25
33
|
unless settings.copy.nil?
|
26
34
|
file = manipulate_file.copy!(settings.dest_path, {}, { :client_id => settings.client_id, :private_key => settings.private_key})
|
27
35
|
button = settings.copy
|
28
36
|
end
|
29
37
|
|
38
|
+
# move file using request to API
|
30
39
|
unless settings.move.nil?
|
31
40
|
file = manipulate_file.move!(settings.dest_path, {}, { :client_id => settings.client_id, :private_key => settings.private_key})
|
32
41
|
button = settings.move
|
33
42
|
end
|
34
43
|
|
44
|
+
# result message
|
35
45
|
if file
|
36
46
|
massage = "File was #{button}'ed to the #{settings.dest_path} folder"
|
37
47
|
end
|
38
48
|
|
39
49
|
rescue Exception => e
|
40
50
|
err = e.message
|
41
|
-
end
|
42
|
-
|
51
|
+
end
|
52
|
+
|
53
|
+
# set variables for template
|
43
54
|
haml :sample5, :locals => { :userId => settings.client_id, :privateKey => settings.private_key, :file_id => settings.file_id, :dest_path => settings.dest_path, :massage => massage, :err => err }
|
44
55
|
end
|
@@ -1,35 +1,47 @@
|
|
1
|
+
# GET request
|
1
2
|
get '/sample6' do
|
2
3
|
haml :sample6
|
3
4
|
end
|
4
5
|
|
6
|
+
# POST request
|
5
7
|
post '/sample6' do
|
8
|
+
# set variables
|
6
9
|
set :client_id, params[:client_id]
|
7
10
|
set :private_key, params[:private_key]
|
8
11
|
|
9
12
|
begin
|
13
|
+
# check required variables
|
10
14
|
raise "Please enter all required parameters" if settings.client_id.empty? or settings.private_key.empty?
|
11
15
|
|
12
|
-
|
16
|
+
# construct file path and open file
|
17
|
+
file_one_path = "#{Dir.tmpdir}/#{params[:document][:filename]}"
|
13
18
|
File.open(file_one_path, 'wb') { |f| f.write(params[:document][:tempfile].read) }
|
14
19
|
|
15
|
-
|
16
|
-
|
20
|
+
# create new file
|
21
|
+
file_one = GroupDocs::Storage::File.new(name: params[:document][:filename], local_path: file_one_path)
|
17
22
|
document_one = file_one.to_document
|
18
23
|
|
19
|
-
|
24
|
+
# construct signature path and open file
|
25
|
+
signature_one_path = "#{Dir.tmpdir}/#{params[:signature][:filename]}"
|
20
26
|
File.open(signature_one_path, 'wb') { |f| f.write(params[:signature][:tempfile].read) }
|
21
27
|
|
28
|
+
# add signature to file using API
|
22
29
|
signature_one = GroupDocs::Signature.new(name: 'Test', image_path: signature_one_path)
|
23
30
|
signature_one.position = { top: 0.1, left: 0.07, width: 50, height: 50}
|
24
31
|
|
32
|
+
# make a request to API using client_id and private_key
|
25
33
|
signed_documents = GroupDocs::Document.sign_documents!([document_one], [signature_one], {}, { :client_id => settings.client_id, :private_key => settings.private_key })
|
34
|
+
guid = signed_documents.first.file.guid
|
35
|
+
|
36
|
+
# generate result
|
26
37
|
if signed_documents
|
27
|
-
|
38
|
+
iframe = "<iframe src='https://apps.groupdocs.com/document-viewer/Embed/#{guid}' frameborder='0' width='720' height='600'></iframe>"
|
28
39
|
end
|
40
|
+
|
29
41
|
rescue Exception => e
|
30
|
-
pp e
|
31
42
|
err = e.message
|
32
43
|
end
|
33
44
|
|
45
|
+
# set variables for template
|
34
46
|
haml :sample6, :locals => { :userId => settings.client_id, :privateKey => settings.private_key, :iframe => iframe, :err => err }
|
35
47
|
end
|
@@ -1,15 +1,22 @@
|
|
1
|
+
# GET request
|
1
2
|
get '/sample7' do
|
2
3
|
haml :sample7
|
3
4
|
end
|
4
5
|
|
6
|
+
# POST request
|
5
7
|
post '/sample7' do
|
8
|
+
# set variables
|
6
9
|
set :client_id, params[:client_id]
|
7
10
|
set :private_key, params[:private_key]
|
8
11
|
|
9
12
|
begin
|
13
|
+
# check required variables
|
10
14
|
raise "Please enter all required parameters" if settings.client_id.empty? or settings.private_key.empty?
|
15
|
+
|
16
|
+
# make a request to API using client_id and private_key
|
11
17
|
files_list = GroupDocs::Storage::Folder.list!('/', {:extended => true}, { :client_id => settings.client_id, :private_key => settings.private_key})
|
12
18
|
|
19
|
+
# construct result string
|
13
20
|
thumbnails = ''
|
14
21
|
files_list.each do |element|
|
15
22
|
if element.class.name.split('::').last == 'Folder'
|
@@ -25,9 +32,11 @@ post '/sample7' do
|
|
25
32
|
unless thumbnails.empty?
|
26
33
|
set :thumbnails, thumbnails
|
27
34
|
end
|
35
|
+
|
28
36
|
rescue Exception => e
|
29
37
|
err = e.message
|
30
38
|
end
|
31
39
|
|
40
|
+
# set variables for template
|
32
41
|
haml :sample7, :locals => { :userId => settings.client_id, :privateKey => settings.private_key, :thumbnailList => thumbnails, :err => err }
|
33
42
|
end
|
@@ -1,40 +1,53 @@
|
|
1
|
+
# GET request
|
1
2
|
get '/sample8' do
|
2
3
|
haml :sample8
|
3
4
|
end
|
5
|
+
|
6
|
+
# POST request
|
4
7
|
post '/sample8' do
|
8
|
+
# set variables
|
5
9
|
set :client_id, params[:client_id]
|
6
10
|
set :private_key, params[:private_key]
|
7
11
|
set :guid, params[:guid]
|
8
12
|
set :page_number, params[:page_number]
|
9
13
|
|
10
|
-
|
11
14
|
# file = GroupDocs::Storage::Folder.list!.last
|
12
15
|
# document = file.to_document
|
13
16
|
# document.page_images! 1024, 768, first_page: 0, page_count: 1
|
14
17
|
|
15
18
|
begin
|
19
|
+
# check required variables
|
16
20
|
raise "Please enter all required parameters" if settings.client_id.empty? or settings.private_key.empty?
|
21
|
+
|
22
|
+
# make a request to API using client_id and private_key
|
17
23
|
files_list = GroupDocs::Storage::Folder.list!('/', {}, { :client_id => settings.client_id, :private_key => settings.private_key})
|
24
|
+
|
18
25
|
doc = nil
|
19
26
|
metadata = nil
|
20
27
|
files_list.each do |element|
|
21
28
|
if element.class.name.split('::').last == 'Folder'
|
22
29
|
next
|
23
30
|
end
|
24
|
-
|
31
|
+
|
32
|
+
# find document and get metadata
|
25
33
|
if element.guid == settings.guid
|
26
34
|
metadata = element.to_document.metadata!({ :client_id => settings.client_id, :private_key => settings.private_key})
|
27
35
|
doc = element.to_document
|
28
36
|
end
|
29
37
|
end
|
38
|
+
|
39
|
+
# get document page images
|
30
40
|
images = doc.page_images!(800, 400, {:first_page => 0, :page_count => metadata.page_count}, { :client_id => settings.client_id, :private_key => settings.private_key})
|
31
41
|
|
42
|
+
# result
|
32
43
|
unless images.empty?
|
33
44
|
image = images[Integer(settings.page_number)]
|
34
45
|
end
|
46
|
+
|
35
47
|
rescue Exception => e
|
36
48
|
err = e.message
|
37
|
-
end
|
38
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
# set variables for template
|
39
52
|
haml :sample8, :locals => { :userId => settings.client_id, :privateKey => settings.private_key, :guid =>settings.guid , :page_number=>settings.page_number, :image=>image, :err => err }
|
40
53
|
end
|
@@ -1,22 +1,30 @@
|
|
1
|
+
# GET request
|
1
2
|
get '/sample9' do
|
2
3
|
haml :sample9
|
3
4
|
end
|
4
5
|
|
6
|
+
# POST request
|
5
7
|
post '/sample9' do
|
8
|
+
# set variables
|
6
9
|
set :guid, params[:guid]
|
7
10
|
set :width, params[:width]
|
8
11
|
set :height, params[:height]
|
9
12
|
|
10
13
|
begin
|
14
|
+
# check required variables
|
11
15
|
raise "Please enter all required parameters" if settings.guid.empty? or settings.width.empty? or settings.height.empty?
|
16
|
+
|
17
|
+
# construct result string
|
12
18
|
v_url = "https://apps.groupdocs.com/document-viewer/embed/#{settings.guid}?frameborder='0' width='#{settings.width}' height='#{settings.height}'"
|
13
19
|
|
14
20
|
if v_url
|
15
21
|
v_url = v_url
|
16
22
|
end
|
23
|
+
|
17
24
|
rescue Exception => e
|
18
25
|
err = e.message
|
19
|
-
end
|
20
|
-
|
26
|
+
end
|
27
|
+
|
28
|
+
# set variables for template
|
21
29
|
haml :sample9, :locals => { :guid => settings.guid, :width => settings.width, :height => settings.height, :v_url=>v_url, :err => err }
|
22
30
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
%h3{:style => "text-align:center;"}
|
2
|
+
%a{:href => "/"} GroupDocs Ruby SDK Samples
|
3
|
+
\- Envelope sample
|
4
|
+
.samplecontent{:style => "padding:10px;"}
|
5
|
+
%i This sample will show how to use envelope and signature API using Ruby SDK
|
6
|
+
%br/
|
7
|
+
%i This sample create fields for signing automatically from pdf document, you can find example of such document
|
8
|
+
%a{:href => "https://github.com/groupdocs/groupdocs-ruby/blob/master/examples/api-samples/public/GroupDocs_Signature_Demo.pdf?raw=true"} here
|
9
|
+
%br/
|
10
|
+
%br/
|
11
|
+
%i To check callback click
|
12
|
+
%a{:href => "/envelope-sample/check"} here
|
13
|
+
%br/
|
14
|
+
%br/
|
15
|
+
%i You can find documentation for this sample
|
16
|
+
%a{:href => "/docs/envelope-sample.html"} here
|
17
|
+
%br/
|
18
|
+
%br/
|
19
|
+
%p
|
20
|
+
You entered:
|
21
|
+
%p
|
22
|
+
UserId = #{(defined? client_id) ? client_id : ""}
|
23
|
+
%p
|
24
|
+
PrivateKey = #{(defined? private_key) ? private_key : ""}
|
25
|
+
%p
|
26
|
+
%font{:color => "red"} #{(defined? err) ? err : ""}
|
27
|
+
%br/
|
28
|
+
#requestForm{:style => "padding:20px; border:1px solid black;"}
|
29
|
+
%p Enter data for request and press "Make request" button
|
30
|
+
%form{:action => "/envelope-sample", :enctype => "multipart/form-data", :method => "post"}
|
31
|
+
%label{:for => "client_id"} GroupDocs ClientID
|
32
|
+
%br/
|
33
|
+
%input{:type=>"text", :name=>"client_id"}
|
34
|
+
%br/
|
35
|
+
%label{:for => "private_key"} GroupDocs PrivateKey
|
36
|
+
%br/
|
37
|
+
%input{:type=>"text", :name=>"private_key"}
|
38
|
+
%br/
|
39
|
+
%label{:for => "file"} File
|
40
|
+
%br/
|
41
|
+
%input{:name => "file", :type => "file"}/
|
42
|
+
%br/
|
43
|
+
%br/
|
44
|
+
%input{:type => "submit", :value => "Upload"}/
|
45
|
+
%div{:style => "padding:20px; border:1px solid black;"}
|
46
|
+
%p
|
47
|
+
Results:
|
48
|
+
#{(defined? iframe) ? iframe : ""}
|
49
|
+
|
50
|
+
|
51
|
+
%div{:style => "padding:10px;"}
|
52
|
+
Choose anothe one sample:
|
53
|
+
%ul
|
54
|
+
%li
|
55
|
+
%a{:href => "/sample1"} Sample1 - How to login to GroupDocs using the API
|
56
|
+
%li
|
57
|
+
%a{:href => "/sample2"} Sample2 - How to list files within GroupDocs Storage using the Storage API
|
58
|
+
%li
|
59
|
+
%a{:href => "/sample3"} Sample3 - How to upload a file to GroupDocs using the Storage API
|
60
|
+
%li
|
61
|
+
%a{:href => "/sample4"} Sample4 - How to download a file from GroupDocs Storage using the Storage API
|
62
|
+
%li
|
63
|
+
%a{:href => "/sample5"} Sample5 - How to copy / move a file using the GroupDocs Storage API
|
64
|
+
%li
|
65
|
+
%a{:href => "/sample6"} Sample6 - How to add a Signature to a document in GroupDocs Signature
|
66
|
+
%li
|
67
|
+
%a{:href => "/sample7"} Sample7 - How to create a list of thumbnails for a document
|
68
|
+
%li
|
69
|
+
%a{:href => "/sample8"} Sample8 - How to return a URL representing a single page of a Document
|
70
|
+
%li
|
71
|
+
%a{:href => "/sample9"} Sample9 - How to generate an embedded Viewer URL for a Document
|
72
|
+
%li
|
73
|
+
%a{:href => "/sample10"} Sample10 - How to share a document to other users
|
@@ -21,3 +21,21 @@
|
|
21
21
|
%a{:href => "/sample9"}Sample9 - How to generate an embedded Viewer URL for a Document
|
22
22
|
%li
|
23
23
|
%a{:href => "/sample10"}Sample10 - How to share a document to other users
|
24
|
+
%li
|
25
|
+
%a{:href => "/sample11"}Sample11 - How programmatically create and post an annotation into document. How to delete the annotation
|
26
|
+
%li
|
27
|
+
%a{:href => "/sample12"}Sample12 - How to list all annotations from document
|
28
|
+
%li
|
29
|
+
%a{:href => "/sample13"}Sample13 - How to add collaborator to doc with annotations
|
30
|
+
%li
|
31
|
+
%a{:href => "/sample14"}Sample14 - How to check the list of shares for a folder
|
32
|
+
%li
|
33
|
+
%a{:href => "/sample15"}Sample15 - How to check the number of document's views
|
34
|
+
%li
|
35
|
+
%a{:href => "/sample16"}Sample16 - How to insert Assembly questionary into webpage
|
36
|
+
%li
|
37
|
+
%a{:href => "/sample17"}Sample17 - How to upload a file into the storage and compress it into zip archive
|
38
|
+
%li
|
39
|
+
%a{:href => "/sample18"}Sample18 - How to convert Doc to Docx, Docx to Doc, Docx to PDF, PPT to PDF
|
40
|
+
%li
|
41
|
+
%a{:href => "/envelope-sample"}Envelope sample - How to use envelope and signature API
|
@@ -5,6 +5,9 @@
|
|
5
5
|
.samplecontent{:style => "padding:10px;"}
|
6
6
|
%i This sample will show how to use Signer object to be authorized at GroupDocs and how to get GroupDocs user infromation using Ruby SDK
|
7
7
|
%br/
|
8
|
+
%i You can find documentation for this sample
|
9
|
+
%a{:href => "/docs/sample1.html"} here
|
10
|
+
%br/
|
8
11
|
%br/
|
9
12
|
%p
|
10
13
|
You entered:
|
@@ -69,3 +72,21 @@
|
|
69
72
|
%a{:href => "/sample9"} Sample9 - How to generate an embedded Viewer URL for a Document
|
70
73
|
%li
|
71
74
|
%a{:href => "/sample10"} Sample10 - How to share a document to other users
|
75
|
+
%li
|
76
|
+
%a{:href => "/sample11"}Sample11 - How programmatically create and post an annotation into document. How to delete the annotation
|
77
|
+
%li
|
78
|
+
%a{:href => "/sample12"}Sample12 - How to list all annotations from document
|
79
|
+
%li
|
80
|
+
%a{:href => "/sample13"}Sample13 - How to add collaborator to doc with annotations
|
81
|
+
%li
|
82
|
+
%a{:href => "/sample14"}Sample14 - How to check the list of shares for a folder
|
83
|
+
%li
|
84
|
+
%a{:href => "/sample15"}Sample15 - How to check the number of document's views
|
85
|
+
%li
|
86
|
+
%a{:href => "/sample16"}Sample16 - How to insert Assembly questionary into webpage
|
87
|
+
%li
|
88
|
+
%a{:href => "/sample17"}Sample17 - How to upload a file into the storage and compress it into zip archive
|
89
|
+
%li
|
90
|
+
%a{:href => "/sample18"}Sample18 - How to convert Doc to Docx, Docx to Doc, Docx to PDF, PPT to PDF
|
91
|
+
%li
|
92
|
+
%a{:href => "/envelope-sample"}Envelope sample - How to use envelope and signature API
|
@@ -4,6 +4,9 @@
|
|
4
4
|
.samplecontent{:style => "padding:10px;"}
|
5
5
|
%i This sample will show how to share particular document from your GroupDocs account to other GroupDocs users using Ruby SDK
|
6
6
|
%br/
|
7
|
+
%i You can find documentation for this sample
|
8
|
+
%a{:href => "/docs/sample10.html"} here
|
9
|
+
%br/
|
7
10
|
%br/
|
8
11
|
%p
|
9
12
|
You entered:
|
@@ -67,3 +70,21 @@
|
|
67
70
|
%a{:href => "/sample9"} Sample9 - How to generate an embedded Viewer URL for a Document
|
68
71
|
%li
|
69
72
|
%a{:href => "/sample10"} Sample10 - How to share a document to other users
|
73
|
+
%li
|
74
|
+
%a{:href => "/sample11"}Sample11 - How programmatically create and post an annotation into document. How to delete the annotation
|
75
|
+
%li
|
76
|
+
%a{:href => "/sample12"}Sample12 - How to list all annotations from document
|
77
|
+
%li
|
78
|
+
%a{:href => "/sample13"}Sample13 - How to add collaborator to doc with annotations
|
79
|
+
%li
|
80
|
+
%a{:href => "/sample14"}Sample14 - How to check the list of shares for a folder
|
81
|
+
%li
|
82
|
+
%a{:href => "/sample15"}Sample15 - How to check the number of document's views
|
83
|
+
%li
|
84
|
+
%a{:href => "/sample16"}Sample16 - How to insert Assembly questionary into webpage
|
85
|
+
%li
|
86
|
+
%a{:href => "/sample17"}Sample17 - How to upload a file into the storage and compress it into zip archive
|
87
|
+
%li
|
88
|
+
%a{:href => "/sample18"}Sample18 - How to convert Doc to Docx, Docx to Doc, Docx to PDF, PPT to PDF
|
89
|
+
%li
|
90
|
+
%a{:href => "/envelope-sample"}Envelope sample - How to use envelope and signature API
|
@@ -0,0 +1,141 @@
|
|
1
|
+
%script{ :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js', :type => 'text/javascript', :charset => 'utf-8' }
|
2
|
+
%h3{:style => "text-align:center;"}
|
3
|
+
%a{:href => "/"} GroupDocs Ruby SDK Samples
|
4
|
+
\- Sample11
|
5
|
+
.samplecontent{:style => "padding:10px;"}
|
6
|
+
%i This sample will show how programmatically create and post an annotation into document. How to delete the annotation using Ruby SDK
|
7
|
+
%br/
|
8
|
+
%br/
|
9
|
+
%p
|
10
|
+
You entered:
|
11
|
+
%p
|
12
|
+
UserId = #{(defined? userId) ? userId : ""}
|
13
|
+
%p
|
14
|
+
PrivateKey = #{(defined? privateKey) ? privateKey : ""}
|
15
|
+
%p
|
16
|
+
FileId = #{(defined? fileId) ? fileId : ""}
|
17
|
+
%p
|
18
|
+
Annotation ID = #{(defined? annotationId) ? annotationId : ""}
|
19
|
+
%p
|
20
|
+
Annotation Type = #{(defined? annotationType) ? annotationType : ""}
|
21
|
+
%p
|
22
|
+
Annotation Text = #{(defined? annotationText) ? annotationText : ""}
|
23
|
+
%p
|
24
|
+
%font{:color => "red"} #{(defined? err) ? err : ""}
|
25
|
+
%br/
|
26
|
+
|
27
|
+
#requestForm{:style => "padding:20px; border:1px solid black;"}
|
28
|
+
%form{:action => "/sample11", :method => "post"}
|
29
|
+
%input{:type => 'hidden', :name => 'annotationId', :value => (defined? annotationId) ? annotationId : ""}
|
30
|
+
%p Enter data for request and press "Make request" button
|
31
|
+
|
32
|
+
%label{:for => "client_id"} GroupDocs ClientID
|
33
|
+
%br/
|
34
|
+
%input{:type=>"text", :name=>"client_id", :value => (defined? userId) ? userId : ""}
|
35
|
+
%br/
|
36
|
+
%label{:for => "private_key"} GroupDocs PrivateKey
|
37
|
+
%br/
|
38
|
+
%input{:type=>"text", :name=>"private_key", :value => (defined? privateKey) ? privateKey : ""}
|
39
|
+
%br/
|
40
|
+
%label{:for => "file_id"} GroupDocs FileID
|
41
|
+
%br/
|
42
|
+
%input{:type=>"text", :name=>"fileId", :value => (defined? fileId) ? fileId : ""}
|
43
|
+
%br/
|
44
|
+
Annotation Type
|
45
|
+
%br/
|
46
|
+
%select{:name => 'annotation_type', :id => 'annotation_type'}
|
47
|
+
%option{:value => 'text'}Text
|
48
|
+
%option{:value => 'area'}Area
|
49
|
+
%option{:value => 'point', :selected => "selected"}Point
|
50
|
+
%br/
|
51
|
+
%br/
|
52
|
+
|
53
|
+
%fieldset
|
54
|
+
%legend Parameters (all are required)
|
55
|
+
%div
|
56
|
+
%span Box X
|
57
|
+
%input{:type=>"text", :name=>"box_x", :placeholder => "double"}
|
58
|
+
%div
|
59
|
+
%span Box Y
|
60
|
+
%input{:type=>"text", :name=>"box_y", :placeholder => "double"}
|
61
|
+
|
62
|
+
%div{:style => "display:none", :id => "box-params"}
|
63
|
+
%div
|
64
|
+
%span Box Width
|
65
|
+
%input{:type=>"text", :name=>"box_width", :placeholder => "double"}
|
66
|
+
%div
|
67
|
+
%span Box Height
|
68
|
+
%input{:type=>"text", :name=>"box_height", :placeholder => "double"}
|
69
|
+
|
70
|
+
%div{:style => "display:none", :id => "annotation-position"}
|
71
|
+
%div
|
72
|
+
%span Annotation Position X
|
73
|
+
%input{:type=>"text", :name=>"annotationPosition_x", :placeholder => "double"}
|
74
|
+
%div
|
75
|
+
%span Annotation Position Y
|
76
|
+
%input{:type=>"text", :name=>"annotationPosition_y", :placeholder => "double"}
|
77
|
+
|
78
|
+
%div
|
79
|
+
%span Text
|
80
|
+
%input{:type=>"text", :name=>"text", :placeholder => "text"}
|
81
|
+
|
82
|
+
|
83
|
+
%input{:type => "submit", :value => "Make request"}/
|
84
|
+
|
85
|
+
%div{:style => "padding:10px;"}
|
86
|
+
Choose another one sample:
|
87
|
+
%ul
|
88
|
+
%li
|
89
|
+
%a{:href => "/sample1"} Sample1 - How to login to GroupDocs using the API
|
90
|
+
%li
|
91
|
+
%a{:href => "/sample2"} Sample2 - How to list files within GroupDocs Storage using the Storage API
|
92
|
+
%li
|
93
|
+
%a{:href => "/sample3"} Sample3 - How to upload a file to GroupDocs using the Storage API
|
94
|
+
%li
|
95
|
+
%a{:href => "/sample4"} Sample4 - How to download a file from GroupDocs Storage using the Storage API
|
96
|
+
%li
|
97
|
+
%a{:href => "/sample5"} Sample5 - How to copy / move a file using the GroupDocs Storage API
|
98
|
+
%li
|
99
|
+
%a{:href => "/sample6"} Sample6 - How to add a Signature to a document in GroupDocs Signature
|
100
|
+
%li
|
101
|
+
%a{:href => "/sample7"} Sample7 - How to create a list of thumbnails for a document
|
102
|
+
%li
|
103
|
+
%a{:href => "/sample8"} Sample8 - How to return a URL representing a single page of a Document
|
104
|
+
%li
|
105
|
+
%a{:href => "/sample9"} Sample9 - How to generate an embedded Viewer URL for a Document
|
106
|
+
%li
|
107
|
+
%a{:href => "/sample10"} Sample10 - How to share a document to other users
|
108
|
+
%li
|
109
|
+
%a{:href => "/sample11"}Sample11 - How programmatically create and post an annotation into document. How to delete the annotation
|
110
|
+
%li
|
111
|
+
%a{:href => "/sample12"}Sample12 - How to list all annotations from document
|
112
|
+
%li
|
113
|
+
%a{:href => "/sample13"}Sample13 - How to add collaborator to doc with annotations
|
114
|
+
%li
|
115
|
+
%a{:href => "/sample14"}Sample14 - How to check the list of shares for a folder
|
116
|
+
%li
|
117
|
+
%a{:href => "/sample15"}Sample15 - How to check the number of document's views
|
118
|
+
%li
|
119
|
+
%a{:href => "/sample16"}Sample16 - How to insert Assembly questionary into webpage
|
120
|
+
%li
|
121
|
+
%a{:href => "/sample17"}Sample17 - How to upload a file into the storage and compress it into zip archive
|
122
|
+
%li
|
123
|
+
%a{:href => "/sample18"}Sample18 - How to convert Doc to Docx, Docx to Doc, Docx to PDF, PPT to PDF
|
124
|
+
|
125
|
+
:javascript
|
126
|
+
$(function() {
|
127
|
+
$('select[name="annotation_type"]').change(function() {
|
128
|
+
var obj = $(this);
|
129
|
+
|
130
|
+
if (obj.val() == "text") {
|
131
|
+
$('#text-params, #annotation-position, #box-params').show();
|
132
|
+
}
|
133
|
+
else if (obj.val() == "area") {
|
134
|
+
$('#box-params').show();
|
135
|
+
$('#annotation-position').hide();
|
136
|
+
}
|
137
|
+
else if (obj.val() == "point") {
|
138
|
+
$('#annotation-position, #box-params').hide();
|
139
|
+
}
|
140
|
+
});
|
141
|
+
});
|
@@ -0,0 +1,94 @@
|
|
1
|
+
%h3{:style => "text-align:center;"}
|
2
|
+
%a{:href => "/"} GroupDocs Ruby SDK Samples
|
3
|
+
\- Sample12
|
4
|
+
.samplecontent{:style => "padding:10px;"}
|
5
|
+
%i This sample will show how to to list all annotations from document using Ruby SDK
|
6
|
+
%br/
|
7
|
+
%br/
|
8
|
+
%p
|
9
|
+
You entered:
|
10
|
+
%p
|
11
|
+
UserId = #{(defined? userId) ? userId : ""}
|
12
|
+
%p
|
13
|
+
PrivateKey = #{(defined? privateKey) ? privateKey : ""}
|
14
|
+
%p
|
15
|
+
FileId = #{(defined? fileId) ? fileId : ""}
|
16
|
+
%p
|
17
|
+
%font{:color => "red"} #{(defined? err) ? err : ""}
|
18
|
+
%br/
|
19
|
+
#requestForm{:style => "padding:20px; border:1px solid black;"}
|
20
|
+
%p Enter data for request and press "Make request" button
|
21
|
+
%form{:action => "/sample12", :method => "post"}
|
22
|
+
%label{:for => "client_id"} GroupDocs ClientID
|
23
|
+
%br/
|
24
|
+
%input{:type=>"text", :name=>"client_id"}
|
25
|
+
%br/
|
26
|
+
%label{:for => "private_key"} GroupDocs PrivateKey
|
27
|
+
%br/
|
28
|
+
%input{:type=>"text", :name=>"private_key"}
|
29
|
+
%br/
|
30
|
+
%label{:for => "file_id"} GroupDocs FileID
|
31
|
+
%br/
|
32
|
+
%input{:type=>"text", :name=>"fileId"}
|
33
|
+
%br/
|
34
|
+
%br/
|
35
|
+
%input{:type => "submit", :value => "Make request"}/
|
36
|
+
%div{:style => "padding:20px; border:1px solid black;"}
|
37
|
+
%p
|
38
|
+
Results:
|
39
|
+
|
40
|
+
- if defined? annotations.first
|
41
|
+
- annotations.each do |annotation|
|
42
|
+
%div
|
43
|
+
Access: #{annotation.access}
|
44
|
+
%br/
|
45
|
+
Type: #{annotation.type}
|
46
|
+
%br/
|
47
|
+
Replies:
|
48
|
+
%ul
|
49
|
+
- annotation.replies.each do |reply|
|
50
|
+
%li
|
51
|
+
#{reply.userName} : #{reply.text}
|
52
|
+
|
53
|
+
|
54
|
+
%div{:style => "padding:10px;"}
|
55
|
+
Choose another one sample:
|
56
|
+
%ul
|
57
|
+
%li
|
58
|
+
%a{:href => "/sample1"} Sample1 - How to login to GroupDocs using the API
|
59
|
+
%li
|
60
|
+
%a{:href => "/sample2"} Sample2 - How to list files within GroupDocs Storage using the Storage API
|
61
|
+
%li
|
62
|
+
%a{:href => "/sample3"} Sample3 - How to upload a file to GroupDocs using the Storage API
|
63
|
+
%li
|
64
|
+
%a{:href => "/sample4"} Sample4 - How to download a file from GroupDocs Storage using the Storage API
|
65
|
+
%li
|
66
|
+
%a{:href => "/sample5"} Sample5 - How to copy / move a file using the GroupDocs Storage API
|
67
|
+
%li
|
68
|
+
%a{:href => "/sample6"} Sample6 - How to add a Signature to a document in GroupDocs Signature
|
69
|
+
%li
|
70
|
+
%a{:href => "/sample7"} Sample7 - How to create a list of thumbnails for a document
|
71
|
+
%li
|
72
|
+
%a{:href => "/sample8"} Sample8 - How to return a URL representing a single page of a Document
|
73
|
+
%li
|
74
|
+
%a{:href => "/sample9"} Sample9 - How to generate an embedded Viewer URL for a Document
|
75
|
+
%li
|
76
|
+
%a{:href => "/sample10"} Sample10 - How to share a document to other users
|
77
|
+
%li
|
78
|
+
%a{:href => "/sample11"}Sample11 - How programmatically create and post an annotation into document. How to delete the annotation
|
79
|
+
%li
|
80
|
+
%a{:href => "/sample12"}Sample12 - How to list all annotations from document
|
81
|
+
%li
|
82
|
+
%a{:href => "/sample13"}Sample13 - How to add collaborator to doc with annotations
|
83
|
+
%li
|
84
|
+
%a{:href => "/sample14"}Sample14 - How to check the list of shares for a folder
|
85
|
+
%li
|
86
|
+
%a{:href => "/sample15"}Sample15 - How to check the number of document's views
|
87
|
+
%li
|
88
|
+
%a{:href => "/sample16"}Sample16 - How to insert Assembly questionary into webpage
|
89
|
+
%li
|
90
|
+
%a{:href => "/sample17"}Sample17 - How to upload a file into the storage and compress it into zip archive
|
91
|
+
%li
|
92
|
+
%a{:href => "/sample18"}Sample18 - How to convert Doc to Docx, Docx to Doc, Docx to PDF, PPT to PDF
|
93
|
+
%li
|
94
|
+
%a{:href => "/envelope-sample"}Envelope sample - How to use envelope and signature API
|