groupdocs 1.5.7 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. data/CHANGELOG.md +51 -0
  2. data/examples/api-samples/Gemfile +1 -1
  3. data/examples/api-samples/Gemfile.lock +43 -0
  4. data/examples/api-samples/public/docs/{sample2.html → sample01.html} +39 -19
  5. data/examples/api-samples/public/docs/{sample3.html → sample02.html} +28 -22
  6. data/examples/api-samples/public/docs/sample03.html +285 -0
  7. data/examples/api-samples/public/docs/{sample4.html → sample04.html} +30 -36
  8. data/examples/api-samples/public/docs/{sample5.html → sample05.html} +68 -31
  9. data/examples/api-samples/public/docs/sample06.html +299 -0
  10. data/examples/api-samples/public/docs/{sample7.html → sample07.html} +53 -18
  11. data/examples/api-samples/public/docs/{sample8.html → sample08.html} +64 -41
  12. data/examples/api-samples/public/docs/sample09.html +260 -0
  13. data/examples/api-samples/public/docs/sample10.html +67 -28
  14. data/examples/api-samples/public/docs/sample11.html +171 -55
  15. data/examples/api-samples/public/docs/sample12.html +53 -17
  16. data/examples/api-samples/public/docs/sample13.html +52 -16
  17. data/examples/api-samples/public/docs/sample14.html +51 -8
  18. data/examples/api-samples/public/docs/sample15.html +46 -10
  19. data/examples/api-samples/public/docs/sample16.html +81 -7
  20. data/examples/api-samples/public/docs/sample17.html +103 -15
  21. data/examples/api-samples/public/docs/sample18.html +117 -41
  22. data/examples/api-samples/public/docs/sample19.html +410 -36
  23. data/examples/api-samples/public/docs/sample20.html +46 -10
  24. data/examples/api-samples/public/docs/sample21.html +504 -45
  25. data/examples/api-samples/public/docs/sample22.html +166 -28
  26. data/examples/api-samples/public/docs/sample23.html +61 -25
  27. data/examples/api-samples/public/docs/sample24.html +100 -12
  28. data/examples/api-samples/public/docs/sample25.html +123 -49
  29. data/examples/api-samples/public/docs/sample26.html +41 -8
  30. data/examples/api-samples/public/docs/sample27.html +125 -50
  31. data/examples/api-samples/public/docs/sample28.html +27 -9
  32. data/examples/api-samples/public/docs/sample29.html +10 -10
  33. data/examples/api-samples/public/docs/sample30.html +70 -14
  34. data/examples/api-samples/public/docs/sample31.html +108 -67
  35. data/examples/api-samples/public/docs/sample32.html +71 -99
  36. data/examples/api-samples/public/docs/sample33.html +107 -32
  37. data/examples/api-samples/public/docs/{sample1.html → sample34.html} +58 -18
  38. data/examples/api-samples/public/docs/sample35.html +666 -0
  39. data/examples/api-samples/public/docs/{sample6.html → sample36.html} +56 -37
  40. data/examples/api-samples/public/docs/sample37.html +815 -0
  41. data/examples/api-samples/public/docs/sample38.html +508 -0
  42. data/examples/api-samples/public/docs/sample39.html +921 -0
  43. data/examples/api-samples/public/docs/sample40.html +510 -0
  44. data/examples/api-samples/public/docs/sample41.html +452 -0
  45. data/examples/api-samples/public/docs/sample42.html +311 -0
  46. data/examples/api-samples/public/templates/test_all_fields2.pdf +0 -0
  47. data/examples/api-samples/samples/sample01.rb +37 -0
  48. data/examples/api-samples/samples/sample02.rb +41 -0
  49. data/examples/api-samples/samples/sample03.rb +73 -0
  50. data/examples/api-samples/samples/sample04.rb +47 -0
  51. data/examples/api-samples/samples/{sample5.rb → sample05.rb} +26 -14
  52. data/examples/api-samples/samples/sample06.rb +80 -0
  53. data/examples/api-samples/samples/sample07.rb +52 -0
  54. data/examples/api-samples/samples/sample08.rb +69 -0
  55. data/examples/api-samples/samples/sample09.rb +83 -0
  56. data/examples/api-samples/samples/sample10.rb +29 -15
  57. data/examples/api-samples/samples/sample11.rb +89 -37
  58. data/examples/api-samples/samples/sample12.rb +22 -11
  59. data/examples/api-samples/samples/sample13.rb +22 -10
  60. data/examples/api-samples/samples/sample14.rb +23 -5
  61. data/examples/api-samples/samples/sample15.rb +18 -7
  62. data/examples/api-samples/samples/sample16.rb +28 -4
  63. data/examples/api-samples/samples/sample17.rb +31 -5
  64. data/examples/api-samples/samples/sample18.rb +36 -8
  65. data/examples/api-samples/samples/sample19.rb +138 -18
  66. data/examples/api-samples/samples/sample20.rb +14 -3
  67. data/examples/api-samples/samples/sample21.rb +162 -23
  68. data/examples/api-samples/samples/sample22.rb +73 -22
  69. data/examples/api-samples/samples/sample23.rb +17 -6
  70. data/examples/api-samples/samples/sample24.rb +34 -7
  71. data/examples/api-samples/samples/sample25.rb +37 -12
  72. data/examples/api-samples/samples/sample26.rb +12 -5
  73. data/examples/api-samples/samples/sample27.rb +38 -12
  74. data/examples/api-samples/samples/sample28.rb +25 -6
  75. data/examples/api-samples/samples/sample29.rb +12 -12
  76. data/examples/api-samples/samples/sample30.rb +27 -15
  77. data/examples/api-samples/samples/sample31.rb +44 -33
  78. data/examples/api-samples/samples/sample32.rb +43 -41
  79. data/examples/api-samples/samples/sample33.rb +42 -14
  80. data/examples/api-samples/samples/sample34.rb +40 -0
  81. data/examples/api-samples/samples/sample35.rb +224 -0
  82. data/examples/api-samples/samples/sample36.rb +58 -0
  83. data/examples/api-samples/samples/sample37.rb +229 -0
  84. data/examples/api-samples/samples/sample38.rb +128 -0
  85. data/examples/api-samples/samples/sample39.rb +252 -0
  86. data/examples/api-samples/samples/sample40.rb +164 -0
  87. data/examples/api-samples/samples/sample41.rb +118 -0
  88. data/examples/api-samples/samples/sample42.rb +97 -0
  89. data/examples/api-samples/views/_others_samples.haml +25 -11
  90. data/examples/api-samples/views/index.haml +23 -11
  91. data/examples/api-samples/views/popup.haml +32 -0
  92. data/examples/api-samples/views/{sample1.haml → sample01.haml} +12 -7
  93. data/examples/api-samples/views/{sample2.haml → sample02.haml} +20 -15
  94. data/examples/api-samples/views/sample03.haml +83 -0
  95. data/examples/api-samples/views/sample04.haml +49 -0
  96. data/examples/api-samples/views/{sample5.haml → sample05.haml} +19 -14
  97. data/examples/api-samples/views/sample06.haml +53 -0
  98. data/examples/api-samples/views/sample07.haml +47 -0
  99. data/examples/api-samples/views/{sample8.haml → sample08.haml} +17 -12
  100. data/examples/api-samples/views/{sample9.haml → sample09.haml} +19 -4
  101. data/examples/api-samples/views/sample10.haml +18 -13
  102. data/examples/api-samples/views/sample11.haml +48 -19
  103. data/examples/api-samples/views/sample12.haml +26 -21
  104. data/examples/api-samples/views/sample13.haml +18 -12
  105. data/examples/api-samples/views/sample14.haml +21 -15
  106. data/examples/api-samples/views/sample15.haml +16 -9
  107. data/examples/api-samples/views/sample16.haml +18 -5
  108. data/examples/api-samples/views/sample17.haml +14 -9
  109. data/examples/api-samples/views/sample18.haml +13 -7
  110. data/examples/api-samples/views/sample19.haml +37 -8
  111. data/examples/api-samples/views/sample20.haml +13 -8
  112. data/examples/api-samples/views/sample21.haml +71 -13
  113. data/examples/api-samples/views/sample22.haml +53 -16
  114. data/examples/api-samples/views/sample23.haml +9 -4
  115. data/examples/api-samples/views/sample24.haml +9 -4
  116. data/examples/api-samples/views/sample25.haml +18 -13
  117. data/examples/api-samples/views/sample26.haml +8 -3
  118. data/examples/api-samples/views/sample27.haml +20 -14
  119. data/examples/api-samples/views/sample28.haml +16 -10
  120. data/examples/api-samples/views/sample29.haml +4 -4
  121. data/examples/api-samples/views/sample30.haml +16 -10
  122. data/examples/api-samples/views/sample31.haml +39 -32
  123. data/examples/api-samples/views/sample32.haml +25 -36
  124. data/examples/api-samples/views/sample33.haml +14 -17
  125. data/examples/api-samples/views/sample34.haml +48 -0
  126. data/examples/api-samples/views/sample35.haml +95 -0
  127. data/examples/api-samples/views/sample36.haml +64 -0
  128. data/examples/api-samples/views/sample37.haml +124 -0
  129. data/examples/api-samples/views/sample38.haml +115 -0
  130. data/examples/api-samples/views/sample39.haml +236 -0
  131. data/examples/api-samples/views/sample40.haml +95 -0
  132. data/examples/api-samples/views/{sample4.haml → sample41.haml} +90 -72
  133. data/examples/api-samples/views/sample42.haml +59 -0
  134. data/lib/groupdocs/api/helpers/rest_helper.rb +13 -1
  135. data/lib/groupdocs/datasource.rb +2 -1
  136. data/lib/groupdocs/document.rb +101 -13
  137. data/lib/groupdocs/document/annotation.rb +28 -13
  138. data/lib/groupdocs/document/annotation/marker.rb +18 -0
  139. data/lib/groupdocs/document/annotation/reply.rb +9 -2
  140. data/lib/groupdocs/document/field.rb +5 -1
  141. data/lib/groupdocs/job.rb +12 -2
  142. data/lib/groupdocs/questionnaire.rb +174 -4
  143. data/lib/groupdocs/questionnaire/collector.rb +21 -0
  144. data/lib/groupdocs/questionnaire/question.rb +19 -0
  145. data/lib/groupdocs/questionnaire/question/answer.rb +5 -0
  146. data/lib/groupdocs/questionnaire/question/conditions.rb +20 -0
  147. data/lib/groupdocs/signature.rb +36 -308
  148. data/lib/groupdocs/signature/envelope.rb +146 -4
  149. data/lib/groupdocs/signature/field.rb +20 -1
  150. data/lib/groupdocs/signature/field/location.rb +18 -7
  151. data/lib/groupdocs/signature/form.rb +199 -10
  152. data/lib/groupdocs/signature/shared/document_methods.rb +38 -0
  153. data/lib/groupdocs/signature/shared/entity_methods.rb +0 -1
  154. data/lib/groupdocs/signature/shared/field_methods.rb +13 -38
  155. data/lib/groupdocs/signature/shared/recipient_methods.rb +8 -0
  156. data/lib/groupdocs/signature/template.rb +3 -1
  157. data/lib/groupdocs/storage.rb +4 -1
  158. data/lib/groupdocs/storage/file.rb +18 -1
  159. data/lib/groupdocs/subscription.rb +8 -3
  160. data/lib/groupdocs/user.rb +8 -0
  161. data/lib/groupdocs/version.rb +1 -1
  162. data/spec/groupdocs/document/annotation_spec.rb +1 -14
  163. data/spec/groupdocs/subscription_spec.rb +2 -2
  164. metadata +86 -32
  165. checksums.yaml +0 -15
  166. data/examples/api-samples/public/docs/sample9.html +0 -200
  167. data/examples/api-samples/samples/sample1.rb +0 -25
  168. data/examples/api-samples/samples/sample2.rb +0 -29
  169. data/examples/api-samples/samples/sample3.rb +0 -33
  170. data/examples/api-samples/samples/sample4.rb +0 -51
  171. data/examples/api-samples/samples/sample6.rb +0 -49
  172. data/examples/api-samples/samples/sample7.rb +0 -42
  173. data/examples/api-samples/samples/sample8.rb +0 -61
  174. data/examples/api-samples/samples/sample9.rb +0 -48
  175. data/examples/api-samples/views/sample3.haml +0 -44
  176. data/examples/api-samples/views/sample6.haml +0 -49
  177. data/examples/api-samples/views/sample7.haml +0 -42
