aspose_pdf_cloud 24.8.0 → 24.9.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 +4 -6
- data/docs/DocumentLayers.md +9 -0
- data/docs/LayerInfo.md +12 -0
- data/docs/PdfApi.md +83 -0
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +260 -0
- data/lib/aspose_pdf_cloud/models/document_layers.rb +201 -0
- data/lib/aspose_pdf_cloud/models/layer_info.rb +239 -0
- data/lib/aspose_pdf_cloud/version.rb +1 -1
- data/lib/aspose_pdf_cloud.rb +2 -0
- data/test/pdf_tests.rb +42 -0
- data/test_data/PdfWithLayers.pdf +0 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28f24d744fc7c852333e5ffe4d013b99b1ce12577cb91e727b7bd399824f7bd5
|
4
|
+
data.tar.gz: '035608878d88906b3095a096696b6dcd4fe62fe9329c9ee745050c3bdfba9dc4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79a888d3171d173a2f1254f0b9cfbd8a5a52a840c86edd67b473b7da7fd58aa717d2968ac2141dbe731be6e13dce4ccc1ab058478659975c6faa932aa8a298cd
|
7
|
+
data.tar.gz: 19f75b669468f764865488a7163cac576175fa7d5d6fc61f6fe38897ead797d70a98afdbdef5f8825769fe5c54ec60ab86d2775e2b4aa3603ab2062370493055
|
data/README.md
CHANGED
@@ -29,9 +29,7 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
|
|
29
29
|
## Read PDF Formats
|
30
30
|
MHT, PCL, PS, XSLFO, MD
|
31
31
|
|
32
|
-
## Enhancements in Version 24.
|
33
|
-
- Adding Text stamps to multiple pages.
|
34
|
-
- Adding Image stamps to multiple pages.
|
32
|
+
## Enhancements in Version 24.9
|
35
33
|
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
|
36
34
|
|
37
35
|
## Installation
|
@@ -47,15 +45,15 @@ gem build aspose_pdf_cloud.gemspec
|
|
47
45
|
Then either install the gem locally:
|
48
46
|
|
49
47
|
```shell
|
50
|
-
gem install ./aspose_pdf_cloud-24.
|
48
|
+
gem install ./aspose_pdf_cloud-24.9.0.gem
|
51
49
|
```
|
52
|
-
(for development, run `gem install --dev ./aspose_pdf_cloud-24.
|
50
|
+
(for development, run `gem install --dev ./aspose_pdf_cloud-24.9.0.gem` to install the development dependencies)
|
53
51
|
|
54
52
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
55
53
|
|
56
54
|
Finally add this to the Gemfile:
|
57
55
|
|
58
|
-
gem 'aspose_pdf_cloud', '~> 24.
|
56
|
+
gem 'aspose_pdf_cloud', '~> 24.9.0'
|
59
57
|
|
60
58
|
### Install from Git
|
61
59
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# AsposePdfCloud::DocumentLayers
|
2
|
+
DocumentLayers response class.
|
3
|
+
|
4
|
+
## Properties
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**layers** | [**Array<LayerInfo>**](LayerInfo.md) | List of document Layers. | [optional]
|
8
|
+
|
9
|
+
|
data/docs/LayerInfo.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# AsposePdfCloud::LayerInfo
|
2
|
+
|
3
|
+
|
4
|
+
## Properties
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**page_number** | **Integer** | Layer Page Number. |
|
8
|
+
**id** | **String** | Layer Id. | [optional]
|
9
|
+
**name** | **String** | Layer Name. | [optional]
|
10
|
+
**locked** | **BOOLEAN** | Gets a value indicating whether the layer is locked. |
|
11
|
+
|
12
|
+
|
data/docs/PdfApi.md
CHANGED
@@ -11,6 +11,7 @@ Method | HTTP request | Description
|
|
11
11
|
[**delete_bookmark**](PdfApi.md#delete_bookmark) | **DELETE** /pdf/\{name}/bookmarks/bookmark/\{bookmarkPath} | Delete document bookmark by ID.
|
12
12
|
[**delete_document_annotations**](PdfApi.md#delete_document_annotations) | **DELETE** /pdf/\{name}/annotations | Delete all annotations from the document
|
13
13
|
[**delete_document_bookmarks**](PdfApi.md#delete_document_bookmarks) | **DELETE** /pdf/\{name}/bookmarks/tree | Delete all document bookmarks.
|
14
|
+
[**delete_document_layer**](PdfApi.md#delete_document_layer) | **DELETE** /pdf/\{name}/layers | Remove document layer.
|
14
15
|
[**delete_document_link_annotations**](PdfApi.md#delete_document_link_annotations) | **DELETE** /pdf/\{name}/links | Delete all link annotations from the document
|
15
16
|
[**delete_document_stamps**](PdfApi.md#delete_document_stamps) | **DELETE** /pdf/\{name}/stamps | Delete all stamps from the document
|
16
17
|
[**delete_document_tables**](PdfApi.md#delete_document_tables) | **DELETE** /pdf/\{name}/tables | Delete all tables from the document
|
@@ -50,6 +51,7 @@ Method | HTTP request | Description
|
|
50
51
|
[**get_document_free_text_annotations**](PdfApi.md#get_document_free_text_annotations) | **GET** /pdf/\{name}/annotations/freetext | Read document free text annotations.
|
51
52
|
[**get_document_highlight_annotations**](PdfApi.md#get_document_highlight_annotations) | **GET** /pdf/\{name}/annotations/highlight | Read document highlight annotations.
|
52
53
|
[**get_document_ink_annotations**](PdfApi.md#get_document_ink_annotations) | **GET** /pdf/\{name}/annotations/ink | Read document ink annotations.
|
54
|
+
[**get_document_layers**](PdfApi.md#get_document_layers) | **GET** /pdf/\{name}/layers | Gets document layers.
|
53
55
|
[**get_document_line_annotations**](PdfApi.md#get_document_line_annotations) | **GET** /pdf/\{name}/annotations/line | Read document line annotations.
|
54
56
|
[**get_document_list_box_fields**](PdfApi.md#get_document_list_box_fields) | **GET** /pdf/\{name}/fields/listbox | Read document listbox fields.
|
55
57
|
[**get_document_movie_annotations**](PdfApi.md#get_document_movie_annotations) | **GET** /pdf/\{name}/annotations/movie | Read document movie annotations.
|
@@ -266,6 +268,7 @@ Method | HTTP request | Description
|
|
266
268
|
[**put_circle_annotation**](PdfApi.md#put_circle_annotation) | **PUT** /pdf/\{name}/annotations/circle/\{annotationId} | Replace document circle annotation
|
267
269
|
[**put_combo_box_field**](PdfApi.md#put_combo_box_field) | **PUT** /pdf/\{name}/fields/combobox/\{fieldName} | Replace document combobox field
|
268
270
|
[**put_create_document**](PdfApi.md#put_create_document) | **PUT** /pdf/\{name} | Create empty document.
|
271
|
+
[**put_create_pdf_from_layer**](PdfApi.md#put_create_pdf_from_layer) | **PUT** /pdf/\{name}/layers | Create a separate PDF from a PDF Layer and upload resulting file to storage.
|
269
272
|
[**put_decrypt_document**](PdfApi.md#put_decrypt_document) | **PUT** /pdf/decrypt | Decrypt document from content.
|
270
273
|
[**put_document_display_properties**](PdfApi.md#put_document_display_properties) | **PUT** /pdf/\{name}/displayproperties | Update document display properties.
|
271
274
|
[**put_encrypt_document**](PdfApi.md#put_encrypt_document) | **PUT** /pdf/encrypt | Encrypt document from content.
|
@@ -547,6 +550,33 @@ Name | Type | Description | Notes
|
|
547
550
|
|
548
551
|
|
549
552
|
|
553
|
+
# **delete_document_layer**
|
554
|
+
> AsposeResponse delete_document_layer(name, page_number, layer_id, opts)
|
555
|
+
|
556
|
+
Remove document layer.
|
557
|
+
|
558
|
+
### Parameters
|
559
|
+
|
560
|
+
Name | Type | Description | Notes
|
561
|
+
------------- | ------------- | ------------- | -------------
|
562
|
+
**name** | **String**| The document name. |
|
563
|
+
**page_number** | **Integer**| Layer page. |
|
564
|
+
**layer_id** | **String**| Layer Id. |
|
565
|
+
**folder** | **String**| The document folder. | [optional]
|
566
|
+
**storage** | **String**| The document storage. | [optional]
|
567
|
+
**pass_base64** | **String**| The password (Base64). | [optional]
|
568
|
+
|
569
|
+
### Return type
|
570
|
+
|
571
|
+
[**AsposeResponse**](AsposeResponse.md)
|
572
|
+
|
573
|
+
### HTTP request headers
|
574
|
+
|
575
|
+
- **Content-Type**: application/json
|
576
|
+
- **Accept**: application/json
|
577
|
+
|
578
|
+
|
579
|
+
|
550
580
|
# **delete_document_link_annotations**
|
551
581
|
> AsposeResponse delete_document_link_annotations(name, opts)
|
552
582
|
|
@@ -1508,6 +1538,31 @@ Name | Type | Description | Notes
|
|
1508
1538
|
|
1509
1539
|
|
1510
1540
|
|
1541
|
+
# **get_document_layers**
|
1542
|
+
> DocumentLayers get_document_layers(name, opts)
|
1543
|
+
|
1544
|
+
Gets document layers.
|
1545
|
+
|
1546
|
+
### Parameters
|
1547
|
+
|
1548
|
+
Name | Type | Description | Notes
|
1549
|
+
------------- | ------------- | ------------- | -------------
|
1550
|
+
**name** | **String**| The document name. |
|
1551
|
+
**folder** | **String**| The document folder. | [optional]
|
1552
|
+
**storage** | **String**| The document storage. | [optional]
|
1553
|
+
**pass_base64** | **String**| The password (Base64). | [optional]
|
1554
|
+
|
1555
|
+
### Return type
|
1556
|
+
|
1557
|
+
[**DocumentLayers**](DocumentLayers.md)
|
1558
|
+
|
1559
|
+
### HTTP request headers
|
1560
|
+
|
1561
|
+
- **Content-Type**: application/json
|
1562
|
+
- **Accept**: application/json
|
1563
|
+
|
1564
|
+
|
1565
|
+
|
1511
1566
|
# **get_document_line_annotations**
|
1512
1567
|
> LineAnnotationsResponse get_document_line_annotations(name, opts)
|
1513
1568
|
|
@@ -7059,6 +7114,34 @@ Name | Type | Description | Notes
|
|
7059
7114
|
|
7060
7115
|
|
7061
7116
|
|
7117
|
+
# **put_create_pdf_from_layer**
|
7118
|
+
> AsposeResponse put_create_pdf_from_layer(name, page_number, out_path, layer_id, opts)
|
7119
|
+
|
7120
|
+
Create a separate PDF from a PDF Layer and upload resulting file to storage.
|
7121
|
+
|
7122
|
+
### Parameters
|
7123
|
+
|
7124
|
+
Name | Type | Description | Notes
|
7125
|
+
------------- | ------------- | ------------- | -------------
|
7126
|
+
**name** | **String**| The document name. |
|
7127
|
+
**page_number** | **Integer**| The page number. |
|
7128
|
+
**out_path** | **String**| The out path of result image. |
|
7129
|
+
**layer_id** | **String**| Layer Id. |
|
7130
|
+
**folder** | **String**| The document folder. | [optional]
|
7131
|
+
**storage** | **String**| The document storage. | [optional]
|
7132
|
+
**pass_base64** | **String**| The password (Base64). | [optional]
|
7133
|
+
|
7134
|
+
### Return type
|
7135
|
+
|
7136
|
+
[**AsposeResponse**](AsposeResponse.md)
|
7137
|
+
|
7138
|
+
### HTTP request headers
|
7139
|
+
|
7140
|
+
- **Content-Type**: application/json
|
7141
|
+
- **Accept**: application/json
|
7142
|
+
|
7143
|
+
|
7144
|
+
|
7062
7145
|
# **put_decrypt_document**
|
7063
7146
|
> AsposeResponse put_decrypt_document(out_path, password, opts)
|
7064
7147
|
|
@@ -573,6 +573,95 @@ module AsposePdfCloud
|
|
573
573
|
return data, status_code, headers
|
574
574
|
end
|
575
575
|
|
576
|
+
# Remove document layer.
|
577
|
+
#
|
578
|
+
# @param name The document name.
|
579
|
+
# @param page_number Layer page.
|
580
|
+
# @param layer_id Layer Id.
|
581
|
+
# @param [Hash] opts the optional parameters
|
582
|
+
# @option opts [String] :folder The document folder.
|
583
|
+
# @option opts [String] :storage The document storage.
|
584
|
+
# @option opts [String] :pass_base64 The password (Base64).
|
585
|
+
# @return [AsposeResponse]
|
586
|
+
def delete_document_layer(name, page_number, layer_id, opts = {})
|
587
|
+
@api_client.request_token_if_needed
|
588
|
+
data, _status_code, _headers = delete_document_layer_with_http_info(name, page_number, layer_id, opts)
|
589
|
+
rescue ApiError => error
|
590
|
+
if error.code == 401
|
591
|
+
@api_client.request_token_if_needed
|
592
|
+
data, _status_code, _headers = delete_document_layer_with_http_info(name, page_number, layer_id, opts)
|
593
|
+
else
|
594
|
+
raise
|
595
|
+
end
|
596
|
+
return data
|
597
|
+
end
|
598
|
+
|
599
|
+
# Remove document layer.
|
600
|
+
#
|
601
|
+
# @param name The document name.
|
602
|
+
# @param page_number Layer page.
|
603
|
+
# @param layer_id Layer Id.
|
604
|
+
# @param [Hash] opts the optional parameters
|
605
|
+
# @option opts [String] :folder The document folder.
|
606
|
+
# @option opts [String] :storage The document storage.
|
607
|
+
# @option opts [String] :pass_base64 The password (Base64).
|
608
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
609
|
+
def delete_document_layer_with_http_info(name, page_number, layer_id, opts = {})
|
610
|
+
if @api_client.config.debugging
|
611
|
+
@api_client.config.logger.debug "Calling API: PdfApi.delete_document_layer ..."
|
612
|
+
end
|
613
|
+
# verify the required parameter 'name' is set
|
614
|
+
if @api_client.config.client_side_validation && name.nil?
|
615
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.delete_document_layer"
|
616
|
+
end
|
617
|
+
# verify the required parameter 'page_number' is set
|
618
|
+
if @api_client.config.client_side_validation && page_number.nil?
|
619
|
+
fail ArgumentError, "Missing the required parameter 'page_number' when calling PdfApi.delete_document_layer"
|
620
|
+
end
|
621
|
+
# verify the required parameter 'layer_id' is set
|
622
|
+
if @api_client.config.client_side_validation && layer_id.nil?
|
623
|
+
fail ArgumentError, "Missing the required parameter 'layer_id' when calling PdfApi.delete_document_layer"
|
624
|
+
end
|
625
|
+
# resource path
|
626
|
+
local_var_path = "/pdf/{name}/layers".sub('{' + 'name' + '}', name.to_s)
|
627
|
+
|
628
|
+
# query parameters
|
629
|
+
query_params = {}
|
630
|
+
query_params[:'pageNumber'] = page_number
|
631
|
+
query_params[:'layerId'] = layer_id
|
632
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
633
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
634
|
+
query_params[:'passBase64'] = opts[:'pass_base64'] if !opts[:'pass_base64'].nil?
|
635
|
+
|
636
|
+
# header parameters
|
637
|
+
header_params = {}
|
638
|
+
# HTTP header 'Accept' (if needed)
|
639
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
640
|
+
# HTTP header 'Content-Type'
|
641
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
642
|
+
|
643
|
+
# form parameters
|
644
|
+
form_params = {}
|
645
|
+
# Fix header in file
|
646
|
+
post_body = nil
|
647
|
+
|
648
|
+
# http body (model)
|
649
|
+
# Fix header in file
|
650
|
+
# post_body = nil
|
651
|
+
auth_names = ['JWT']
|
652
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
653
|
+
:header_params => header_params,
|
654
|
+
:query_params => query_params,
|
655
|
+
:form_params => form_params,
|
656
|
+
:body => post_body,
|
657
|
+
:auth_names => auth_names,
|
658
|
+
:return_type => 'AsposeResponse')
|
659
|
+
if @api_client.config.debugging
|
660
|
+
@api_client.config.logger.debug "API called: PdfApi#delete_document_layer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
661
|
+
end
|
662
|
+
return data, status_code, headers
|
663
|
+
end
|
664
|
+
|
576
665
|
# Delete all link annotations from the document
|
577
666
|
#
|
578
667
|
# @param name The document name.
|
@@ -3505,6 +3594,81 @@ module AsposePdfCloud
|
|
3505
3594
|
return data, status_code, headers
|
3506
3595
|
end
|
3507
3596
|
|
3597
|
+
# Gets document layers.
|
3598
|
+
#
|
3599
|
+
# @param name The document name.
|
3600
|
+
# @param [Hash] opts the optional parameters
|
3601
|
+
# @option opts [String] :folder The document folder.
|
3602
|
+
# @option opts [String] :storage The document storage.
|
3603
|
+
# @option opts [String] :pass_base64 The password (Base64).
|
3604
|
+
# @return [DocumentLayers]
|
3605
|
+
def get_document_layers(name, opts = {})
|
3606
|
+
@api_client.request_token_if_needed
|
3607
|
+
data, _status_code, _headers = get_document_layers_with_http_info(name, opts)
|
3608
|
+
rescue ApiError => error
|
3609
|
+
if error.code == 401
|
3610
|
+
@api_client.request_token_if_needed
|
3611
|
+
data, _status_code, _headers = get_document_layers_with_http_info(name, opts)
|
3612
|
+
else
|
3613
|
+
raise
|
3614
|
+
end
|
3615
|
+
return data
|
3616
|
+
end
|
3617
|
+
|
3618
|
+
# Gets document layers.
|
3619
|
+
#
|
3620
|
+
# @param name The document name.
|
3621
|
+
# @param [Hash] opts the optional parameters
|
3622
|
+
# @option opts [String] :folder The document folder.
|
3623
|
+
# @option opts [String] :storage The document storage.
|
3624
|
+
# @option opts [String] :pass_base64 The password (Base64).
|
3625
|
+
# @return [Array<(DocumentLayers, Fixnum, Hash)>] DocumentLayers data, response status code and response headers
|
3626
|
+
def get_document_layers_with_http_info(name, opts = {})
|
3627
|
+
if @api_client.config.debugging
|
3628
|
+
@api_client.config.logger.debug "Calling API: PdfApi.get_document_layers ..."
|
3629
|
+
end
|
3630
|
+
# verify the required parameter 'name' is set
|
3631
|
+
if @api_client.config.client_side_validation && name.nil?
|
3632
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.get_document_layers"
|
3633
|
+
end
|
3634
|
+
# resource path
|
3635
|
+
local_var_path = "/pdf/{name}/layers".sub('{' + 'name' + '}', name.to_s)
|
3636
|
+
|
3637
|
+
# query parameters
|
3638
|
+
query_params = {}
|
3639
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
3640
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
3641
|
+
query_params[:'passBase64'] = opts[:'pass_base64'] if !opts[:'pass_base64'].nil?
|
3642
|
+
|
3643
|
+
# header parameters
|
3644
|
+
header_params = {}
|
3645
|
+
# HTTP header 'Accept' (if needed)
|
3646
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
3647
|
+
# HTTP header 'Content-Type'
|
3648
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
3649
|
+
|
3650
|
+
# form parameters
|
3651
|
+
form_params = {}
|
3652
|
+
# Fix header in file
|
3653
|
+
post_body = nil
|
3654
|
+
|
3655
|
+
# http body (model)
|
3656
|
+
# Fix header in file
|
3657
|
+
# post_body = nil
|
3658
|
+
auth_names = ['JWT']
|
3659
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
3660
|
+
:header_params => header_params,
|
3661
|
+
:query_params => query_params,
|
3662
|
+
:form_params => form_params,
|
3663
|
+
:body => post_body,
|
3664
|
+
:auth_names => auth_names,
|
3665
|
+
:return_type => 'DocumentLayers')
|
3666
|
+
if @api_client.config.debugging
|
3667
|
+
@api_client.config.logger.debug "API called: PdfApi#get_document_layers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
3668
|
+
end
|
3669
|
+
return data, status_code, headers
|
3670
|
+
end
|
3671
|
+
|
3508
3672
|
# Read document line annotations.
|
3509
3673
|
#
|
3510
3674
|
# @param name The document name.
|
@@ -20834,6 +20998,102 @@ module AsposePdfCloud
|
|
20834
20998
|
return data, status_code, headers
|
20835
20999
|
end
|
20836
21000
|
|
21001
|
+
# Create a separate PDF from a PDF Layer and upload resulting file to storage.
|
21002
|
+
#
|
21003
|
+
# @param name The document name.
|
21004
|
+
# @param page_number The page number.
|
21005
|
+
# @param out_path The out path of result image.
|
21006
|
+
# @param layer_id Layer Id.
|
21007
|
+
# @param [Hash] opts the optional parameters
|
21008
|
+
# @option opts [String] :folder The document folder.
|
21009
|
+
# @option opts [String] :storage The document storage.
|
21010
|
+
# @option opts [String] :pass_base64 The password (Base64).
|
21011
|
+
# @return [AsposeResponse]
|
21012
|
+
def put_create_pdf_from_layer(name, page_number, out_path, layer_id, opts = {})
|
21013
|
+
@api_client.request_token_if_needed
|
21014
|
+
data, _status_code, _headers = put_create_pdf_from_layer_with_http_info(name, page_number, out_path, layer_id, opts)
|
21015
|
+
rescue ApiError => error
|
21016
|
+
if error.code == 401
|
21017
|
+
@api_client.request_token_if_needed
|
21018
|
+
data, _status_code, _headers = put_create_pdf_from_layer_with_http_info(name, page_number, out_path, layer_id, opts)
|
21019
|
+
else
|
21020
|
+
raise
|
21021
|
+
end
|
21022
|
+
return data
|
21023
|
+
end
|
21024
|
+
|
21025
|
+
# Create a separate PDF from a PDF Layer and upload resulting file to storage.
|
21026
|
+
#
|
21027
|
+
# @param name The document name.
|
21028
|
+
# @param page_number The page number.
|
21029
|
+
# @param out_path The out path of result image.
|
21030
|
+
# @param layer_id Layer Id.
|
21031
|
+
# @param [Hash] opts the optional parameters
|
21032
|
+
# @option opts [String] :folder The document folder.
|
21033
|
+
# @option opts [String] :storage The document storage.
|
21034
|
+
# @option opts [String] :pass_base64 The password (Base64).
|
21035
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
21036
|
+
def put_create_pdf_from_layer_with_http_info(name, page_number, out_path, layer_id, opts = {})
|
21037
|
+
if @api_client.config.debugging
|
21038
|
+
@api_client.config.logger.debug "Calling API: PdfApi.put_create_pdf_from_layer ..."
|
21039
|
+
end
|
21040
|
+
# verify the required parameter 'name' is set
|
21041
|
+
if @api_client.config.client_side_validation && name.nil?
|
21042
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.put_create_pdf_from_layer"
|
21043
|
+
end
|
21044
|
+
# verify the required parameter 'page_number' is set
|
21045
|
+
if @api_client.config.client_side_validation && page_number.nil?
|
21046
|
+
fail ArgumentError, "Missing the required parameter 'page_number' when calling PdfApi.put_create_pdf_from_layer"
|
21047
|
+
end
|
21048
|
+
# verify the required parameter 'out_path' is set
|
21049
|
+
if @api_client.config.client_side_validation && out_path.nil?
|
21050
|
+
fail ArgumentError, "Missing the required parameter 'out_path' when calling PdfApi.put_create_pdf_from_layer"
|
21051
|
+
end
|
21052
|
+
# verify the required parameter 'layer_id' is set
|
21053
|
+
if @api_client.config.client_side_validation && layer_id.nil?
|
21054
|
+
fail ArgumentError, "Missing the required parameter 'layer_id' when calling PdfApi.put_create_pdf_from_layer"
|
21055
|
+
end
|
21056
|
+
# resource path
|
21057
|
+
local_var_path = "/pdf/{name}/layers".sub('{' + 'name' + '}', name.to_s)
|
21058
|
+
|
21059
|
+
# query parameters
|
21060
|
+
query_params = {}
|
21061
|
+
query_params[:'pageNumber'] = page_number
|
21062
|
+
query_params[:'outPath'] = out_path
|
21063
|
+
query_params[:'layerId'] = layer_id
|
21064
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
21065
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
21066
|
+
query_params[:'passBase64'] = opts[:'pass_base64'] if !opts[:'pass_base64'].nil?
|
21067
|
+
|
21068
|
+
# header parameters
|
21069
|
+
header_params = {}
|
21070
|
+
# HTTP header 'Accept' (if needed)
|
21071
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
21072
|
+
# HTTP header 'Content-Type'
|
21073
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
21074
|
+
|
21075
|
+
# form parameters
|
21076
|
+
form_params = {}
|
21077
|
+
# Fix header in file
|
21078
|
+
post_body = nil
|
21079
|
+
|
21080
|
+
# http body (model)
|
21081
|
+
# Fix header in file
|
21082
|
+
# post_body = nil
|
21083
|
+
auth_names = ['JWT']
|
21084
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
21085
|
+
:header_params => header_params,
|
21086
|
+
:query_params => query_params,
|
21087
|
+
:form_params => form_params,
|
21088
|
+
:body => post_body,
|
21089
|
+
:auth_names => auth_names,
|
21090
|
+
:return_type => 'AsposeResponse')
|
21091
|
+
if @api_client.config.debugging
|
21092
|
+
@api_client.config.logger.debug "API called: PdfApi#put_create_pdf_from_layer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
21093
|
+
end
|
21094
|
+
return data, status_code, headers
|
21095
|
+
end
|
21096
|
+
|
20837
21097
|
# Decrypt document from content.
|
20838
21098
|
#
|
20839
21099
|
# @param out_path Full resulting filename (ex. /folder1/folder2/result.doc)
|
@@ -0,0 +1,201 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2024 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
|
+
# DocumentLayers response class.
|
27
|
+
class DocumentLayers
|
28
|
+
# List of document Layers.
|
29
|
+
attr_accessor :layers
|
30
|
+
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'layers' => :'Layers'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
:'layers' => :'Array<LayerInfo>'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
return unless attributes.is_a?(Hash)
|
50
|
+
|
51
|
+
# convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
53
|
+
|
54
|
+
if attributes.has_key?(:'Layers')
|
55
|
+
if (value = attributes[:'Layers']).is_a?(Array)
|
56
|
+
self.layers = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properies with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
return invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
return true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
layers == o.layers
|
81
|
+
end
|
82
|
+
|
83
|
+
# @see the `==` method
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def eql?(o)
|
86
|
+
self == o
|
87
|
+
end
|
88
|
+
|
89
|
+
# Calculates hash code according to all attributes.
|
90
|
+
# @return [Fixnum] Hash code
|
91
|
+
def hash
|
92
|
+
[layers].hash
|
93
|
+
end
|
94
|
+
|
95
|
+
# Builds the object from hash
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
# @return [Object] Returns the model itself
|
98
|
+
def build_from_hash(attributes)
|
99
|
+
return nil unless attributes.is_a?(Hash)
|
100
|
+
self.class.swagger_types.each_pair do |key, type|
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
102
|
+
# check to ensure the input is an array given that the the attribute
|
103
|
+
# is documented as an array but the input is not
|
104
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
105
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
109
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
110
|
+
end
|
111
|
+
|
112
|
+
self
|
113
|
+
end
|
114
|
+
|
115
|
+
# Deserializes the data based on type
|
116
|
+
# @param string type Data type
|
117
|
+
# @param string value Value to be deserialized
|
118
|
+
# @return [Object] Deserialized data
|
119
|
+
def _deserialize(type, value)
|
120
|
+
case type.to_sym
|
121
|
+
when :DateTime
|
122
|
+
DateTime.parse(value)
|
123
|
+
when :Date
|
124
|
+
Date.parse(value)
|
125
|
+
when :String
|
126
|
+
value.to_s
|
127
|
+
when :Integer
|
128
|
+
value.to_i
|
129
|
+
when :Float
|
130
|
+
value.to_f
|
131
|
+
when :BOOLEAN
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
133
|
+
true
|
134
|
+
else
|
135
|
+
false
|
136
|
+
end
|
137
|
+
when :Object
|
138
|
+
# generic object (usually a Hash), return directly
|
139
|
+
value
|
140
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
141
|
+
inner_type = Regexp.last_match[:inner_type]
|
142
|
+
value.map { |v| _deserialize(inner_type, v) }
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
144
|
+
k_type = Regexp.last_match[:k_type]
|
145
|
+
v_type = Regexp.last_match[:v_type]
|
146
|
+
{}.tap do |hash|
|
147
|
+
value.each do |k, v|
|
148
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
else # model
|
152
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
153
|
+
temp_model.build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_hash
|
172
|
+
hash = {}
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
174
|
+
value = self.send(attr)
|
175
|
+
next if value.nil?
|
176
|
+
hash[param] = _to_hash(value)
|
177
|
+
end
|
178
|
+
hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Outputs non-array value in the form of hash
|
182
|
+
# For object, use to_hash. Otherwise, just return the value
|
183
|
+
# @param [Object] value Any valid value
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
185
|
+
def _to_hash(value)
|
186
|
+
if value.is_a?(Array)
|
187
|
+
value.compact.map{ |v| _to_hash(v) }
|
188
|
+
elsif value.is_a?(Hash)
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
191
|
+
end
|
192
|
+
elsif value.respond_to? :to_hash
|
193
|
+
value.to_hash
|
194
|
+
else
|
195
|
+
value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
@@ -0,0 +1,239 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2024 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
|
+
|
27
|
+
class LayerInfo
|
28
|
+
# Layer Page Number.
|
29
|
+
attr_accessor :page_number
|
30
|
+
|
31
|
+
# Layer Id.
|
32
|
+
attr_accessor :id
|
33
|
+
|
34
|
+
# Layer Name.
|
35
|
+
attr_accessor :name
|
36
|
+
|
37
|
+
# Gets a value indicating whether the layer is locked.
|
38
|
+
attr_accessor :locked
|
39
|
+
|
40
|
+
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
42
|
+
def self.attribute_map
|
43
|
+
{
|
44
|
+
:'page_number' => :'PageNumber',
|
45
|
+
:'id' => :'Id',
|
46
|
+
:'name' => :'Name',
|
47
|
+
:'locked' => :'Locked'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
def self.swagger_types
|
53
|
+
{
|
54
|
+
:'page_number' => :'Integer',
|
55
|
+
:'id' => :'String',
|
56
|
+
:'name' => :'String',
|
57
|
+
:'locked' => :'BOOLEAN'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
return unless attributes.is_a?(Hash)
|
65
|
+
|
66
|
+
# convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
68
|
+
|
69
|
+
if attributes.has_key?(:'PageNumber')
|
70
|
+
self.page_number = attributes[:'PageNumber']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'Id')
|
74
|
+
self.id = attributes[:'Id']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'Name')
|
78
|
+
self.name = attributes[:'Name']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'Locked')
|
82
|
+
self.locked = attributes[:'Locked']
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properies with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
if @page_number.nil?
|
92
|
+
invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
|
93
|
+
end
|
94
|
+
|
95
|
+
if @locked.nil?
|
96
|
+
invalid_properties.push("invalid value for 'locked', locked cannot be nil.")
|
97
|
+
end
|
98
|
+
|
99
|
+
return invalid_properties
|
100
|
+
end
|
101
|
+
|
102
|
+
# Check to see if the all the properties in the model are valid
|
103
|
+
# @return true if the model is valid
|
104
|
+
def valid?
|
105
|
+
return false if @page_number.nil?
|
106
|
+
return false if @locked.nil?
|
107
|
+
return true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
page_number == o.page_number &&
|
116
|
+
id == o.id &&
|
117
|
+
name == o.name &&
|
118
|
+
locked == o.locked
|
119
|
+
end
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def eql?(o)
|
124
|
+
self == o
|
125
|
+
end
|
126
|
+
|
127
|
+
# Calculates hash code according to all attributes.
|
128
|
+
# @return [Fixnum] Hash code
|
129
|
+
def hash
|
130
|
+
[page_number, id, name, locked].hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
self.class.swagger_types.each_pair do |key, type|
|
139
|
+
if type =~ /\AArray<(.*)>/i
|
140
|
+
# check to ensure the input is an array given that the the attribute
|
141
|
+
# is documented as an array but the input is not
|
142
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
143
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
144
|
+
end
|
145
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
146
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
147
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
148
|
+
end
|
149
|
+
|
150
|
+
self
|
151
|
+
end
|
152
|
+
|
153
|
+
# Deserializes the data based on type
|
154
|
+
# @param string type Data type
|
155
|
+
# @param string value Value to be deserialized
|
156
|
+
# @return [Object] Deserialized data
|
157
|
+
def _deserialize(type, value)
|
158
|
+
case type.to_sym
|
159
|
+
when :DateTime
|
160
|
+
DateTime.parse(value)
|
161
|
+
when :Date
|
162
|
+
Date.parse(value)
|
163
|
+
when :String
|
164
|
+
value.to_s
|
165
|
+
when :Integer
|
166
|
+
value.to_i
|
167
|
+
when :Float
|
168
|
+
value.to_f
|
169
|
+
when :BOOLEAN
|
170
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
171
|
+
true
|
172
|
+
else
|
173
|
+
false
|
174
|
+
end
|
175
|
+
when :Object
|
176
|
+
# generic object (usually a Hash), return directly
|
177
|
+
value
|
178
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
179
|
+
inner_type = Regexp.last_match[:inner_type]
|
180
|
+
value.map { |v| _deserialize(inner_type, v) }
|
181
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
182
|
+
k_type = Regexp.last_match[:k_type]
|
183
|
+
v_type = Regexp.last_match[:v_type]
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each do |k, v|
|
186
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
else # model
|
190
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
191
|
+
temp_model.build_from_hash(value)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the string representation of the object
|
196
|
+
# @return [String] String presentation of the object
|
197
|
+
def to_s
|
198
|
+
to_hash.to_s
|
199
|
+
end
|
200
|
+
|
201
|
+
# to_body is an alias to to_hash (backward compatibility)
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_body
|
204
|
+
to_hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the object in the form of hash
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_hash
|
210
|
+
hash = {}
|
211
|
+
self.class.attribute_map.each_pair do |attr, param|
|
212
|
+
value = self.send(attr)
|
213
|
+
next if value.nil?
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map{ |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
data/lib/aspose_pdf_cloud.rb
CHANGED
@@ -56,6 +56,7 @@ require_relative 'aspose_pdf_cloud/models/doc_format'
|
|
56
56
|
require_relative 'aspose_pdf_cloud/models/doc_mdp_access_permission_type'
|
57
57
|
require_relative 'aspose_pdf_cloud/models/doc_recognition_mode'
|
58
58
|
require_relative 'aspose_pdf_cloud/models/document_config'
|
59
|
+
require_relative 'aspose_pdf_cloud/models/document_layers'
|
59
60
|
require_relative 'aspose_pdf_cloud/models/document_privilege'
|
60
61
|
require_relative 'aspose_pdf_cloud/models/epub_recognition_mode'
|
61
62
|
require_relative 'aspose_pdf_cloud/models/error'
|
@@ -80,6 +81,7 @@ require_relative 'aspose_pdf_cloud/models/image_src_type'
|
|
80
81
|
require_relative 'aspose_pdf_cloud/models/image_template'
|
81
82
|
require_relative 'aspose_pdf_cloud/models/image_templates_request'
|
82
83
|
require_relative 'aspose_pdf_cloud/models/justification'
|
84
|
+
require_relative 'aspose_pdf_cloud/models/layer_info'
|
83
85
|
require_relative 'aspose_pdf_cloud/models/letters_positioning_methods'
|
84
86
|
require_relative 'aspose_pdf_cloud/models/line_ending'
|
85
87
|
require_relative 'aspose_pdf_cloud/models/line_intent'
|
data/test/pdf_tests.rb
CHANGED
@@ -6556,4 +6556,46 @@ class PdfTests < Minitest::Test
|
|
6556
6556
|
response = @pdf_api.post_import_fields_from_xml(file_name, opts)
|
6557
6557
|
assert(response, 'Failed to import fields from xml.')
|
6558
6558
|
end
|
6559
|
+
|
6560
|
+
# Layers Tests
|
6561
|
+
|
6562
|
+
def test_get_document_layers
|
6563
|
+
file_name = 'PdfWithLayers.pdf'
|
6564
|
+
upload_file(file_name)
|
6565
|
+
|
6566
|
+
opts = {
|
6567
|
+
:folder => @temp_folder
|
6568
|
+
}
|
6569
|
+
|
6570
|
+
response = @pdf_api.get_document_layers(file_name, opts)
|
6571
|
+
assert_equal(2, response[0].layers.count(), 'Failed to read document layers.')
|
6572
|
+
end
|
6573
|
+
|
6574
|
+
def test_delete_document_layer
|
6575
|
+
file_name = 'PdfWithLayers.pdf'
|
6576
|
+
upload_file(file_name)
|
6577
|
+
|
6578
|
+
opts = {
|
6579
|
+
:folder => @temp_folder
|
6580
|
+
}
|
6581
|
+
|
6582
|
+
response = @pdf_api.delete_document_layer(file_name, 1, "oc1", opts)
|
6583
|
+
assert(response, 'Failed to delete document layer.')
|
6584
|
+
|
6585
|
+
response = @pdf_api.get_document_layers(file_name, opts)
|
6586
|
+
assert_equal(1, response[0].layers.count(), 'Failed to read document layers.')
|
6587
|
+
end
|
6588
|
+
|
6589
|
+
def test_put_create_pdf_from_layer
|
6590
|
+
file_name = 'PdfWithLayers.pdf'
|
6591
|
+
upload_file(file_name)
|
6592
|
+
|
6593
|
+
opts = {
|
6594
|
+
:folder => @temp_folder
|
6595
|
+
}
|
6596
|
+
|
6597
|
+
response = @pdf_api.put_create_pdf_from_layer(file_name, 1, "output.pdf", "oc1", opts)
|
6598
|
+
assert(response, 'Failed to create a separate PDF from a PDF Layer.')
|
6599
|
+
end
|
6600
|
+
|
6559
6601
|
end
|
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: 24.
|
4
|
+
version: 24.9.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: 2024-
|
11
|
+
date: 2024-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- docs/DocRecognitionMode.md
|
246
246
|
- docs/Document.md
|
247
247
|
- docs/DocumentConfig.md
|
248
|
+
- docs/DocumentLayers.md
|
248
249
|
- docs/DocumentPageResponse.md
|
249
250
|
- docs/DocumentPagesResponse.md
|
250
251
|
- docs/DocumentPrivilege.md
|
@@ -305,6 +306,7 @@ files:
|
|
305
306
|
- docs/InkAnnotations.md
|
306
307
|
- docs/InkAnnotationsResponse.md
|
307
308
|
- docs/Justification.md
|
309
|
+
- docs/LayerInfo.md
|
308
310
|
- docs/LettersPositioningMethods.md
|
309
311
|
- docs/LineAnnotation.md
|
310
312
|
- docs/LineAnnotationResponse.md
|
@@ -536,6 +538,7 @@ files:
|
|
536
538
|
- lib/aspose_pdf_cloud/models/doc_recognition_mode.rb
|
537
539
|
- lib/aspose_pdf_cloud/models/document.rb
|
538
540
|
- lib/aspose_pdf_cloud/models/document_config.rb
|
541
|
+
- lib/aspose_pdf_cloud/models/document_layers.rb
|
539
542
|
- lib/aspose_pdf_cloud/models/document_page_response.rb
|
540
543
|
- lib/aspose_pdf_cloud/models/document_pages_response.rb
|
541
544
|
- lib/aspose_pdf_cloud/models/document_privilege.rb
|
@@ -596,6 +599,7 @@ files:
|
|
596
599
|
- lib/aspose_pdf_cloud/models/ink_annotations.rb
|
597
600
|
- lib/aspose_pdf_cloud/models/ink_annotations_response.rb
|
598
601
|
- lib/aspose_pdf_cloud/models/justification.rb
|
602
|
+
- lib/aspose_pdf_cloud/models/layer_info.rb
|
599
603
|
- lib/aspose_pdf_cloud/models/letters_positioning_methods.rb
|
600
604
|
- lib/aspose_pdf_cloud/models/line_annotation.rb
|
601
605
|
- lib/aspose_pdf_cloud/models/line_annotation_response.rb
|
@@ -789,6 +793,7 @@ files:
|
|
789
793
|
- test_data/PdfWithEmbeddedFiles.pdf
|
790
794
|
- test_data/PdfWithImages.pdf
|
791
795
|
- test_data/PdfWithImages2.pdf
|
796
|
+
- test_data/PdfWithLayers.pdf
|
792
797
|
- test_data/PdfWithLinks.pdf
|
793
798
|
- test_data/PdfWithScreenAnnotations.pdf
|
794
799
|
- test_data/PdfWithTable.pdf
|