groupdocs 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +34 -0
- data/LICENSE.txt +21 -0
- data/README.md +3 -0
- data/examples/api-samples/public/docs/sample01.html +23 -23
- data/examples/api-samples/public/docs/sample02.html +27 -27
- data/examples/api-samples/public/docs/sample03.html +81 -69
- data/examples/api-samples/public/docs/sample04.html +29 -29
- data/examples/api-samples/public/docs/sample05.html +48 -48
- data/examples/api-samples/public/docs/sample06.html +47 -46
- data/examples/api-samples/public/docs/sample07.html +35 -35
- data/examples/api-samples/public/docs/sample08.html +45 -45
- data/examples/api-samples/public/docs/sample09.html +57 -57
- data/examples/api-samples/public/docs/sample10.html +41 -41
- data/examples/api-samples/public/docs/sample11.html +96 -118
- data/examples/api-samples/public/docs/sample12.html +29 -50
- data/examples/api-samples/public/docs/sample13.html +36 -44
- data/examples/api-samples/public/docs/sample14.html +29 -29
- data/examples/api-samples/public/docs/sample15.html +24 -24
- data/examples/api-samples/public/docs/sample16.html +32 -32
- data/examples/api-samples/public/docs/sample17.html +38 -38
- data/examples/api-samples/public/docs/sample18.html +105 -101
- data/examples/api-samples/public/docs/sample19.html +101 -101
- data/examples/api-samples/public/docs/sample20.html +42 -42
- data/examples/api-samples/public/docs/sample21.html +109 -109
- data/examples/api-samples/public/docs/sample22.html +56 -56
- data/examples/api-samples/public/docs/sample23.html +39 -39
- data/examples/api-samples/public/docs/sample24.html +36 -36
- data/examples/api-samples/public/docs/sample25.html +67 -67
- data/examples/api-samples/public/docs/sample26.html +23 -23
- data/examples/api-samples/public/docs/sample27.html +72 -72
- data/examples/api-samples/public/docs/sample28.html +46 -45
- data/examples/api-samples/public/docs/sample29.html +30 -30
- data/examples/api-samples/public/docs/sample30.html +30 -30
- data/examples/api-samples/public/docs/sample31.html +114 -114
- data/examples/api-samples/public/docs/sample32.html +96 -96
- data/examples/api-samples/public/docs/sample33.html +56 -56
- data/examples/api-samples/public/docs/sample34.html +27 -27
- data/examples/api-samples/public/docs/sample35.html +134 -135
- data/examples/api-samples/public/docs/sample36.html +32 -32
- data/examples/api-samples/public/docs/sample37.html +103 -103
- data/examples/api-samples/public/docs/sample38.html +76 -76
- data/examples/api-samples/public/docs/sample39.html +136 -136
- data/examples/api-samples/public/docs/sample40.html +104 -104
- data/examples/api-samples/public/docs/sample41.html +137 -137
- data/examples/api-samples/public/docs/sample42.html +61 -61
- data/examples/api-samples/public/docs/sample43.html +72 -72
- data/examples/api-samples/public/docs/sample44.html +751 -0
- data/examples/api-samples/public/docs/sample45.html +236 -0
- data/examples/api-samples/public/templates/merge_field3_doc.docx +0 -0
- data/examples/api-samples/samples/sample01.rb +2 -2
- data/examples/api-samples/samples/sample02.rb +2 -2
- data/examples/api-samples/samples/sample03.rb +2 -2
- data/examples/api-samples/samples/sample04.rb +2 -2
- data/examples/api-samples/samples/sample05.rb +2 -2
- data/examples/api-samples/samples/sample06.rb +2 -2
- data/examples/api-samples/samples/sample07.rb +2 -2
- data/examples/api-samples/samples/sample08.rb +2 -2
- data/examples/api-samples/samples/sample09.rb +2 -2
- data/examples/api-samples/samples/sample10.rb +2 -2
- data/examples/api-samples/samples/sample11.rb +2 -2
- data/examples/api-samples/samples/sample12.rb +2 -2
- data/examples/api-samples/samples/sample13.rb +2 -2
- data/examples/api-samples/samples/sample14.rb +2 -2
- data/examples/api-samples/samples/sample15.rb +2 -2
- data/examples/api-samples/samples/sample16.rb +2 -2
- data/examples/api-samples/samples/sample17.rb +2 -2
- data/examples/api-samples/samples/sample18.rb +2 -2
- data/examples/api-samples/samples/sample19.rb +2 -2
- data/examples/api-samples/samples/sample20.rb +2 -2
- data/examples/api-samples/samples/sample21.rb +2 -2
- data/examples/api-samples/samples/sample22.rb +2 -2
- data/examples/api-samples/samples/sample23.rb +2 -2
- data/examples/api-samples/samples/sample24.rb +2 -2
- data/examples/api-samples/samples/sample25.rb +2 -2
- data/examples/api-samples/samples/sample26.rb +2 -2
- data/examples/api-samples/samples/sample27.rb +2 -2
- data/examples/api-samples/samples/sample28.rb +2 -2
- data/examples/api-samples/samples/sample29.rb +2 -2
- data/examples/api-samples/samples/sample30.rb +2 -2
- data/examples/api-samples/samples/sample31.rb +2 -2
- data/examples/api-samples/samples/sample32.rb +2 -2
- data/examples/api-samples/samples/sample33.rb +2 -2
- data/examples/api-samples/samples/sample34.rb +2 -2
- data/examples/api-samples/samples/sample35.rb +4 -4
- data/examples/api-samples/samples/sample36.rb +2 -2
- data/examples/api-samples/samples/sample37.rb +2 -2
- data/examples/api-samples/samples/sample38.rb +2 -2
- data/examples/api-samples/samples/sample39.rb +2 -2
- data/examples/api-samples/samples/sample40.rb +2 -2
- data/examples/api-samples/samples/sample41.rb +2 -2
- data/examples/api-samples/samples/sample42.rb +2 -2
- data/examples/api-samples/samples/sample43.rb +2 -2
- data/examples/api-samples/samples/sample44.rb +188 -0
- data/examples/api-samples/samples/sample45.rb +74 -0
- data/examples/api-samples/views/_others_samples.haml +47 -43
- data/examples/api-samples/views/index.haml +55 -44
- data/examples/api-samples/views/layout.haml +1 -6
- data/examples/api-samples/views/sample01.haml +62 -57
- data/examples/api-samples/views/sample02.haml +52 -46
- data/examples/api-samples/views/sample03.haml +78 -73
- data/examples/api-samples/views/sample04.haml +51 -45
- data/examples/api-samples/views/sample05.haml +77 -71
- data/examples/api-samples/views/sample06.haml +58 -52
- data/examples/api-samples/views/sample07.haml +51 -45
- data/examples/api-samples/views/sample08.haml +90 -84
- data/examples/api-samples/views/sample09.haml +86 -80
- data/examples/api-samples/views/sample10.haml +83 -77
- data/examples/api-samples/views/sample11.haml +124 -120
- data/examples/api-samples/views/sample12.haml +65 -59
- data/examples/api-samples/views/sample13.haml +62 -56
- data/examples/api-samples/views/sample14.haml +57 -51
- data/examples/api-samples/views/sample15.haml +49 -43
- data/examples/api-samples/views/sample16.haml +49 -43
- data/examples/api-samples/views/sample17.haml +53 -47
- data/examples/api-samples/views/sample18.haml +140 -134
- data/examples/api-samples/views/sample19.haml +87 -81
- data/examples/api-samples/views/sample20.haml +53 -47
- data/examples/api-samples/views/sample21.haml +115 -111
- data/examples/api-samples/views/sample22.haml +94 -88
- data/examples/api-samples/views/sample23.haml +83 -78
- data/examples/api-samples/views/sample24.haml +54 -48
- data/examples/api-samples/views/sample25.haml +89 -83
- data/examples/api-samples/views/sample26.haml +62 -57
- data/examples/api-samples/views/sample27.haml +114 -109
- data/examples/api-samples/views/sample28.haml +55 -49
- data/examples/api-samples/views/sample29.haml +67 -69
- data/examples/api-samples/views/sample30.haml +54 -48
- data/examples/api-samples/views/sample31.haml +106 -100
- data/examples/api-samples/views/sample32.haml +90 -84
- data/examples/api-samples/views/sample33.haml +60 -54
- data/examples/api-samples/views/sample34.haml +51 -46
- data/examples/api-samples/views/sample35.haml +84 -78
- data/examples/api-samples/views/sample36.haml +63 -58
- data/examples/api-samples/views/sample37.haml +122 -116
- data/examples/api-samples/views/sample38.haml +104 -98
- data/examples/api-samples/views/sample39.haml +6 -2
- data/examples/api-samples/views/sample40.haml +94 -89
- data/examples/api-samples/views/sample41.haml +127 -123
- data/examples/api-samples/views/sample42.haml +60 -54
- data/examples/api-samples/views/sample43.haml +81 -77
- data/examples/api-samples/views/sample44.haml +85 -0
- data/examples/api-samples/views/sample45.haml +85 -0
- data/groupdocs.gemspec +2 -0
- data/lib/groupdocs/datasource/field.rb +9 -0
- data/lib/groupdocs/document.rb +66 -4
- data/lib/groupdocs/document/annotation.rb +11 -6
- data/lib/groupdocs/document/editor.rb +53 -0
- data/lib/groupdocs/document/field.rb +16 -0
- data/lib/groupdocs/document/style.rb +30 -0
- data/lib/groupdocs/job.rb +24 -0
- data/lib/groupdocs/questionnaire.rb +2 -0
- data/lib/groupdocs/questionnaire/collector.rb +52 -0
- data/lib/groupdocs/questionnaire/collector_style.rb +54 -0
- data/lib/groupdocs/questionnaire/question.rb +9 -0
- data/lib/groupdocs/questionnaire/style/base_font.rb +17 -0
- data/lib/groupdocs/questionnaire/style/question_title.rb +17 -0
- data/lib/groupdocs/questionnaire/style/title.rb +17 -0
- data/lib/groupdocs/signature/envelope.rb +43 -8
- data/lib/groupdocs/signature/form.rb +113 -12
- data/lib/groupdocs/signature/recipient.rb +38 -3
- data/lib/groupdocs/signature/shared/field_methods.rb +4 -2
- data/lib/groupdocs/signature/template.rb +20 -1
- data/lib/groupdocs/storage/file.rb +3 -2
- data/lib/groupdocs/user.rb +148 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +5 -5
- data/spec/groupdocs/document/annotation_spec.rb +1 -1
- data/spec/groupdocs/signature/envelope_spec.rb +1 -1
- data/spec/groupdocs/user_spec.rb +4 -4
- data/spec/support/shared_examples/signature/shared/field_methods.rb +5 -4
- metadata +18 -3
@@ -31,9 +31,9 @@
|
|
31
31
|
|
32
32
|
</div>
|
33
33
|
|
34
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/
|
35
|
-
haml <span class="symbol">:sample34</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-34-how-to-create-folder-in-the-groupdocs-account'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample34</span>
|
36
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
37
37
|
|
38
38
|
</li>
|
39
39
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
</div>
|
50
50
|
|
51
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
51
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-34-how-to-create-folder-in-the-groupdocs-account'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
52
52
|
|
53
53
|
</li>
|
54
54
|
|
@@ -63,12 +63,12 @@
|
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
68
|
-
set <span class="symbol">:path</span>, params[<span class="symbol">:folder</span>]
|
69
|
-
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
66
|
+
<div class="content"><div class='highlight'><pre> set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>]
|
67
|
+
set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>]
|
68
|
+
set <span class="hljs-symbol">:path</span>, params[<span class="hljs-symbol">:folder</span>]
|
69
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]
|
70
70
|
|
71
|
-
<span class="keyword">begin</span></pre></div></div>
|
71
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
72
72
|
|
73
73
|
</li>
|
74
74
|
|
@@ -83,7 +83,7 @@
|
|
83
83
|
|
84
84
|
</div>
|
85
85
|
|
86
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?</pre></div></div>
|
86
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'Please enter all required parameters'</span> <span class="hljs-keyword">if</span> settings.client_id.empty? <span class="hljs-keyword">or</span> settings.private_key.empty?</pre></div></div>
|
87
87
|
|
88
88
|
</li>
|
89
89
|
|
@@ -98,13 +98,13 @@
|
|
98
98
|
|
99
99
|
</div>
|
100
100
|
|
101
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
102
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
103
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
104
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
105
|
-
<span class="keyword">else</span>
|
101
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
102
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
103
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
104
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
105
|
+
<span class="hljs-keyword">else</span>
|
106
106
|
base_path = settings.base_path
|
107
|
-
<span class="keyword">end</span></pre></div></div>
|
107
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
108
108
|
|
109
109
|
</li>
|
110
110
|
|
@@ -119,7 +119,7 @@
|
|
119
119
|
|
120
120
|
</div>
|
121
121
|
|
122
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
122
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
123
123
|
groupdocs.client_id = settings.client_id
|
124
124
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
125
125
|
|
@@ -136,8 +136,8 @@
|
|
136
136
|
|
137
137
|
</div>
|
138
138
|
|
139
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
140
|
-
<span class="keyword">end</span></pre></div></div>
|
139
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
140
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
141
141
|
|
142
142
|
</li>
|
143
143
|
|
@@ -152,14 +152,14 @@
|
|
152
152
|
|
153
153
|
</div>
|
154
154
|
|
155
|
-
<div class="content"><div class='highlight'><pre> folder = <span class="constant">GroupDocs::Storage::Folder</span>.create!(settings.path)
|
156
|
-
<span class="keyword">if</span> folder.id
|
157
|
-
message = <span class="string">"<span style=\"color:green\">Folder was created <span class="subst">#{folder.path}</span> </span> "</span>
|
158
|
-
<span class="keyword">end</span>
|
155
|
+
<div class="content"><div class='highlight'><pre> folder = <span class="hljs-constant">GroupDocs::Storage::Folder</span>.create!(settings.path)
|
156
|
+
<span class="hljs-keyword">if</span> folder.id
|
157
|
+
message = <span class="hljs-string">"<span style=\"color:green\">Folder was created <span class="hljs-subst">#{folder.path}</span> </span> "</span>
|
158
|
+
<span class="hljs-keyword">end</span>
|
159
159
|
|
160
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
160
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
161
161
|
err = e.message
|
162
|
-
<span class="keyword">end</span></pre></div></div>
|
162
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
163
163
|
|
164
164
|
</li>
|
165
165
|
|
@@ -174,8 +174,8 @@
|
|
174
174
|
|
175
175
|
</div>
|
176
176
|
|
177
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample34</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:message</span> => message, <span class="symbol">:err</span> => err}
|
178
|
-
<span class="keyword">end</span></pre></div></div>
|
177
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample34</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:userId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:message</span> => message, <span class="hljs-symbol">:err</span> => err}
|
178
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
179
179
|
|
180
180
|
</li>
|
181
181
|
|
@@ -31,9 +31,9 @@
|
|
31
31
|
|
32
32
|
</div>
|
33
33
|
|
34
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/
|
35
|
-
haml <span class="symbol">:sample35</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-35-how-to-get-fields-and-their-data-from-pdf-file'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample35</span>
|
36
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
37
37
|
|
38
38
|
</li>
|
39
39
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
</div>
|
50
50
|
|
51
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
51
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-35-how-to-get-fields-and-their-data-from-pdf-file'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
52
52
|
|
53
53
|
</li>
|
54
54
|
|
@@ -63,14 +63,14 @@
|
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
68
|
-
set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
|
69
|
-
set <span class="symbol">:file_id</span>, params[<span class="symbol">:fileId</span>]
|
70
|
-
set <span class="symbol">:url</span>, params[<span class="symbol">:url</span>]
|
71
|
-
set <span class="symbol">:
|
66
|
+
<div class="content"><div class='highlight'><pre> set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>]
|
67
|
+
set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>]
|
68
|
+
set <span class="hljs-symbol">:source</span>, params[<span class="hljs-symbol">:source</span>]
|
69
|
+
set <span class="hljs-symbol">:file_id</span>, params[<span class="hljs-symbol">:fileId</span>]
|
70
|
+
set <span class="hljs-symbol">:url</span>, params[<span class="hljs-symbol">:url</span>]
|
71
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]
|
72
72
|
|
73
|
-
<span class="keyword">begin</span></pre></div></div>
|
73
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
74
74
|
|
75
75
|
</li>
|
76
76
|
|
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
</div>
|
87
87
|
|
88
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?</pre></div></div>
|
88
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'Please enter all required parameters'</span> <span class="hljs-keyword">if</span> settings.client_id.empty? <span class="hljs-keyword">or</span> settings.private_key.empty?</pre></div></div>
|
89
89
|
|
90
90
|
</li>
|
91
91
|
|
@@ -100,13 +100,13 @@
|
|
100
100
|
|
101
101
|
</div>
|
102
102
|
|
103
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
104
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
105
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
106
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
107
|
-
<span class="keyword">else</span>
|
103
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
104
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
105
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
106
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
107
|
+
<span class="hljs-keyword">else</span>
|
108
108
|
base_path = settings.base_path
|
109
|
-
<span class="keyword">end</span></pre></div></div>
|
109
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
110
110
|
|
111
111
|
</li>
|
112
112
|
|
@@ -121,7 +121,7 @@
|
|
121
121
|
|
122
122
|
</div>
|
123
123
|
|
124
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
124
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
125
125
|
groupdocs.client_id = settings.client_id
|
126
126
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
127
127
|
|
@@ -138,9 +138,9 @@
|
|
138
138
|
|
139
139
|
</div>
|
140
140
|
|
141
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
141
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
142
142
|
|
143
|
-
<span class="keyword">end</span></pre></div></div>
|
143
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
144
144
|
|
145
145
|
</li>
|
146
146
|
|
@@ -155,8 +155,8 @@
|
|
155
155
|
|
156
156
|
</div>
|
157
157
|
|
158
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.source
|
159
|
-
<span class="keyword">when</span> <span class="string">'guid'</span></pre></div></div>
|
158
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> settings.source
|
159
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'guid'</span></pre></div></div>
|
160
160
|
|
161
161
|
</li>
|
162
162
|
|
@@ -171,8 +171,8 @@
|
|
171
171
|
|
172
172
|
</div>
|
173
173
|
|
174
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new({<span class="symbol">:guid</span> => settings.file_id})
|
175
|
-
<span class="keyword">when</span> <span class="string">'local'</span></pre></div></div>
|
174
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.new({<span class="hljs-symbol">:guid</span> => settings.file_id})
|
175
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'local'</span></pre></div></div>
|
176
176
|
|
177
177
|
</li>
|
178
178
|
|
@@ -187,7 +187,7 @@
|
|
187
187
|
|
188
188
|
</div>
|
189
189
|
|
190
|
-
<div class="content"><div class='highlight'><pre> file_path = <span class="string">"<span class="subst">#{<span class="constant">Dir</span>.tmpdir}</span>/<span class="subst">#{params[<span class="symbol">:file</span>][<span class="symbol">:filename</span>]}</span>"</span></pre></div></div>
|
190
|
+
<div class="content"><div class='highlight'><pre> file_path = <span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">Dir</span>.tmpdir}</span>/<span class="hljs-subst">#{params[<span class="hljs-symbol">:file</span>][<span class="hljs-symbol">:filename</span>]}</span>"</span></pre></div></div>
|
191
191
|
|
192
192
|
</li>
|
193
193
|
|
@@ -202,7 +202,7 @@
|
|
202
202
|
|
203
203
|
</div>
|
204
204
|
|
205
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">File</span>.open(file_path, <span class="string">'wb'</span>) { |f| f.write(params[<span class="symbol">:file</span>][<span class="symbol">:tempfile</span>].read) }</pre></div></div>
|
205
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">File</span>.open(file_path, <span class="hljs-string">'wb'</span>) { |f| f.write(params[<span class="hljs-symbol">:file</span>][<span class="hljs-symbol">:tempfile</span>].read) }</pre></div></div>
|
206
206
|
|
207
207
|
</li>
|
208
208
|
|
@@ -217,8 +217,8 @@
|
|
217
217
|
|
218
218
|
</div>
|
219
219
|
|
220
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
221
|
-
<span class="keyword">when</span> <span class="string">'url'</span></pre></div></div>
|
220
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
221
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'url'</span></pre></div></div>
|
222
222
|
|
223
223
|
</li>
|
224
224
|
|
@@ -233,10 +233,10 @@
|
|
233
233
|
|
234
234
|
</div>
|
235
235
|
|
236
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
237
|
-
<span class="keyword">else</span>
|
238
|
-
raise <span class="string">'Wrong GUID source.'</span>
|
239
|
-
<span class="keyword">end</span></pre></div></div>
|
236
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
237
|
+
<span class="hljs-keyword">else</span>
|
238
|
+
raise <span class="hljs-string">'Wrong GUID source.'</span>
|
239
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
240
240
|
|
241
241
|
</li>
|
242
242
|
|
@@ -251,7 +251,7 @@
|
|
251
251
|
|
252
252
|
</div>
|
253
253
|
|
254
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'No such file'</span> <span class="keyword">unless</span> file.is_a?(<span class="constant">GroupDocs::Storage::File</span>)</pre></div></div>
|
254
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'No such file'</span> <span class="hljs-keyword">unless</span> file.is_a?(<span class="hljs-constant">GroupDocs::Storage::File</span>)</pre></div></div>
|
255
255
|
|
256
256
|
</li>
|
257
257
|
|
@@ -277,7 +277,7 @@
|
|
277
277
|
<div class="pilwrap ">
|
278
278
|
<a class="pilcrow" href="#section-16">¶</a>
|
279
279
|
</div>
|
280
|
-
<p>Get array of document
|
280
|
+
<p>Get array of document’s fields</p>
|
281
281
|
|
282
282
|
</div>
|
283
283
|
|
@@ -296,39 +296,38 @@
|
|
296
296
|
|
297
297
|
</div>
|
298
298
|
|
299
|
-
<div class="content"><div class='highlight'><pre> html = <span class="string">''</span>
|
300
|
-
fields.map <span class="keyword">do</span> |e|
|
299
|
+
<div class="content"><div class='highlight'><pre> html = <span class="hljs-string">''</span>
|
300
|
+
fields.map <span class="hljs-keyword">do</span> |e|
|
301
301
|
|
302
|
-
<span class="keyword">case</span> e.type
|
303
|
-
<span class="keyword">when</span> <span class="string">'Text'</span>
|
304
|
-
signature = <span class="string">"<br/><label for='<span class="subst">#{e.name}</span>'><span class="subst">#{e.name}</span> <span class="subst">#{e.mandatory == <span class="keyword">false</span> ? <span class="string">'<span class="optional">(Optional)</span>'</span> <span class="symbol">:</span> <span class="string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><input type='text' name='<span class="subst">#{e.name}</span>'></input><br/><br/>"</span>
|
302
|
+
<span class="hljs-keyword">case</span> e.type
|
303
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'Text'</span>
|
304
|
+
signature = <span class="hljs-string">"<br/><label for='<span class="hljs-subst">#{e.name}</span>'><span class="hljs-subst">#{e.name}</span> <span class="hljs-subst">#{e.mandatory == <span class="hljs-keyword">false</span> ? <span class="hljs-string">'<span class="optional">(Optional)</span>'</span> <span class="hljs-symbol">:</span> <span class="hljs-string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><input type='text' name='<span class="hljs-subst">#{e.name}</span>'></input><br/><br/>"</span>
|
305
305
|
html << signature
|
306
|
-
<span class="keyword">when</span> <span class="string">'RadioButton'</span>
|
307
|
-
i = <span class="number">0</span>
|
308
|
-
html.scan(e.name).empty? ? <span class="string">''</span> <span class="symbol">:</span> i += <span class="number">1</span>
|
309
|
-
radio = <span class="string">"<br/><label for='<span class="subst">#{e.name}</span>'><span class="subst">#{e.name}</span> <span class="subst">#{e.mandatory == <span class="keyword">false</span> ? <span class="string">'<span class="optional">(Optional)</span>'</span> <span class="symbol">:</span> <span class="string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><input type='radio' name='<span class="subst">#{e.name}</span>' value='<span class="subst">#{i}</span>' ></input><br/><br/>"</span>
|
306
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'RadioButton'</span>
|
307
|
+
i = <span class="hljs-number">0</span>
|
308
|
+
html.scan(e.name).empty? ? <span class="hljs-string">''</span> <span class="hljs-symbol">:</span> i += <span class="hljs-number">1</span>
|
309
|
+
radio = <span class="hljs-string">"<br/><label for='<span class="hljs-subst">#{e.name}</span>'><span class="hljs-subst">#{e.name}</span> <span class="hljs-subst">#{e.mandatory == <span class="hljs-keyword">false</span> ? <span class="hljs-string">'<span class="optional">(Optional)</span>'</span> <span class="hljs-symbol">:</span> <span class="hljs-string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><input type='radio' name='<span class="hljs-subst">#{e.name}</span>' value='<span class="hljs-subst">#{i}</span>' ></input><br/><br/>"</span>
|
310
310
|
html << radio
|
311
|
-
<span class="keyword">when</span> <span class="string">'Checkbox'</span>
|
312
|
-
checkbox = <span class="string">"<br/><label for='<span class="subst">#{e.name}</span>'><span class="subst">#{e.name}</span> <span class="subst">#{e.mandatory == <span class="keyword">false</span> ? <span class="string">'<span class="optional">(Optional)</span>'</span> <span class="symbol">:</span> <span class="string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><input type='checkbox' name='<span class="subst">#{e.name}</span>' ></input><br/><br/>"</span>
|
311
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'Checkbox'</span>
|
312
|
+
checkbox = <span class="hljs-string">"<br/><label for='<span class="hljs-subst">#{e.name}</span>'><span class="hljs-subst">#{e.name}</span> <span class="hljs-subst">#{e.mandatory == <span class="hljs-keyword">false</span> ? <span class="hljs-string">'<span class="optional">(Optional)</span>'</span> <span class="hljs-symbol">:</span> <span class="hljs-string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><input type='checkbox' name='<span class="hljs-subst">#{e.name}</span>' ></input><br/><br/>"</span>
|
313
313
|
html << checkbox
|
314
|
-
<span class="keyword">when</span> <span class="string">'Combobox'</span>
|
315
|
-
combobox = <span class="string">"<br/><label for='<span class="subst">#{e.name}</span>'><span class="subst">#{e.name}</span> <span class="subst">#{e.mandatory == <span class="keyword">false</span> ? <span class="string">'<span class="optional">(Optional)</span>'</span> <span class="symbol">:</span> <span class="string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><select name='<span class="subst">#{e.name}</span>'>"</span>
|
316
|
-
e.acceptableValues.each { |e| combobox << <span class="string">"<option name='<span class="subst">#{e}</span>'><span class="subst">#{e}</span></option>"</span>}
|
317
|
-
combobox << <span class="string">"</select><br/><br/>"</span>
|
314
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'Combobox'</span>
|
315
|
+
combobox = <span class="hljs-string">"<br/><label for='<span class="hljs-subst">#{e.name}</span>'><span class="hljs-subst">#{e.name}</span> <span class="hljs-subst">#{e.mandatory == <span class="hljs-keyword">false</span> ? <span class="hljs-string">'<span class="optional">(Optional)</span>'</span> <span class="hljs-symbol">:</span> <span class="hljs-string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><select name='<span class="hljs-subst">#{e.name}</span>'>"</span>
|
316
|
+
e.acceptableValues.each { |e| combobox << <span class="hljs-string">"<option name='<span class="hljs-subst">#{e}</span>'><span class="hljs-subst">#{e}</span></option>"</span>}
|
317
|
+
combobox << <span class="hljs-string">"</select><br/><br/>"</span>
|
318
318
|
html << combobox
|
319
|
-
<span class="keyword">when</span> <span class="string">'Listbox'</span>
|
320
|
-
listbox = <span class="string">"<br/><label for='<span class="subst">#{e.name}</span>'><span class="subst">#{e.name}</span> <span class="subst">#{e.mandatory == <span class="keyword">false</span> ? <span class="string">'<span class="optional">(Optional)</span>'</span> <span class="symbol">:</span> <span class="string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><select multiple name='<span class="subst">#{e.name}</span>[]'>"</span>
|
321
|
-
e.acceptableValues.each { |e| listbox << <span class="string">"<option name='<span class="subst">#{e}</span>'><span class="subst">#{e}</span></option>"</span>}
|
322
|
-
listbox << <span class="string">"</select><br/><br/>"</span>
|
319
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'Listbox'</span>
|
320
|
+
listbox = <span class="hljs-string">"<br/><label for='<span class="hljs-subst">#{e.name}</span>'><span class="hljs-subst">#{e.name}</span> <span class="hljs-subst">#{e.mandatory == <span class="hljs-keyword">false</span> ? <span class="hljs-string">'<span class="optional">(Optional)</span>'</span> <span class="hljs-symbol">:</span> <span class="hljs-string">'<span class="optional">(Required)</span>'</span>}</span></label><br/><select multiple name='<span class="hljs-subst">#{e.name}</span>[]'>"</span>
|
321
|
+
e.acceptableValues.each { |e| listbox << <span class="hljs-string">"<option name='<span class="hljs-subst">#{e}</span>'><span class="hljs-subst">#{e}</span></option>"</span>}
|
322
|
+
listbox << <span class="hljs-string">"</select><br/><br/>"</span>
|
323
323
|
html << listbox
|
324
|
-
<span class="keyword">end</span>
|
324
|
+
<span class="hljs-keyword">end</span>
|
325
325
|
|
326
|
-
<span class="keyword">end</span>
|
326
|
+
<span class="hljs-keyword">end</span>
|
327
327
|
|
328
|
-
|
329
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
328
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
330
329
|
err = e.message
|
331
|
-
<span class="keyword">end</span></pre></div></div>
|
330
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
332
331
|
|
333
332
|
</li>
|
334
333
|
|
@@ -343,8 +342,8 @@
|
|
343
342
|
|
344
343
|
</div>
|
345
344
|
|
346
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample35</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:
|
347
|
-
<span class="keyword">end</span></pre></div></div>
|
345
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample35</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:userId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:fileId</span> => document.file.guid, <span class="hljs-symbol">:base_path</span> => settings.base_path, <span class="hljs-symbol">:html</span> => html, <span class="hljs-symbol">:err</span> => err}
|
346
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
348
347
|
|
349
348
|
</li>
|
350
349
|
|
@@ -359,9 +358,9 @@
|
|
359
358
|
|
360
359
|
</div>
|
361
360
|
|
362
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/
|
363
|
-
haml <span class="symbol">:sample35</span>
|
364
|
-
<span class="keyword">end</span></pre></div></div>
|
361
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'//sample-35-how-to-get-fields-and-their-data-from-pdf-file/check'</span> <span class="hljs-keyword">do</span>
|
362
|
+
haml <span class="hljs-symbol">:sample35</span>
|
363
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
365
364
|
|
366
365
|
</li>
|
367
366
|
|
@@ -376,13 +375,13 @@
|
|
376
375
|
|
377
376
|
</div>
|
378
377
|
|
379
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
380
|
-
set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
381
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
382
|
-
set <span class="symbol">:
|
383
|
-
set <span class="symbol">:file_id</span>, params[<span class="symbol">:fileId</span>]
|
378
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'//sample-35-how-to-get-fields-and-their-data-from-pdf-file/check'</span> <span class="hljs-keyword">do</span>
|
379
|
+
set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>]
|
380
|
+
set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>]
|
381
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]
|
382
|
+
set <span class="hljs-symbol">:file_id</span>, params[<span class="hljs-symbol">:fileId</span>]
|
384
383
|
|
385
|
-
<span class="keyword">begin</span></pre></div></div>
|
384
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
386
385
|
|
387
386
|
</li>
|
388
387
|
|
@@ -397,13 +396,13 @@
|
|
397
396
|
|
398
397
|
</div>
|
399
398
|
|
400
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
401
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
402
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
403
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
404
|
-
<span class="keyword">else</span>
|
399
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
400
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
401
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
402
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
403
|
+
<span class="hljs-keyword">else</span>
|
405
404
|
base_path = settings.base_path
|
406
|
-
<span class="keyword">end</span></pre></div></div>
|
405
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
407
406
|
|
408
407
|
</li>
|
409
408
|
|
@@ -418,7 +417,7 @@
|
|
418
417
|
|
419
418
|
</div>
|
420
419
|
|
421
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
420
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
422
421
|
groupdocs.client_id = settings.client_id
|
423
422
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
424
423
|
|
@@ -435,8 +434,8 @@
|
|
435
434
|
|
436
435
|
</div>
|
437
436
|
|
438
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
439
|
-
<span class="keyword">end</span></pre></div></div>
|
437
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
438
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
440
439
|
|
441
440
|
</li>
|
442
441
|
|
@@ -465,7 +464,7 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
465
464
|
|
466
465
|
</div>
|
467
466
|
|
468
|
-
<div class="content"><div class='highlight'><pre> document = <span class="constant">GroupDocs::Storage::File</span>.new({<span class="symbol">:guid</span> => settings.file_id}).to_document</pre></div></div>
|
467
|
+
<div class="content"><div class='highlight'><pre> document = <span class="hljs-constant">GroupDocs::Storage::File</span>.new({<span class="hljs-symbol">:guid</span> => settings.file_id}).to_document</pre></div></div>
|
469
468
|
|
470
469
|
</li>
|
471
470
|
|
@@ -480,7 +479,7 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
480
479
|
|
481
480
|
</div>
|
482
481
|
|
483
|
-
<div class="content"><div class='highlight'><pre> datasource = <span class="constant">GroupDocs::DataSource</span>.new</pre></div></div>
|
482
|
+
<div class="content"><div class='highlight'><pre> datasource = <span class="hljs-constant">GroupDocs::DataSource</span>.new</pre></div></div>
|
484
483
|
|
485
484
|
</li>
|
486
485
|
|
@@ -491,7 +490,7 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
491
490
|
<div class="pilwrap ">
|
492
491
|
<a class="pilcrow" href="#section-27">¶</a>
|
493
492
|
</div>
|
494
|
-
<p>Get array of document
|
493
|
+
<p>Get array of document’s fields</p>
|
495
494
|
|
496
495
|
</div>
|
497
496
|
|
@@ -527,43 +526,43 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
527
526
|
|
528
527
|
</div>
|
529
528
|
|
530
|
-
<div class="content"><div class='highlight'><pre> fields.each <span class="keyword">do</span> |field|
|
531
|
-
<span class="keyword">if</span> field.type == <span class="string">'Text'</span>
|
532
|
-
datasource.fields << <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> field.name, <span class="symbol">type:</span> <span class="symbol">:text</span>, <span class="symbol">values:</span> [params[field.name.to_sym]])
|
533
|
-
<span class="keyword">end</span>
|
529
|
+
<div class="content"><div class='highlight'><pre> fields.each <span class="hljs-keyword">do</span> |field|
|
530
|
+
<span class="hljs-keyword">if</span> field.type == <span class="hljs-string">'Text'</span>
|
531
|
+
datasource.fields << <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> field.name, <span class="hljs-symbol">type:</span> <span class="hljs-symbol">:text</span>, <span class="hljs-symbol">values:</span> [params[field.name.to_sym]])
|
532
|
+
<span class="hljs-keyword">end</span>
|
534
533
|
|
535
|
-
<span class="keyword">if</span> field.type == <span class="string">"RadioButton"</span> && params[field.name.to_sym]
|
536
|
-
datasource.fields << <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> field.name, <span class="symbol">type:</span> <span class="string">'integer'</span>, <span class="symbol">values:</span> [params[field.name.to_sym]])
|
534
|
+
<span class="hljs-keyword">if</span> field.type == <span class="hljs-string">"RadioButton"</span> && params[field.name.to_sym]
|
535
|
+
datasource.fields << <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> field.name, <span class="hljs-symbol">type:</span> <span class="hljs-string">'integer'</span>, <span class="hljs-symbol">values:</span> [params[field.name.to_sym]])
|
537
536
|
|
538
|
-
<span class="keyword">end</span>
|
537
|
+
<span class="hljs-keyword">end</span>
|
539
538
|
|
540
|
-
<span class="keyword">if</span> field.type == <span class="string">"Checkbox"</span> && params[field.name.to_sym] == <span class="string">'on'</span>
|
541
|
-
datasource.fields << <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> field.name, <span class="symbol">type:</span> <span class="string">'boolean'</span>, <span class="symbol">values:</span> [<span class="keyword">true</span>])
|
542
|
-
<span class="keyword">end</span>
|
539
|
+
<span class="hljs-keyword">if</span> field.type == <span class="hljs-string">"Checkbox"</span> && params[field.name.to_sym] == <span class="hljs-string">'on'</span>
|
540
|
+
datasource.fields << <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> field.name, <span class="hljs-symbol">type:</span> <span class="hljs-string">'boolean'</span>, <span class="hljs-symbol">values:</span> [<span class="hljs-keyword">true</span>])
|
541
|
+
<span class="hljs-keyword">end</span>
|
543
542
|
|
544
|
-
<span class="keyword">if</span> field.type == <span class="string">"Combobox"</span> && params[field.name.to_sym]
|
545
|
-
i = <span class="number">0</span>
|
546
|
-
value = <span class="keyword">nil</span>
|
547
|
-
field.acceptableValues.each <span class="keyword">do</span> |e|
|
548
|
-
e == params[field.name] ? value = i <span class="symbol">:</span> <span class="string">''</span>
|
549
|
-
i += <span class="number">1</span>
|
550
|
-
<span class="keyword">end</span>
|
543
|
+
<span class="hljs-keyword">if</span> field.type == <span class="hljs-string">"Combobox"</span> && params[field.name.to_sym]
|
544
|
+
i = <span class="hljs-number">0</span>
|
545
|
+
value = <span class="hljs-keyword">nil</span>
|
546
|
+
field.acceptableValues.each <span class="hljs-keyword">do</span> |e|
|
547
|
+
e == params[field.name] ? value = i <span class="hljs-symbol">:</span> <span class="hljs-string">''</span>
|
548
|
+
i += <span class="hljs-number">1</span>
|
549
|
+
<span class="hljs-keyword">end</span>
|
551
550
|
|
552
|
-
datasource.fields << <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> field.name, <span class="symbol">type:</span> <span class="string">'integer'</span>, <span class="symbol">values:</span> [value])
|
553
|
-
<span class="keyword">end</span>
|
551
|
+
datasource.fields << <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> field.name, <span class="hljs-symbol">type:</span> <span class="hljs-string">'integer'</span>, <span class="hljs-symbol">values:</span> [value])
|
552
|
+
<span class="hljs-keyword">end</span>
|
554
553
|
|
555
|
-
<span class="keyword">if</span> field.type == <span class="string">"Listbox"</span> && params[field.name.to_sym]
|
556
|
-
i = <span class="number">0</span>
|
557
|
-
value = <span class="keyword">nil</span>
|
558
|
-
field.acceptableValues.each <span class="keyword">do</span> |e|
|
559
|
-
e == params[field.name] ? value = i <span class="symbol">:</span> <span class="string">''</span>
|
560
|
-
i += <span class="number">1</span>
|
561
|
-
<span class="keyword">end</span>
|
562
|
-
datasource.fields << <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> field.name, <span class="symbol">type:</span> <span class="string">'integer'</span>, <span class="symbol">values:</span> [value])
|
554
|
+
<span class="hljs-keyword">if</span> field.type == <span class="hljs-string">"Listbox"</span> && params[field.name.to_sym]
|
555
|
+
i = <span class="hljs-number">0</span>
|
556
|
+
value = <span class="hljs-keyword">nil</span>
|
557
|
+
field.acceptableValues.each <span class="hljs-keyword">do</span> |e|
|
558
|
+
e == params[field.name] ? value = i <span class="hljs-symbol">:</span> <span class="hljs-string">''</span>
|
559
|
+
i += <span class="hljs-number">1</span>
|
560
|
+
<span class="hljs-keyword">end</span>
|
561
|
+
datasource.fields << <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> field.name, <span class="hljs-symbol">type:</span> <span class="hljs-string">'integer'</span>, <span class="hljs-symbol">values:</span> [value])
|
563
562
|
|
564
|
-
<span class="keyword">end</span>
|
563
|
+
<span class="hljs-keyword">end</span>
|
565
564
|
|
566
|
-
<span class="keyword">end</span></pre></div></div>
|
565
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
567
566
|
|
568
567
|
</li>
|
569
568
|
|
@@ -593,9 +592,9 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
593
592
|
|
594
593
|
</div>
|
595
594
|
|
596
|
-
<div class="content"><div class='highlight'><pre> job = document.datasource!(datasource, {<span class="symbol">:new_type</span> => <span class="string">'pdf'</span>})
|
595
|
+
<div class="content"><div class='highlight'><pre> job = document.datasource!(datasource, {<span class="hljs-symbol">:new_type</span> => <span class="hljs-string">'pdf'</span>})
|
597
596
|
|
598
|
-
i = <span class="number">0</span></pre></div></div>
|
597
|
+
i = <span class="hljs-number">0</span></pre></div></div>
|
599
598
|
|
600
599
|
</li>
|
601
600
|
|
@@ -610,12 +609,12 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
610
609
|
|
611
610
|
</div>
|
612
611
|
|
613
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">while</span> i<<span class="number">5</span> <span class="keyword">do</span>
|
614
|
-
sleep(<span class="number">5</span>)
|
615
|
-
job_status = <span class="constant">GroupDocs::Job</span>.get!(job.id)
|
616
|
-
<span class="keyword">break</span> <span class="keyword">if</span> job_status.status == <span class="symbol">:archived</span>
|
617
|
-
i += <span class="number">1</span>
|
618
|
-
<span class="keyword">end</span></pre></div></div>
|
612
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">while</span> i<<span class="hljs-number">5</span> <span class="hljs-keyword">do</span>
|
613
|
+
sleep(<span class="hljs-number">5</span>)
|
614
|
+
job_status = <span class="hljs-constant">GroupDocs::Job</span>.get!(job.id)
|
615
|
+
<span class="hljs-keyword">break</span> <span class="hljs-keyword">if</span> job_status.status == <span class="hljs-symbol">:archived</span>
|
616
|
+
i += <span class="hljs-number">1</span>
|
617
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
619
618
|
|
620
619
|
</li>
|
621
620
|
|
@@ -645,7 +644,7 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
645
644
|
|
646
645
|
</div>
|
647
646
|
|
648
|
-
<div class="content"><div class='highlight'><pre> guid = document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].guid</pre></div></div>
|
647
|
+
<div class="content"><div class='highlight'><pre> guid = document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].guid</pre></div></div>
|
649
648
|
|
650
649
|
</li>
|
651
650
|
|
@@ -660,7 +659,7 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
660
659
|
|
661
660
|
</div>
|
662
661
|
|
663
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{guid}</span>"</span></pre></div></div>
|
662
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="hljs-string">"/document-viewer/embed/<span class="hljs-subst">#{guid}</span>"</span></pre></div></div>
|
664
663
|
|
665
664
|
</li>
|
666
665
|
|
@@ -675,7 +674,7 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
675
674
|
|
676
675
|
</div>
|
677
676
|
|
678
|
-
<div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> => iframe).prepare_and_sign_url</pre></div></div>
|
677
|
+
<div class="content"><div class='highlight'><pre> url = <span class="hljs-constant">GroupDocs::Api::Request</span>.new(<span class="hljs-symbol">:path</span> => iframe).prepare_and_sign_url</pre></div></div>
|
679
678
|
|
680
679
|
</li>
|
681
680
|
|
@@ -690,14 +689,14 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
690
689
|
|
691
690
|
</div>
|
692
691
|
|
693
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path
|
694
|
-
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
695
|
-
iframe = <span class="string">"https://stage-
|
696
|
-
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
697
|
-
iframe = <span class="string">"https://dev-apps
|
698
|
-
<span class="keyword">else</span>
|
699
|
-
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
700
|
-
<span class="keyword">end</span></pre></div></div>
|
692
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> base_path
|
693
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://stage-api-groupdocs.dynabic.com'</span>
|
694
|
+
iframe = <span class="hljs-string">"https://stage-apps-groupdocs.dynabic.com/<span class="hljs-subst">#{url}</span>"</span>
|
695
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://dev-api-groupdocs.dynabic.com'</span>
|
696
|
+
iframe = <span class="hljs-string">"https://dev-apps-groupdocs.dynabic.com<span class="hljs-subst">#{url}</span>"</span>
|
697
|
+
<span class="hljs-keyword">else</span>
|
698
|
+
iframe = <span class="hljs-string">"https://apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
699
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
701
700
|
|
702
701
|
</li>
|
703
702
|
|
@@ -712,14 +711,14 @@ Merge template PDF FIle with the data provided via dynamically created HTML form
|
|
712
711
|
|
713
712
|
</div>
|
714
713
|
|
715
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"<iframe id='downloadframe' src='<span class="subst">#{iframe}</span>' width='800' height='1000'></iframe>"</span>
|
714
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="hljs-string">"<iframe id='downloadframe' src='<span class="hljs-subst">#{iframe}</span>' width='800' height='1000'></iframe>"</span>
|
716
715
|
|
717
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
716
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
718
717
|
err = e.message
|
719
|
-
<span class="keyword">end</span>
|
718
|
+
<span class="hljs-keyword">end</span>
|
720
719
|
|
721
|
-
haml <span class="symbol">:sample35</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:iframe</span> => iframe, <span class="symbol">:err</span> => err}
|
722
|
-
<span class="keyword">end</span></pre></div></div>
|
720
|
+
haml <span class="hljs-symbol">:sample35</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:userId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:iframe</span> => iframe, <span class="hljs-symbol">:err</span> => err}
|
721
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
723
722
|
|
724
723
|
</li>
|
725
724
|
|