@@ -21,35 +21,32 @@
21
21
 
22
22
  %font{:color => 'red'} #{(defined? err) ? err : ''}
23
23
  #requestForm{:style => 'padding:20px; border:1px solid black;'}
24
- %p Enter data for request and press "Make request" button
24
+ %p Enter credentials and file URLs to any documents or HTML pages and press "Make request" button
25
25
  %form{:action => '/sample33', :enctype => 'multipart/form-data', :method => 'post'}
26
- %label{:for => 'client_id'} GroupDocs ClientID
26
+ %label{:for => 'clientId'} GroupDocs ClientID
27
27
  %br/
28
- %input{:type=>'text', :name=>'client_id'}
28
+ %input{:type=>'text', :name=>'clientId'}
29
29
  %br/
30
- %label{:for => 'private_key'} GroupDocs PrivateKey
30
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
31
31
  %br/
32
- %input{:type=>'text', :name=>'private_key'}
32
+ %input{:type=>'text', :name=>'privateKey'}
33
33
  %br/
34
- %label{:for => 'url_1'} 1. Web url the document in format 'Html'
34
+ %label{:for => 'url1'} 1. Document URL
35
35
  %br/
36
- %input{:type=>'text', :name=>'url_1', :size=>60}
36
+ %input{:type=>'text', :name=>'url1', :size=>60}
37
37
  %br/
