aspose_pdf_cloud 19.12.0 → 20.6.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.
- checksums.yaml +4 -4
- data/README.md +22 -9
- data/docs/Cell.md +3 -0
- data/docs/CheckBoxField.md +1 -0
- data/docs/ChoiceField.md +1 -0
- data/docs/ComboBoxField.md +1 -0
- data/docs/FormField.md +1 -0
- data/docs/ImageFragment.md +15 -0
- data/docs/ListBoxField.md +1 -0
- data/docs/OutputFormat.md +11 -0
- data/docs/PdfApi.md +244 -14
- data/docs/RadioButtonField.md +1 -0
- data/docs/RadioButtonOptionField.md +1 -0
- data/docs/SignatureField.md +1 -0
- data/docs/TextBoxField.md +1 -0
- data/lib/aspose_pdf_cloud.rb +2 -0
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +719 -27
- data/lib/aspose_pdf_cloud/api_client.rb +1 -1
- data/lib/aspose_pdf_cloud/models/cell.rb +36 -4
- data/lib/aspose_pdf_cloud/models/check_box_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/choice_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/combo_box_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/form_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/image_fragment.rb +283 -0
- data/lib/aspose_pdf_cloud/models/list_box_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/output_format.rb +44 -0
- data/lib/aspose_pdf_cloud/models/radio_button_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/radio_button_option_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/signature_field.rb +11 -1
- data/lib/aspose_pdf_cloud/models/text_box_field.rb +11 -1
- data/lib/aspose_pdf_cloud/version.rb +1 -1
- data/test/pdf_tests.rb +231 -99
- data/test_data/4pagesPdfA.pdf +0 -0
- metadata +7 -2
@@ -31,6 +31,9 @@ module AsposePdfCloud
|
|
31
31
|
# Field name.
|
32
32
|
attr_accessor :partial_name
|
33
33
|
|
34
|
+
# Full Field name.
|
35
|
+
attr_accessor :full_name
|
36
|
+
|
34
37
|
# Field rectangle.
|
35
38
|
attr_accessor :rect
|
36
39
|
|
@@ -106,6 +109,7 @@ module AsposePdfCloud
|
|
106
109
|
{
|
107
110
|
:'links' => :'Links',
|
108
111
|
:'partial_name' => :'PartialName',
|
112
|
+
:'full_name' => :'FullName',
|
109
113
|
:'rect' => :'Rect',
|
110
114
|
:'value' => :'Value',
|
111
115
|
:'page_index' => :'PageIndex',
|
@@ -137,6 +141,7 @@ module AsposePdfCloud
|
|
137
141
|
{
|
138
142
|
:'links' => :'Array<Link>',
|
139
143
|
:'partial_name' => :'String',
|
144
|
+
:'full_name' => :'String',
|
140
145
|
:'rect' => :'Rectangle',
|
141
146
|
:'value' => :'String',
|
142
147
|
:'page_index' => :'Integer',
|
@@ -181,6 +186,10 @@ module AsposePdfCloud
|
|
181
186
|
self.partial_name = attributes[:'PartialName']
|
182
187
|
end
|
183
188
|
|
189
|
+
if attributes.has_key?(:'FullName')
|
190
|
+
self.full_name = attributes[:'FullName']
|
191
|
+
end
|
192
|
+
|
184
193
|
if attributes.has_key?(:'Rect')
|
185
194
|
self.rect = attributes[:'Rect']
|
186
195
|
end
|
@@ -306,6 +315,7 @@ module AsposePdfCloud
|
|
306
315
|
self.class == o.class &&
|
307
316
|
links == o.links &&
|
308
317
|
partial_name == o.partial_name &&
|
318
|
+
full_name == o.full_name &&
|
309
319
|
rect == o.rect &&
|
310
320
|
value == o.value &&
|
311
321
|
page_index == o.page_index &&
|
@@ -340,7 +350,7 @@ module AsposePdfCloud
|
|
340
350
|
# Calculates hash code according to all attributes.
|
341
351
|
# @return [Fixnum] Hash code
|
342
352
|
def hash
|
343
|
-
[links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, active_state, top_index, selected_items].hash
|
353
|
+
[links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, active_state, top_index, selected_items].hash
|
344
354
|
end
|
345
355
|
|
346
356
|
# Builds the object from hash
|
@@ -0,0 +1,44 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2020 Aspose.PDF Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'date'
|
23
|
+
require 'time'
|
24
|
+
|
25
|
+
module AsposePdfCloud
|
26
|
+
class OutputFormat
|
27
|
+
|
28
|
+
ZIP = "Zip".freeze
|
29
|
+
FOLDER = "Folder".freeze
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
# resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
|
36
|
+
# consantValues = OutputFormat.constants.select{|c| c.to_s == value}
|
37
|
+
constantValues = OutputFormat.constants.select{ |const_name| OutputFormat.const_get(const_name) == value}
|
38
|
+
|
39
|
+
raise "Invalid ENUM value #{value} for class #OutputFormat" if constantValues.empty?
|
40
|
+
value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -31,6 +31,9 @@ module AsposePdfCloud
|
|
31
31
|
# Field name.
|
32
32
|
attr_accessor :partial_name
|
33
33
|
|
34
|
+
# Full Field name.
|
35
|
+
attr_accessor :full_name
|
36
|
+
|
34
37
|
# Field rectangle.
|
35
38
|
attr_accessor :rect
|
36
39
|
|
@@ -103,6 +106,7 @@ module AsposePdfCloud
|
|
103
106
|
{
|
104
107
|
:'links' => :'Links',
|
105
108
|
:'partial_name' => :'PartialName',
|
109
|
+
:'full_name' => :'FullName',
|
106
110
|
:'rect' => :'Rect',
|
107
111
|
:'value' => :'Value',
|
108
112
|
:'page_index' => :'PageIndex',
|
@@ -133,6 +137,7 @@ module AsposePdfCloud
|
|
133
137
|
{
|
134
138
|
:'links' => :'Array<Link>',
|
135
139
|
:'partial_name' => :'String',
|
140
|
+
:'full_name' => :'String',
|
136
141
|
:'rect' => :'Rectangle',
|
137
142
|
:'value' => :'String',
|
138
143
|
:'page_index' => :'Integer',
|
@@ -176,6 +181,10 @@ module AsposePdfCloud
|
|
176
181
|
self.partial_name = attributes[:'PartialName']
|
177
182
|
end
|
178
183
|
|
184
|
+
if attributes.has_key?(:'FullName')
|
185
|
+
self.full_name = attributes[:'FullName']
|
186
|
+
end
|
187
|
+
|
179
188
|
if attributes.has_key?(:'Rect')
|
180
189
|
self.rect = attributes[:'Rect']
|
181
190
|
end
|
@@ -297,6 +306,7 @@ module AsposePdfCloud
|
|
297
306
|
self.class == o.class &&
|
298
307
|
links == o.links &&
|
299
308
|
partial_name == o.partial_name &&
|
309
|
+
full_name == o.full_name &&
|
300
310
|
rect == o.rect &&
|
301
311
|
value == o.value &&
|
302
312
|
page_index == o.page_index &&
|
@@ -330,7 +340,7 @@ module AsposePdfCloud
|
|
330
340
|
# Calculates hash code according to all attributes.
|
331
341
|
# @return [Fixnum] Hash code
|
332
342
|
def hash
|
333
|
-
[links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, radio_button_options_field, style].hash
|
343
|
+
[links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, radio_button_options_field, style].hash
|
334
344
|
end
|
335
345
|
|
336
346
|
# Builds the object from hash
|
@@ -31,6 +31,9 @@ module AsposePdfCloud
|
|
31
31
|
# Field name.
|
32
32
|
attr_accessor :partial_name
|
33
33
|
|
34
|
+
# Full Field name.
|
35
|
+
attr_accessor :full_name
|
36
|
+
|
34
37
|
# Field rectangle.
|
35
38
|
attr_accessor :rect
|
36
39
|
|
@@ -94,6 +97,7 @@ module AsposePdfCloud
|
|
94
97
|
{
|
95
98
|
:'links' => :'Links',
|
96
99
|
:'partial_name' => :'PartialName',
|
100
|
+
:'full_name' => :'FullName',
|
97
101
|
:'rect' => :'Rect',
|
98
102
|
:'value' => :'Value',
|
99
103
|
:'page_index' => :'PageIndex',
|
@@ -121,6 +125,7 @@ module AsposePdfCloud
|
|
121
125
|
{
|
122
126
|
:'links' => :'Array<Link>',
|
123
127
|
:'partial_name' => :'String',
|
128
|
+
:'full_name' => :'String',
|
124
129
|
:'rect' => :'Rectangle',
|
125
130
|
:'value' => :'String',
|
126
131
|
:'page_index' => :'Integer',
|
@@ -161,6 +166,10 @@ module AsposePdfCloud
|
|
161
166
|
self.partial_name = attributes[:'PartialName']
|
162
167
|
end
|
163
168
|
|
169
|
+
if attributes.has_key?(:'FullName')
|
170
|
+
self.full_name = attributes[:'FullName']
|
171
|
+
end
|
172
|
+
|
164
173
|
if attributes.has_key?(:'Rect')
|
165
174
|
self.rect = attributes[:'Rect']
|
166
175
|
end
|
@@ -266,6 +275,7 @@ module AsposePdfCloud
|
|
266
275
|
self.class == o.class &&
|
267
276
|
links == o.links &&
|
268
277
|
partial_name == o.partial_name &&
|
278
|
+
full_name == o.full_name &&
|
269
279
|
rect == o.rect &&
|
270
280
|
value == o.value &&
|
271
281
|
page_index == o.page_index &&
|
@@ -296,7 +306,7 @@ module AsposePdfCloud
|
|
296
306
|
# Calculates hash code according to all attributes.
|
297
307
|
# @return [Fixnum] Hash code
|
298
308
|
def hash
|
299
|
-
[links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, option_name, style].hash
|
309
|
+
[links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, option_name, style].hash
|
300
310
|
end
|
301
311
|
|
302
312
|
# Builds the object from hash
|
@@ -31,6 +31,9 @@ module AsposePdfCloud
|
|
31
31
|
# Field name.
|
32
32
|
attr_accessor :partial_name
|
33
33
|
|
34
|
+
# Full Field name.
|
35
|
+
attr_accessor :full_name
|
36
|
+
|
34
37
|
# Field rectangle.
|
35
38
|
attr_accessor :rect
|
36
39
|
|
@@ -91,6 +94,7 @@ module AsposePdfCloud
|
|
91
94
|
{
|
92
95
|
:'links' => :'Links',
|
93
96
|
:'partial_name' => :'PartialName',
|
97
|
+
:'full_name' => :'FullName',
|
94
98
|
:'rect' => :'Rect',
|
95
99
|
:'value' => :'Value',
|
96
100
|
:'page_index' => :'PageIndex',
|
@@ -117,6 +121,7 @@ module AsposePdfCloud
|
|
117
121
|
{
|
118
122
|
:'links' => :'Array<Link>',
|
119
123
|
:'partial_name' => :'String',
|
124
|
+
:'full_name' => :'String',
|
120
125
|
:'rect' => :'Rectangle',
|
121
126
|
:'value' => :'String',
|
122
127
|
:'page_index' => :'Integer',
|
@@ -156,6 +161,10 @@ module AsposePdfCloud
|
|
156
161
|
self.partial_name = attributes[:'PartialName']
|
157
162
|
end
|
158
163
|
|
164
|
+
if attributes.has_key?(:'FullName')
|
165
|
+
self.full_name = attributes[:'FullName']
|
166
|
+
end
|
167
|
+
|
159
168
|
if attributes.has_key?(:'Rect')
|
160
169
|
self.rect = attributes[:'Rect']
|
161
170
|
end
|
@@ -257,6 +266,7 @@ module AsposePdfCloud
|
|
257
266
|
self.class == o.class &&
|
258
267
|
links == o.links &&
|
259
268
|
partial_name == o.partial_name &&
|
269
|
+
full_name == o.full_name &&
|
260
270
|
rect == o.rect &&
|
261
271
|
value == o.value &&
|
262
272
|
page_index == o.page_index &&
|
@@ -286,7 +296,7 @@ module AsposePdfCloud
|
|
286
296
|
# Calculates hash code according to all attributes.
|
287
297
|
# @return [Fixnum] Hash code
|
288
298
|
def hash
|
289
|
-
[links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, signature].hash
|
299
|
+
[links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, signature].hash
|
290
300
|
end
|
291
301
|
|
292
302
|
# Builds the object from hash
|
@@ -31,6 +31,9 @@ module AsposePdfCloud
|
|
31
31
|
# Field name.
|
32
32
|
attr_accessor :partial_name
|
33
33
|
|
34
|
+
# Full Field name.
|
35
|
+
attr_accessor :full_name
|
36
|
+
|
34
37
|
# Field rectangle.
|
35
38
|
attr_accessor :rect
|
36
39
|
|
@@ -106,6 +109,7 @@ module AsposePdfCloud
|
|
106
109
|
{
|
107
110
|
:'links' => :'Links',
|
108
111
|
:'partial_name' => :'PartialName',
|
112
|
+
:'full_name' => :'FullName',
|
109
113
|
:'rect' => :'Rect',
|
110
114
|
:'value' => :'Value',
|
111
115
|
:'page_index' => :'PageIndex',
|
@@ -137,6 +141,7 @@ module AsposePdfCloud
|
|
137
141
|
{
|
138
142
|
:'links' => :'Array<Link>',
|
139
143
|
:'partial_name' => :'String',
|
144
|
+
:'full_name' => :'String',
|
140
145
|
:'rect' => :'Rectangle',
|
141
146
|
:'value' => :'String',
|
142
147
|
:'page_index' => :'Integer',
|
@@ -181,6 +186,10 @@ module AsposePdfCloud
|
|
181
186
|
self.partial_name = attributes[:'PartialName']
|
182
187
|
end
|
183
188
|
|
189
|
+
if attributes.has_key?(:'FullName')
|
190
|
+
self.full_name = attributes[:'FullName']
|
191
|
+
end
|
192
|
+
|
184
193
|
if attributes.has_key?(:'Rect')
|
185
194
|
self.rect = attributes[:'Rect']
|
186
195
|
end
|
@@ -302,6 +311,7 @@ module AsposePdfCloud
|
|
302
311
|
self.class == o.class &&
|
303
312
|
links == o.links &&
|
304
313
|
partial_name == o.partial_name &&
|
314
|
+
full_name == o.full_name &&
|
305
315
|
rect == o.rect &&
|
306
316
|
value == o.value &&
|
307
317
|
page_index == o.page_index &&
|
@@ -336,7 +346,7 @@ module AsposePdfCloud
|
|
336
346
|
# Calculates hash code according to all attributes.
|
337
347
|
# @return [Fixnum] Hash code
|
338
348
|
def hash
|
339
|
-
[links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multiline, spell_check, scrollable, force_combs, max_len, barcode].hash
|
349
|
+
[links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multiline, spell_check, scrollable, force_combs, max_len, barcode].hash
|
340
350
|
end
|
341
351
|
|
342
352
|
# Builds the object from hash
|
data/test/pdf_tests.rb
CHANGED
@@ -33,7 +33,6 @@ class PdfTests < Minitest::Test
|
|
33
33
|
def setup
|
34
34
|
# Get App key and App SID from https://aspose.cloud
|
35
35
|
@pdf_api = PdfApi.new('app_key', 'app_sid')
|
36
|
-
|
37
36
|
@temp_folder = 'TempPdfCloud'
|
38
37
|
@test_data_folder = '../test_data/'
|
39
38
|
|
@@ -389,82 +388,121 @@ class PdfTests < Minitest::Test
|
|
389
388
|
end
|
390
389
|
|
391
390
|
def __draw_table
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
391
|
+
colorBlack = Color.new({:A => 0xFF, :R => 0, :G => 0, :B => 0})
|
392
|
+
borderGraphInfo = GraphInfo.new({:Color => colorBlack, :LineWidth => 1})
|
393
|
+
image = 'Penguins.jpg'
|
394
|
+
table = Table.new({
|
395
|
+
:Top => 100,
|
396
|
+
:ColumnWidths => '150 300',
|
397
|
+
:IsBordersIncluded => true,
|
398
|
+
:DefaultCellTextState => TextState.new({:FontSize => 11, :ForegroundColor => Color.new({:A => 255, :R => 0, :G => 255, :B => 0})}),
|
399
|
+
:Margin => MarginInfo.new({
|
400
|
+
:Bottom => 10,
|
401
|
+
:Left => 10,
|
402
|
+
:Right => 10,
|
403
|
+
:Top => 10
|
404
|
+
}),
|
405
|
+
:Border => BorderInfo.new({
|
406
|
+
:Top => borderGraphInfo,
|
407
|
+
:Left => borderGraphInfo
|
408
|
+
}),
|
409
|
+
:DefaultCellBorder => BorderInfo.new({
|
410
|
+
:Right => borderGraphInfo,
|
411
|
+
}),
|
412
|
+
:DefaultCellPadding => MarginInfo.new({
|
413
|
+
:Top => 5,
|
414
|
+
:Left => 5,
|
415
|
+
:Right => 5,
|
416
|
+
:Bottom => 5,
|
417
|
+
}),
|
418
|
+
:Rows => [
|
419
|
+
Row.new({
|
420
|
+
:MinRowHeight => 100,
|
421
|
+
:Border => BorderInfo.new({
|
422
|
+
:Bottom => borderGraphInfo,
|
423
|
+
}),
|
424
|
+
:Cells => [
|
425
|
+
Cell.new({
|
426
|
+
:Paragraphs => [
|
427
|
+
TextRect.new({
|
428
|
+
:Text => 'BackgroundImageStorageFile field, from storage file',
|
429
|
+
:HorizontalAlignment => HorizontalAlignment::CENTER,
|
430
|
+
:TextState => TextState.new({:FontSize => 10, :ForegroundColor => Color.new({:A => 0xff, :R => 0x3d, :G => 0x8e, :B =>0xc4})}),
|
431
|
+
})
|
432
|
+
]
|
433
|
+
}),
|
434
|
+
Cell.new({
|
435
|
+
:BackgroundColor => colorBlack,
|
436
|
+
:BackgroundImageStorageFile => "#{@temp_folder}/#{image}"
|
437
|
+
})
|
438
|
+
]
|
439
|
+
}),
|
440
|
+
Row.new({
|
441
|
+
:MinRowHeight => 100,
|
442
|
+
:Border => BorderInfo.new({:Bottom => borderGraphInfo}),
|
443
|
+
:Cells => [
|
444
|
+
Cell.new({
|
445
|
+
:Paragraphs => [
|
446
|
+
TextRect.new({
|
447
|
+
:Text => 'HtmlFragment',
|
448
|
+
:HorizontalAlignment => HorizontalAlignment::CENTER,
|
449
|
+
:TextState => TextState.new({
|
450
|
+
:FontSize => 10,
|
451
|
+
:ForegroundColor => Color.new({:A => 255, :R => 0x3d, :G => 0x8e, :B => 0xc4}),
|
452
|
+
})
|
453
|
+
})
|
454
|
+
]
|
455
|
+
}),
|
456
|
+
Cell.new({:HtmlFragment => '<ul><li>First</li><li>Second</li></ul>'}),
|
457
|
+
]
|
458
|
+
}),
|
459
|
+
Row.new({
|
460
|
+
:FixedRowHeight => 100,
|
461
|
+
:Border => BorderInfo.new({:Bottom => borderGraphInfo}),
|
462
|
+
:Cells => [
|
463
|
+
Cell.new({
|
464
|
+
:Paragraphs => [
|
465
|
+
TextRect.new({:Text => 'FixedRowHeight = 100'}),
|
466
|
+
TextRect.new({
|
467
|
+
:Text => 'Images field, from storage file, without Margin and Size',
|
468
|
+
:HorizontalAlignment => HorizontalAlignment::CENTER,
|
469
|
+
:TextState => TextState.new({:FontSize => 10, :ForegroundColor => Color.new({:A => 255, :R => 0x3d, :G => 0x8e, :B => 0xc4})}),
|
470
|
+
})
|
471
|
+
]
|
472
|
+
}),
|
473
|
+
Cell.new({
|
474
|
+
:BackgroundColor => colorBlack,
|
475
|
+
:Images => [ImageFragment.new({ImageFile: "#{@temp_folder}/#{image}"})]
|
476
|
+
})
|
477
|
+
]
|
478
|
+
}),
|
479
|
+
Row.new({
|
480
|
+
:FixedRowHeight => 100,
|
481
|
+
:Border => BorderInfo.new({:Bottom => borderGraphInfo}),
|
482
|
+
:Cells => [
|
483
|
+
Cell.new({
|
484
|
+
:Paragraphs => [
|
485
|
+
TextRect.new({:Text => 'FixedRowHeight = 100'}),
|
486
|
+
TextRect.new({
|
487
|
+
:Text => 'Images field, from storage file, with no Margin and Size = 150x50',
|
488
|
+
:HorizontalAlignment => HorizontalAlignment::CENTER,
|
489
|
+
:TextState => TextState.new({:FontSize => 10, :ForegroundColor => Color.new({:A => 255, :R => 0x3d, :G => 0x8e, :B => 0xc4})})
|
490
|
+
})
|
491
|
+
]
|
492
|
+
}),
|
493
|
+
Cell.new({
|
494
|
+
:BackgroundColor => colorBlack,
|
495
|
+
:Images => [
|
496
|
+
ImageFragment.new({
|
497
|
+
:ImageFile => "#{@temp_folder}/#{image}",
|
498
|
+
:ImageScale => 0.1
|
499
|
+
})
|
500
|
+
]
|
501
|
+
})
|
502
|
+
]
|
503
|
+
})
|
504
|
+
]
|
505
|
+
})
|
468
506
|
table
|
469
507
|
end
|
470
508
|
|
@@ -3012,10 +3050,11 @@ class PdfTests < Minitest::Test
|
|
3012
3050
|
def test_put_pdf_in_storage_to_html
|
3013
3051
|
file_name = '4pages.pdf'
|
3014
3052
|
upload_file(file_name)
|
3015
|
-
res_file = '
|
3053
|
+
res_file = 'result_4pages.html'
|
3016
3054
|
|
3017
3055
|
opts = {
|
3018
|
-
:folder => @temp_folder
|
3056
|
+
:folder => @temp_folder,
|
3057
|
+
:output_format => OutputFormat::FOLDER
|
3019
3058
|
}
|
3020
3059
|
response = @pdf_api.put_pdf_in_storage_to_html(file_name, @temp_folder + '/' + res_file, opts)
|
3021
3060
|
assert(response, 'Filed to convert PDF to HTML.')
|
@@ -3106,7 +3145,7 @@ class PdfTests < Minitest::Test
|
|
3106
3145
|
assert(response, 'Filed to convert PDF to PPTX.')
|
3107
3146
|
end
|
3108
3147
|
|
3109
|
-
def
|
3148
|
+
def test_get_pdf_in_storage_to_te_x
|
3110
3149
|
file_name = '4pages.pdf'
|
3111
3150
|
upload_file(file_name)
|
3112
3151
|
|
@@ -3114,33 +3153,33 @@ class PdfTests < Minitest::Test
|
|
3114
3153
|
:folder => @temp_folder
|
3115
3154
|
}
|
3116
3155
|
|
3117
|
-
response = @pdf_api.
|
3118
|
-
assert(response, 'Filed to convert PDF to
|
3156
|
+
response = @pdf_api.get_pdf_in_storage_to_te_x(file_name, opts)
|
3157
|
+
assert(response, 'Filed to convert PDF to Tex.')
|
3119
3158
|
end
|
3120
3159
|
|
3121
|
-
def
|
3160
|
+
def test_put_pdf_in_storage_to_te_x
|
3122
3161
|
file_name = '4pages.pdf'
|
3123
3162
|
upload_file(file_name)
|
3124
|
-
res_file = 'result.
|
3163
|
+
res_file = 'result.tex'
|
3125
3164
|
|
3126
3165
|
opts = {
|
3127
3166
|
:folder => @temp_folder
|
3128
3167
|
}
|
3129
|
-
response = @pdf_api.
|
3130
|
-
assert(response, 'Filed to convert PDF to
|
3168
|
+
response = @pdf_api.put_pdf_in_storage_to_te_x(file_name, @temp_folder + '/' + res_file, opts)
|
3169
|
+
assert(response, 'Filed to convert PDF to TeX.')
|
3131
3170
|
end
|
3132
3171
|
|
3133
3172
|
|
3134
|
-
def
|
3173
|
+
def test_put_pdf_in_request_to_te_x
|
3135
3174
|
file_name = '4pages.pdf'
|
3136
3175
|
|
3137
|
-
res_file = 'result.
|
3176
|
+
res_file = 'result.tex'
|
3138
3177
|
|
3139
3178
|
opts = {
|
3140
3179
|
:file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
|
3141
3180
|
}
|
3142
|
-
response = @pdf_api.
|
3143
|
-
assert(response, 'Filed to convert PDF to
|
3181
|
+
response = @pdf_api.put_pdf_in_request_to_te_x(@temp_folder + '/' + res_file, opts)
|
3182
|
+
assert(response, 'Filed to convert PDF to TeX.')
|
3144
3183
|
end
|
3145
3184
|
|
3146
3185
|
def test_get_pdf_in_storage_to_mobi_xml
|
@@ -3334,16 +3373,16 @@ class PdfTests < Minitest::Test
|
|
3334
3373
|
end
|
3335
3374
|
|
3336
3375
|
|
3337
|
-
def
|
3376
|
+
def test_get_te_x_in_storage_to_pdf
|
3338
3377
|
file_name = 'sample.tex'
|
3339
3378
|
upload_file(file_name)
|
3340
3379
|
|
3341
3380
|
src_path = @temp_folder + '/' + file_name
|
3342
|
-
response = @pdf_api.
|
3343
|
-
assert(response, 'Failed to convert
|
3381
|
+
response = @pdf_api.get_te_x_in_storage_to_pdf(src_path)
|
3382
|
+
assert(response, 'Failed to convert TeX to pdf.')
|
3344
3383
|
end
|
3345
3384
|
|
3346
|
-
def
|
3385
|
+
def test_put_te_x_in_storage_to_pdf
|
3347
3386
|
file_name = 'sample.tex'
|
3348
3387
|
upload_file(file_name)
|
3349
3388
|
result_name = 'fromTex.pdf'
|
@@ -3352,8 +3391,8 @@ class PdfTests < Minitest::Test
|
|
3352
3391
|
opts = {
|
3353
3392
|
:dst_folder => @temp_folder
|
3354
3393
|
}
|
3355
|
-
response = @pdf_api.
|
3356
|
-
assert(response, 'Failed to convert
|
3394
|
+
response = @pdf_api.put_te_x_in_storage_to_pdf(result_name, src_path, opts)
|
3395
|
+
assert(response, 'Failed to convert TeX to pdf.')
|
3357
3396
|
end
|
3358
3397
|
|
3359
3398
|
def test_get_mht_in_storage_to_pdf
|
@@ -3599,6 +3638,28 @@ class PdfTests < Minitest::Test
|
|
3599
3638
|
assert(response, 'Failed to convert markdown to pdf.')
|
3600
3639
|
end
|
3601
3640
|
|
3641
|
+
def test_get_pdf_a_in_storage_to_pdf
|
3642
|
+
file_name = '4pagesPdfA.pdf'
|
3643
|
+
upload_file(file_name)
|
3644
|
+
|
3645
|
+
src_path = @temp_folder + '/' + file_name
|
3646
|
+
response = @pdf_api.get_pdf_a_in_storage_to_pdf(src_path)
|
3647
|
+
assert(response, 'Failed to convert pdfa to pdf.')
|
3648
|
+
end
|
3649
|
+
|
3650
|
+
def test_put_pdf_a_in_storage_to_pdf
|
3651
|
+
file_name = '4pagesPdfA.pdf'
|
3652
|
+
upload_file(file_name)
|
3653
|
+
result_name = 'fromPdfA.pdf'
|
3654
|
+
|
3655
|
+
src_path = @temp_folder + '/' + file_name
|
3656
|
+
opts = {
|
3657
|
+
:dst_folder => @temp_folder
|
3658
|
+
}
|
3659
|
+
response = @pdf_api.put_pdf_a_in_storage_to_pdf(result_name, src_path, opts)
|
3660
|
+
assert(response, 'Failed to convert pdfa to pdf.')
|
3661
|
+
end
|
3662
|
+
|
3602
3663
|
# Document Tests
|
3603
3664
|
|
3604
3665
|
def test_get_document
|
@@ -3862,7 +3923,7 @@ class PdfTests < Minitest::Test
|
|
3862
3923
|
assert(response, 'Failed flatten document.')
|
3863
3924
|
end
|
3864
3925
|
|
3865
|
-
def
|
3926
|
+
def test_get_document_sigignature_fields
|
3866
3927
|
file_name = 'adbe.x509.rsa_sha1.valid.pdf'
|
3867
3928
|
upload_file(file_name)
|
3868
3929
|
|
@@ -3874,7 +3935,7 @@ class PdfTests < Minitest::Test
|
|
3874
3935
|
assert(response, 'Failed to read document signature fields.')
|
3875
3936
|
end
|
3876
3937
|
|
3877
|
-
def
|
3938
|
+
def test_get_page_sigignature_fields
|
3878
3939
|
file_name = 'adbe.x509.rsa_sha1.valid.pdf'
|
3879
3940
|
upload_file(file_name)
|
3880
3941
|
|
@@ -3887,7 +3948,75 @@ class PdfTests < Minitest::Test
|
|
3887
3948
|
assert(response, 'Failed to read page signature fields.')
|
3888
3949
|
end
|
3889
3950
|
|
3890
|
-
def
|
3951
|
+
def test_post_sigignature_field
|
3952
|
+
file_name = '4pages.pdf'
|
3953
|
+
upload_file(file_name)
|
3954
|
+
|
3955
|
+
signature_name = '33226.p12'
|
3956
|
+
upload_file(signature_name)
|
3957
|
+
|
3958
|
+
signature = Signature.new
|
3959
|
+
signature.authority = 'Sergey Smal'
|
3960
|
+
signature.contact = 'test@mail.ru'
|
3961
|
+
signature.date = '08/01/2012 12:15:00.000 PM'
|
3962
|
+
signature.form_field_name = 'Signature1'
|
3963
|
+
signature.location = 'Ukraine'
|
3964
|
+
signature.password = 'sIikZSmz'
|
3965
|
+
signature.rectangle = Rectangle.new({:LLX => 100, :LLY => 100, :URX => 500, :URY => 200})
|
3966
|
+
signature.signature_path = @temp_folder + '/' + signature_name
|
3967
|
+
signature.signature_type = SignatureType::PKCS7
|
3968
|
+
signature.visible = true
|
3969
|
+
signature.show_properties = false
|
3970
|
+
|
3971
|
+
field = SignatureField.new
|
3972
|
+
field.partial_name = 'sign1'
|
3973
|
+
field.rect = Rectangle.new({:LLX => 100, :LLY => 100, :URX => 500, :URY => 200})
|
3974
|
+
field.signature = signature
|
3975
|
+
field.page_index = 1
|
3976
|
+
|
3977
|
+
opts = {
|
3978
|
+
:folder => @temp_folder
|
3979
|
+
}
|
3980
|
+
|
3981
|
+
response = @pdf_api.post_signature_field(file_name, field, opts)
|
3982
|
+
assert(response, 'Failed to create signature field.')
|
3983
|
+
end
|
3984
|
+
|
3985
|
+
def test_put_sigignature_field
|
3986
|
+
file_name = 'adbe.x509.rsa_sha1.valid.pdf'
|
3987
|
+
upload_file(file_name)
|
3988
|
+
|
3989
|
+
signature_name = '33226.p12'
|
3990
|
+
upload_file(signature_name)
|
3991
|
+
|
3992
|
+
signature = Signature.new
|
3993
|
+
signature.authority = 'Sergey Smal'
|
3994
|
+
signature.contact = 'test@mail.ru'
|
3995
|
+
signature.date = '08/01/2012 12:15:00.000 PM'
|
3996
|
+
signature.form_field_name = 'Signature1'
|
3997
|
+
signature.location = 'Ukraine'
|
3998
|
+
signature.password = 'sIikZSmz'
|
3999
|
+
signature.rectangle = Rectangle.new({:LLX => 100, :LLY => 100, :URX => 500, :URY => 200})
|
4000
|
+
signature.signature_path = @temp_folder + '/' + signature_name
|
4001
|
+
signature.signature_type = SignatureType::PKCS7
|
4002
|
+
signature.visible = true
|
4003
|
+
signature.show_properties = false
|
4004
|
+
|
4005
|
+
field = SignatureField.new
|
4006
|
+
field.partial_name = 'sign1'
|
4007
|
+
field.rect = Rectangle.new({:LLX => 100, :LLY => 100, :URX => 500, :URY => 200})
|
4008
|
+
field.signature = signature
|
4009
|
+
field.page_index = 1
|
4010
|
+
|
4011
|
+
opts = {
|
4012
|
+
:folder => @temp_folder
|
4013
|
+
}
|
4014
|
+
|
4015
|
+
response = @pdf_api.put_signature_field(file_name, 'Signature1', field, opts)
|
4016
|
+
assert(response, 'Failed to update signature field.')
|
4017
|
+
end
|
4018
|
+
|
4019
|
+
def test_get_sigignature_field
|
3891
4020
|
file_name = 'adbe.x509.rsa_sha1.valid.pdf'
|
3892
4021
|
upload_file(file_name)
|
3893
4022
|
|
@@ -3900,6 +4029,9 @@ class PdfTests < Minitest::Test
|
|
3900
4029
|
assert(response, 'Failed to read signature field.')
|
3901
4030
|
end
|
3902
4031
|
|
4032
|
+
|
4033
|
+
|
4034
|
+
|
3903
4035
|
def test_get_document_text_box_fields
|
3904
4036
|
file_name = 'FormDataTextBox.pdf'
|
3905
4037
|
upload_file(file_name)
|