aspose_pdf_cloud 20.2.0 → 20.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -13
- data/docs/ApiInfo.md +10 -0
- 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/ImageCompressionVersion.md +12 -0
- data/docs/ImageEncoding.md +13 -0
- data/docs/ImageFragment.md +15 -0
- data/docs/ListBoxField.md +1 -0
- data/docs/OptimizeOptions.md +13 -7
- data/docs/OutputFormat.md +11 -0
- data/docs/Paragraph.md +2 -2
- data/docs/PdfAType.md +3 -2
- data/docs/PdfApi.md +170 -25
- 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/docs/TextState.md +2 -1
- data/lib/aspose_pdf_cloud.rb +5 -0
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +478 -41
- data/lib/aspose_pdf_cloud/api_client.rb +1 -1
- data/lib/aspose_pdf_cloud/models/api_info.rb +209 -0
- 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_compression_version.rb +45 -0
- data/lib/aspose_pdf_cloud/models/image_encoding.rb +46 -0
- 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/optimize_options.rb +60 -35
- data/lib/aspose_pdf_cloud/models/output_format.rb +44 -0
- data/lib/aspose_pdf_cloud/models/paragraph.rb +2 -2
- data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +1 -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/models/text_state.rb +15 -5
- data/lib/aspose_pdf_cloud/version.rb +1 -1
- data/test/pdf_tests.rb +140 -98
- data/test_data/Righteous-Regular.ttf +0 -0
- metadata +13 -2
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
|
@@ -5836,6 +5875,8 @@ class PdfTests < Minitest::Test
|
|
5836
5875
|
def test_put_add_text
|
5837
5876
|
file_name = '4pages.pdf'
|
5838
5877
|
upload_file(file_name)
|
5878
|
+
font_name = 'Righteous-Regular.ttf'
|
5879
|
+
upload_file(font_name)
|
5839
5880
|
|
5840
5881
|
page_number = 1
|
5841
5882
|
|
@@ -5858,11 +5899,12 @@ class PdfTests < Minitest::Test
|
|
5858
5899
|
background_color.b = 0x00
|
5859
5900
|
|
5860
5901
|
text_state = TextState.new
|
5861
|
-
text_state.font = '
|
5902
|
+
text_state.font = 'Righteous'
|
5862
5903
|
text_state.font_size = 10
|
5863
5904
|
text_state.foreground_color = foreground_color
|
5864
5905
|
text_state.background_color = background_color
|
5865
|
-
text_state.font_style = FontStyles::
|
5906
|
+
text_state.font_style = FontStyles::REGULAR
|
5907
|
+
text_state.font_file = @temp_folder + '/' + font_name
|
5866
5908
|
|
5867
5909
|
segment = Segment.new
|
5868
5910
|
segment.value = 'segment 1'
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_pdf_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 20.
|
4
|
+
version: 20.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aspose PDF Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- docs/AnnotationsInfo.md
|
79
79
|
- docs/AnnotationsInfoResponse.md
|
80
80
|
- docs/AntialiasingProcessingType.md
|
81
|
+
- docs/ApiInfo.md
|
81
82
|
- docs/AsposeResponse.md
|
82
83
|
- docs/Attachment.md
|
83
84
|
- docs/AttachmentResponse.md
|
@@ -175,7 +176,10 @@ files:
|
|
175
176
|
- docs/HtmlDocumentType.md
|
176
177
|
- docs/HtmlMarkupGenerationModes.md
|
177
178
|
- docs/Image.md
|
179
|
+
- docs/ImageCompressionVersion.md
|
180
|
+
- docs/ImageEncoding.md
|
178
181
|
- docs/ImageFooter.md
|
182
|
+
- docs/ImageFragment.md
|
179
183
|
- docs/ImageHeader.md
|
180
184
|
- docs/ImageResponse.md
|
181
185
|
- docs/ImageSrcType.md
|
@@ -219,6 +223,7 @@ files:
|
|
219
223
|
- docs/ObjectExist.md
|
220
224
|
- docs/OptimizeOptions.md
|
221
225
|
- docs/Option.md
|
226
|
+
- docs/OutputFormat.md
|
222
227
|
- docs/Page.md
|
223
228
|
- docs/PageLayout.md
|
224
229
|
- docs/PageMode.md
|
@@ -360,6 +365,7 @@ files:
|
|
360
365
|
- lib/aspose_pdf_cloud/models/annotations_info.rb
|
361
366
|
- lib/aspose_pdf_cloud/models/annotations_info_response.rb
|
362
367
|
- lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb
|
368
|
+
- lib/aspose_pdf_cloud/models/api_info.rb
|
363
369
|
- lib/aspose_pdf_cloud/models/aspose_response.rb
|
364
370
|
- lib/aspose_pdf_cloud/models/attachment.rb
|
365
371
|
- lib/aspose_pdf_cloud/models/attachment_response.rb
|
@@ -457,7 +463,10 @@ files:
|
|
457
463
|
- lib/aspose_pdf_cloud/models/html_document_type.rb
|
458
464
|
- lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb
|
459
465
|
- lib/aspose_pdf_cloud/models/image.rb
|
466
|
+
- lib/aspose_pdf_cloud/models/image_compression_version.rb
|
467
|
+
- lib/aspose_pdf_cloud/models/image_encoding.rb
|
460
468
|
- lib/aspose_pdf_cloud/models/image_footer.rb
|
469
|
+
- lib/aspose_pdf_cloud/models/image_fragment.rb
|
461
470
|
- lib/aspose_pdf_cloud/models/image_header.rb
|
462
471
|
- lib/aspose_pdf_cloud/models/image_response.rb
|
463
472
|
- lib/aspose_pdf_cloud/models/image_src_type.rb
|
@@ -501,6 +510,7 @@ files:
|
|
501
510
|
- lib/aspose_pdf_cloud/models/object_exist.rb
|
502
511
|
- lib/aspose_pdf_cloud/models/optimize_options.rb
|
503
512
|
- lib/aspose_pdf_cloud/models/option.rb
|
513
|
+
- lib/aspose_pdf_cloud/models/output_format.rb
|
504
514
|
- lib/aspose_pdf_cloud/models/page.rb
|
505
515
|
- lib/aspose_pdf_cloud/models/page_layout.rb
|
506
516
|
- lib/aspose_pdf_cloud/models/page_mode.rb
|
@@ -664,6 +674,7 @@ files:
|
|
664
674
|
- test_data/PdfWithXfaForm.pdf
|
665
675
|
- test_data/Penguins.emf
|
666
676
|
- test_data/Penguins.jpg
|
677
|
+
- test_data/Righteous-Regular.ttf
|
667
678
|
- test_data/ScreenMovie.swf
|
668
679
|
- test_data/Simple.svg
|
669
680
|
- test_data/Simple.xps
|