38
- %label{:for => 'url_2'} 2. Web url the document in format 'Html'
38
+ %label{:for => 'url2'} 2. Document URL
39
39
  %br/
40
- %input{:type=>'text', :name=>'url_2', :size=>60}
40
+ %input{:type=>'text', :name=>'url2', :size=>60}
41
41
  %br/
42
- %label{:for => 'url_3'} 3. Web url the document in format 'Html'
42
+ %label{:for => 'url3'} 3. Document URL
43
43
  %br/
44
- %input{:type=>'text', :name=>'url_3', :size=>60}
44
+ %input{:type=>'text', :name=>'url3', :size=>60}
45
45
  %br/
46
- %label{:for => 'url_4'} 4. Web url the document in format 'Html'
46
+ %label{:for => 'basePath'} Base Path
47
+ %span{:class => 'optional'} (Optional)
47
48
  %br/
48
- %input{:type=>'text', :name=>'url_4', :size=>60}
49
- %br/
50
- %label{:for => 'url_5'} 5. Web url the document in format 'Html'
51
- %br/
52
- %input{:type=>'text', :name=>'url_5', :size=>60}
49
+ %input{:type=>'text', :name=>'basePath'}
53
50
  %br/
54
51
  %br/
55
52
  %input{:type => 'submit', :value => 'Make Request'}/
@@ -0,0 +1,48 @@
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'}GroupDocs Ruby SDK Samples
3
+ \- Sample34
4
+
5
+ .samplecontent{:style => 'padding:10px;'}
6
+ %i This sample will show how to create folder in the GroupDocs account using Ruby SDK
7
+ %br/
8
+ %br/
9
+ %span.documentation
10
+ %a{:href => '/docs/sample34.html'} Builtin documentation for this sample
11
+ %br/
12
+ %br/
13
+ %p
14
+ You entered:
15
+ %p
16
+ UserId = #{(defined? userId) ? userId : ''}
17
+ %p
18
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
19
+ %p
20
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
21
+
22
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
23
+ %p Enter data for request and press "Make request" button
24
+ %form{:action => '/sample34', :enctype => 'multipart/form-data', :method => 'post'}
25
+ %label{:for => 'clientId'} GroupDocs Client ID
26
+ %br/
27
+ %input{:type=>'text', :name=>'clientId'}
28
+ %br/
29
+ %label{:for => 'privateKey'} GroupDocs Private Key
30
+ %br/
31
+ %input{:type=>'text', :name=>'privateKey'}
32
+ %br/
33
+ %label{:for => 'path'} Folder name
34
+ %br/
35
+ %input{:type=>'text', :name=>'folder'}
36
+ %br/
37
+ %label{:for => 'basePath'} Base Path
38
+ %span{:class => 'optional'} (Optional)
39
+ %br/
40
+ %input{:type=>'text', :name=>'basePath'}
41
+ %br/
42
+ %br/
43
+ %input{:type => 'submit', :value => 'Make Request'}
44
+ %br/
45
+ %p Results:
46
+ %div{:style => "color:green"} #{(defined? message) ? message : ''}
47
+
48
+ = partial :_others_samples
@@ -0,0 +1,95 @@
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
3
+ \- Sample35
4
+ .samplecontent{:style => 'padding:10px;'}
5
+ %span.description
6
+ This sample will show how to get fields and their data from PDF file programmatically and dynamically create HTML form using the data about fields.
7
+ %br/
8
+ %br/
9
+ /
10
+ %span.documentation
11
+ %a{:href => '/docs/sample35.html'} Builtin documentation for this sample
12
+
13
+ %br/
14
+ %br/
15
+ %p
16
+ You entered:
17
+ %p
18
+ ClientID = #{(defined? userId) ? userId : ''}
19
+ %p
20
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
21
+ %p
22
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
23
+ %br/
24
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
25
+ %p Enter data for request and press "Make request" button
26
+
27
+ %form{:action => "#{(defined? userId) ? '/sample35/check' : '/sample35'}", :enctype => 'multipart/form-data', :method => 'post', :id=>'form'}
28
+ %label{:for => 'clientId'} GroupDocs ClientID
29
+ %br/
30
+ %input{:type=>'text', :name=>'clientId', :id=>'client_id', :value=>"#{(defined? userId) ? userId : ''}"}
31
+ %br/
32
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
33
+ %br/
34
+ %input{:type=>'text', :name=>'privateKey', :id=>'private_key', :value=>"#{(defined? privateKey) ? privateKey : ''}"}
35
+ %br/
36
+
37
+
38
+ %div.guid_radio{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
39
+ %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
40
+ %br/
41
+ %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
42
+ %br/
43
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
44
+ %br/
45
+
46
+ %div.fields{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
47
+ %div.guid_field{:style=>'display:none;'}
48
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
49
+ %br/
50
+ %input{:type=>'text', :name=>'fileId', :id=>'guid', :value=>"#{(defined? fileId) ? fileId : ''}"}
51
+
52
+ %div.guid_field
53
+ %label{:for=>'file'} Upload local file
54
+ %br/
55
+ %input{:type=>'file', :name=>'file', :id=>'file'}
56
+
57
+ %div.guid_field{:style=>'display:none;'}
58
+ %label{:for=>'url', :id=>'url'} Upload file from URL
59
+ %br/
60
+ %input{:type=>'text', :name=>'url', :id=>'url'}
61
+ %label{:for => 'basePath'} Base Path
62
+ %br/
63
+ %font{:color=>'grey'} (https://stage-api-groupdocs.dynabic.com)
64
+ %br/
65
+ %input{:type=>'text', :name=>'basePath', :id=>'base_path', :value=>"#{(defined? base_path) ? base_path : ''}"}
66
+ %br/
67
+ #{(defined? html) ? "<div style='background-color:#e5e5e5;border:3px double gray;width:700px;padding:3px;font-size:10pt;>#{html}</div>" : '' }
68
+ %br/
69
+ %input{:type => 'submit', :id => 'button', :value => 'Make request'}
70
+
71
+ %br/
72
+ %a{:href=>'/templates/test_all_fields2.pdf'} Download sample Pdf file
73
+ %br/
74
+ %br/
75
+ %div{:style => 'padding:20px; border:1px solid black;'}
76
+ %p
77
+ Results:
78
+ #result
79
+ #{(defined? iframe) ? iframe : ''}
80
+
81
+ = partial :_others_samples
82
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
83
+
84
+ :javascript
85
+ $(function($){
86
+ $('.guid_radio input').change(function(){
87
+ var elementIndex = $(this).parent().children('input').index($(this));
88
+ $('.guid_field').hide();
89
+ $('.guid_field').eq(elementIndex).show();
90
+ });
91
+ });
92
+
93
+
94
+
95
+
@@ -0,0 +1,64 @@
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'}GroupDocs Ruby SDK Samples
3
+ \- Sample36
4
+
5
+ .samplecontent{:style => 'padding:10px;'}
6
+ %i How to download signed documents when envelope was signed using Ruby SDK
7
+ %br/
8
+ %br/
9
+ %span.documentation
10
+ %a{:href => '/docs/sample36.html'} Builtin documentation for this sample
11
+ %br/
12
+ %br/
13
+ %p
14
+ You entered:
15
+ %p
16
+ UserId = #{(defined? userId) ? userId : ''}
17
+ %p
18
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
19
+ %p
20
+ Signed Envelope Guid = #{(defined? envelopeGuid) ? envelopeGuid : ''}
21
+ %p
22
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
23
+ %p
24
+ Results:
25
+ %br/
26
+ %br/
27
+ %p
28
+ #{(defined? message) ? message : ''}
29
+ %br/
30
+
31
+
32
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
33
+ %p Enter data for request and press "Make request" button
34
+ %form{:action => '/sample36', :enctype => 'multipart/form-data', :method => 'post'}
35
+ %label{:for => 'clientId'} GroupDocs Client ID
36
+ %br/
37
+ %input{:type=>'text', :name=>'clientId'}
38
+ %br/
39
+ %label{:for => 'privateKey'} GroupDocs Private Key
40
+ %br/
41
+ %input{:type=>'text', :name=>'privateKey'}
42
+ %br/
43
+ %label{:for => 'path'} Signed Envelop Guid
44
+ %br/
45
+ %input{:type=>'text', :name=>'envelopeGuid'}
46
+ %br/
47
+ %label{:for => 'basePath'} Base Path
48
+ %span{:class => 'optional'} (Optional)
49
+ %br/
50
+ %input{:type=>'text', :name=>'basePath'}
51
+ %br/
52
+ %br/
53
+ %input{:type => 'submit', :value => 'Make Request'}
54
+ %br/
55
+ = partial :_others_samples
56
+
57
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
58
+ :javascript
59
+ function check() {
60
+ $.get('/sample36/check', function(data) {
61
+ $('#results_status').fadeOut("slow");
62
+ $('#downloadframe').attr("src", "/sample36/downloads/" + data);
63
+ }, 'text');
64
+ }
@@ -0,0 +1,124 @@
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
3
+ \- Sample37
4
+ .samplecontent{:style => 'padding:10px;'}
5
+ %i This sample will show how to create envelop and download signed document when envelop was signed using callback
6
+ %br/
7
+ %br/
8
+ %span.documentation
9
+ %a{:href => '/docs/sample37.html'} Builtin documentation for this sample
10
+ %br/
11
+ %br/
12
+ %p
13
+ You entered:
14
+ %p
15
+ UserId = #{(defined? userId) ? userId : ''}
16
+ %p
17
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
18
+ %p
19
+ Email = #{(defined? email) ? email : ''}
20
+ %p
21
+ Name = #{(defined? name) ? name : ''}
22
+ %p
23
+ Last Name = #{(defined? lastName) ? lastName : ''}
24
+ %p
25
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
26
+ %br/
27
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
28
+ %p Enter data for request and press "Make request" button
29
+ %form{:action => '/sample37', :enctype => 'multipart/form-data', :method => 'post'}
30
+ %label{:for => 'clientId'} GroupDocs ClientID
31
+ %br/
32
+ %input{:type=>'text', :name=>'clientId'}
33
+ %br/
34
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
35
+ %br/
36
+ %input{:type=>'text', :name=>'privateKey'}
37
+ %br/
38
+ %label{:for => 'email'} Email
39
+ %br/
40
+ %input{:type=>'text', :name=>'email'}
41
+ %br/
42
+ %label{:for => 'name'} Name
43
+ %br/
44
+ %input{:type=>'text', :name=>'name'}
45
+ %br/
46
+ %label{:for => 'lastName'} Last Name
47
+ %br/
48
+ %input{:type=>'text', :name=>'lastName'}
49
+ %br/
50
+ %div.guid_radio
51
+ %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
52
+ %br/
53
+ %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
54
+ %br/
55
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
56
+ %br/
57
+
58
+ %div.guid_field{:style=>'display:none;'}
59
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
60
+ %br/
61
+ %input{:type=>'text', :name=>'fileId'}
62
+
63
+ %div.guid_field
64
+ %label{:for=>'file'} Upload local file
65
+ %br/
66
+ %input{:type=>'file', :name=>'file'}
67
+
68
+ %div.guid_field{:style=>'display:none;'}
69
+ %label{:for=>'url', :id=>'url'} Upload file from URL
70
+ %br/
71
+ %input{:type=>'text', :name=>'url'}
72
+
73
+ %br/
74
+ %label{:for=>'callback'}
75
+ Callback URL
76
+ %span.optional (Optional)
77
+ %br/
78
+ %font{:color=>'grey'} (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample37/signature_callback)
79
+ %input{:type=>'text', :size=>'70', :value=>"#{(defined? callback) ? callback : ''}", :name=>'callback'}
80
+ %br/
81
+ %label{:for => 'basePath'} Base Path
82
+ %span{:class => 'optional'} (Optional)
83
+ %br/
84
+ %input{:type=>'text', :name=>'basePath'}
85
+ %br/
86
+ %br/
87
+ %input{:type => 'submit', :value => 'Make request'}
88
+ %span{:id=>'results_status', :style=>'color:red;display:none;'} (Please wait for ajax response)
89
+ %br/
90
+ %iframe{:id=>'downloadframe', :style=>'display:none'}
91
+ %div{:style => 'padding:20px; border:1px solid black;'}
92
+ %p
93
+ Results:
94
+ %br/
95
+ #{(defined? message) ? message : ''}
96
+ #{(defined? iframe) ? iframe : ''}
97
+
98
+ = partial :_others_samples
99
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
100
+ :javascript
101
+ function callback_handler(data) {
102
+ if (data === undefined) {
103
+ return check();
104
+ }
105
+ $('#results_status').fadeOut("slow");
106
+ $('#downloadframe').attr("src", "/sample37/downloads/" + data);
107
+ };
108
+
109
+ function check() {
110
+ $.get('/sample37/check', callback_handler, 'text');
111
+ };
112
+
113
+ $(function($) {
114
+ callbackUrl = $("input[name=callback]").val();
115
+ if(callbackUrl !== "") {
116
+ $('#results_status').fadeIn("slow");
117
+ setTimeout(check, 5000);
118
+ };
119
+ $('.guid_radio input').change(function(){
120
+ var elementIndex = $(this).parent().children('input').index($(this));
121
+ $('.guid_field').hide();
122
+ $('.guid_field').eq(elementIndex).show();
123
+ });
124
+ });
@@ -0,0 +1,115 @@
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
3
+ \- Sample38
4
+ .samplecontent{:style => 'padding:10px;'}
5
+ %span.description
6
+ This sample will show how to get fields and their data from PDF file programmatically and dynamically create HTML form using the data about fields.
7
+ %br/
8
+ %br/
9
+ /
10
+ %span.documentation
11
+ %a{:href => '/docs/sample38.html'} Builtin documentation for this sample
12
+
13
+ %br/
14
+ %br/
15
+ %p
16
+ You entered:
17
+ %p
18
+ ClientID = #{(defined? userId) ? userId : ''}
19
+ %p
20
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
21
+ %p
22
+ FileID = #{(defined? fileId) ? fileId : ''}
23
+ %p
24
+ Email = #{(defined? email) ? email : ''}
25
+ %p
26
+ First Name = #{(defined? firstName) ? firstName : ''}
27
+ %p
28
+ Last Name = #{(defined? lastName) ? lastName : ''}
29
+ %p
30
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
31
+ %br/
32
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
33
+ %p Enter data for request and press "Make request" button
34
+
35
+ %form{:action => "/sample38", :enctype => 'multipart/form-data', :method => 'post', :id=>'form'}
36
+ %label{:for => 'clientId'} GroupDocs ClientID
37
+ %br/
38
+ %input{:type=>'text', :name=>'clientId', :id=>'client_id', :value=>"#{(defined? userId) ? userId : ''}"}
39
+ %br/
40
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
41
+ %br/
42
+ %input{:type=>'text', :name=>'privateKey', :id=>'private_key', :value=>"#{(defined? privateKey) ? privateKey : ''}"}
43
+ %br/
44
+
45
+
46
+ %div.guid_radio{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
47
+ %input{:type=>'radio', :name=>'source', :value=>'guid', :checked=>'checked'} File ID (GUID)
48
+ %br/
49
+ %input{:type=>'radio', :name=>'source', :value=>'local'}Upload local file
50
+ %br/
51
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
52
+ %br/
53
+
54
+ %div.fields{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
55
+ %div.guid_field
56
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
57
+ %br/
58
+ %input{:type=>'text', :name=>'fileId', :id=>'guid', :value=>"#{(defined? fileId) ? fileId : ''}"}
59
+
60
+ %div.guid_field{:style=>'display:none;'}
61
+ %label{:for=>'file'} Upload local file
62
+ %br/
63
+ %input{:type=>'file', :name=>'file', :id=>'file'}
64
+
65
+ %div.guid_field{:style=>'display:none;'}
66
+ %label{:for=>'url', :id=>'url'} Upload file from URL
67
+ %br/
68
+ %input{:type=>'text', :name=>'url', :id=>'url'}
69
+ %label User email
70
+ %br/
71
+ %input{:type=>'text', :name=>'email', :value=>""}
72
+ %br/
73
+ %label User first name
74
+ %br/
75
+ %input{:type=>'text', :name=>'firstName', :value=>""}
76
+ %br/
77
+ %label User last name
78
+ %br/
79
+ %input{:type=>'text', :name=>'lastName', :value=>""}
80
+ %br/
81
+ %label{:for => 'basePath'} Base Path
82
+ %font{:color=>'grey'} (Optional)
83
+ %br/
84
+ %input{:type=>'text', :name=>'basePath', :id=>'base_path', :value=>"#{(defined? base_path) ? base_path : ''}"}
85
+ %br/
86
+ #{(defined? html) ? "<div style='background-color:#e5e5e5;border:3px double gray;width:700px;padding:3px;font-size:10pt;>#{html}</div>" : '' }
87
+ %br/
88
+ %input{:type => 'submit', :id => 'button', :value => 'Make request'}
89
+
90
+ %br/
91
+ %a{:href=>'/templates/test_all_fields2.pdf'} Download sample Pdf file
92
+ %br/
93
+ %br/
94
+ %div{:style => 'padding:20px; border:1px solid black;'}
95
+ %p
96
+ Results:
97
+ #result
98
+ %span{:style=>'color:green'} New collaborations: #{(defined? email) ? email : ''}
99
+ #{(defined? iframe) ? iframe : ''}
100
+
101
+ = partial :_others_samples
102
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
103
+
104
+ :javascript
105
+ $(function($){
106
+ $('.guid_radio input').change(function(){
107
+ var elementIndex = $(this).parent().children('input').index($(this));
108
+ $('.guid_field').hide();
109
+ $('.guid_field').eq(elementIndex).show();
110
+ });
111
+ });
112
+
113
+
114
+
115
+