aspose_pdf_cloud 24.2.0 → 24.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a710907df56141db74ce4f32878b8f2fac75897c27fd013be1232e32b980c964
4
- data.tar.gz: 9969957699d1083b5ca2a387019ae2d50cb8def5ae53d7c479cc708d1c72573c
3
+ metadata.gz: dee09851c2f85db607abea25ef5a964d41b9183386b79e14663bbbf6035f58f2
4
+ data.tar.gz: e08a5bc8c25ee5dbf7cce19b9d24cce437719ac4ae5d605bb94ab8fa7d52d275
5
5
  SHA512:
6
- metadata.gz: ef12553483de029dc6ba25308f33eab810024e417f3047531015508f5ea91313667d6d91767625f1f5bed3a0b775069a8190b98a7b5b728c9beb3383240d1bd6
7
- data.tar.gz: a27289346bf247dd3d8837ea88295c8ada673698535a7508a915422cb0e170dcbcf22f6e8f1576b4bdaa3a57e36dcf315a408e138c05482394ae4989e0f4d267
6
+ metadata.gz: 45f0ce9fa3b50f9108a35eeb76438674a4f0471aeee9896875acc3be439fd5eb7ddcb64c2d22e0b993d56f66f56d9ba8cd650fea7e723f05d3f13652a9e5c21c
7
+ data.tar.gz: b2522d0dc3727aea6a3307962fe419e1c1ef03c747da5cb12c27813215b3af6ee068cc82f467e07aa75ab3256f74b050688027f392c075aae1b91d7d71e8e295
data/README.md CHANGED
@@ -29,8 +29,9 @@ 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.2
33
- - Memory leak when converting PDF to DOCX.
32
+ ## Enhancements in Version 24.4
33
+ - Convert PDF to optimized Text.
34
+ - Convert PDF to EXCEL without Cloud Storage.
34
35
  - A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
35
36
 
36
37
  ## Installation
@@ -46,15 +47,15 @@ gem build aspose_pdf_cloud.gemspec
46
47
  Then either install the gem locally:
47
48
 
48
49
  ```shell
49
- gem install ./aspose_pdf_cloud-24.2.0.gem
50
+ gem install ./aspose_pdf_cloud-24.4.0.gem
50
51
  ```
51
- (for development, run `gem install --dev ./aspose_pdf_cloud-24.2.0.gem` to install the development dependencies)
52
+ (for development, run `gem install --dev ./aspose_pdf_cloud-24.4.0.gem` to install the development dependencies)
52
53
 
53
54
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
54
55
 
55
56
  Finally add this to the Gemfile:
56
57
 
57
- gem 'aspose_pdf_cloud', '~> 24.2.0'
58
+ gem 'aspose_pdf_cloud', '~> 24.4.0'
58
59
 
59
60
  ### Install from Git
60
61
 
@@ -67,19 +68,19 @@ Add the following in the Gemfile:
67
68
 
68
69
  ```ruby
69
70
  # Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).
71
+ @pdf_api = PdfApi.new('MY_CLIENT_ID', 'MY_CLIENT_SECRET')
72
+ file_name = 'PdfWithAnnotations.pdf'
73
+ page_number = 2
74
+ opts = {
75
+ :folder => 'tempFolder'
76
+ }
77
+ response = @pdf_api.get_page_annotations(file_name, page_number, opts)
78
+ ```
70
79
 
71
- AsposePdfCloud.configure do |config|
72
- config.client_data['ClientId'] = 'MY_CLIENT_ID'
73
- config.client_data['ClientSecret'] = 'MY_CLIENT_SECRET'
74
- config.host = host
75
-
76
- file_name = 'PdfWithAnnotations.pdf'
77
- page_number = 2
78
- opts = {
79
- :folder => 'tempFolder'
80
- }
81
-
82
- response = @pdf_api.get_page_annotations(file_name, page_number, opts)
80
+ ## SelfHost Aspose.PDF Cloud
81
+ Create **PdfApi** object without **app_key** and **app_sid** parameters, but with **host** parameter set to *url of SelfHost Aspose.PDF Cloud* and **self_host** parameter set to *true*:
82
+ ```ruby
83
+ @pdf_api = PdfApi.new('', '', 'MY_SELFHOST_URL', true)
83
84
  ```
84
85
 
85
86
  ## Unit Tests
data/docs/PdfApi.md CHANGED
@@ -153,6 +153,7 @@ Method | HTTP request | Description
153
153
  [**get_pdf_in_storage_to_pptx**](PdfApi.md#get_pdf_in_storage_to_pptx) | **GET** /pdf/\{name}/convert/pptx | Converts PDF document (located on storage) to PPTX format and returns resulting file in response content
154
154
  [**get_pdf_in_storage_to_svg**](PdfApi.md#get_pdf_in_storage_to_svg) | **GET** /pdf/\{name}/convert/svg | Converts PDF document (located on storage) to SVG format and returns resulting file in response content
155
155
  [**get_pdf_in_storage_to_te_x**](PdfApi.md#get_pdf_in_storage_to_te_x) | **GET** /pdf/\{name}/convert/tex | Converts PDF document (located on storage) to TeX format and returns resulting file in response content
156
+ [**get_pdf_in_storage_to_text**](PdfApi.md#get_pdf_in_storage_to_text) | **GET** /pdf/\{name}/convert/text | Converts PDF document (located on storage) to Text format and returns resulting file in response content
156
157
  [**get_pdf_in_storage_to_tiff**](PdfApi.md#get_pdf_in_storage_to_tiff) | **GET** /pdf/\{name}/convert/tiff | Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
157
158
  [**get_pdf_in_storage_to_xls**](PdfApi.md#get_pdf_in_storage_to_xls) | **GET** /pdf/\{name}/convert/xls | Converts PDF document (located on storage) to XLS format and returns resulting file in response content
158
159
  [**get_pdf_in_storage_to_xlsx**](PdfApi.md#get_pdf_in_storage_to_xlsx) | **GET** /pdf/\{name}/convert/xlsx | Converts PDF document (located on storage) to XLSX format and returns resulting file in response content
@@ -243,6 +244,7 @@ Method | HTTP request | Description
243
244
  [**post_page_text_replace**](PdfApi.md#post_page_text_replace) | **POST** /pdf/\{name}/pages/\{pageNumber}/text/replace | Page's replace text method.
244
245
  [**post_page_text_stamps**](PdfApi.md#post_page_text_stamps) | **POST** /pdf/\{name}/pages/\{pageNumber}/stamps/text | Add document page text stamps.
245
246
  [**post_page_underline_annotations**](PdfApi.md#post_page_underline_annotations) | **POST** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Add document page underline annotations.
247
+ [**post_pdf_to_xlsx**](PdfApi.md#post_pdf_to_xlsx) | **POST** /pdf/convert/xlsx | Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
246
248
  [**post_popup_annotation**](PdfApi.md#post_popup_annotation) | **POST** /pdf/\{name}/annotations/\{annotationId}/popup | Add document popup annotations.
247
249
  [**post_radio_button_fields**](PdfApi.md#post_radio_button_fields) | **POST** /pdf/\{name}/fields/radiobutton | Add document RadioButton fields.
248
250
  [**post_sign_document**](PdfApi.md#post_sign_document) | **POST** /pdf/\{name}/sign | Sign document.
@@ -4120,6 +4122,30 @@ Name | Type | Description | Notes
4120
4122
 
4121
4123
 
4122
4124
 
4125
+ # **get_pdf_in_storage_to_text**
4126
+ > File get_pdf_in_storage_to_text(name, opts)
4127
+
4128
+ Converts PDF document (located on storage) to Text format and returns resulting file in response content
4129
+
4130
+ ### Parameters
4131
+
4132
+ Name | Type | Description | Notes
4133
+ ------------- | ------------- | ------------- | -------------
4134
+ **name** | **String**| The document name. |
4135
+ **folder** | **String**| The document folder. | [optional]
4136
+ **storage** | **String**| The document storage. | [optional]
4137
+
4138
+ ### Return type
4139
+
4140
+ **File**
4141
+
4142
+ ### HTTP request headers
4143
+
4144
+ - **Content-Type**: application/json
4145
+ - **Accept**: multipart/form-data
4146
+
4147
+
4148
+
4123
4149
  # **get_pdf_in_storage_to_tiff**
4124
4150
  > File get_pdf_in_storage_to_tiff(name, opts)
4125
4151
 
@@ -6458,6 +6484,32 @@ Name | Type | Description | Notes
6458
6484
 
6459
6485
 
6460
6486
 
6487
+ # **post_pdf_to_xlsx**
6488
+ > File post_pdf_to_xlsx(opts)
6489
+
6490
+ Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
6491
+
6492
+ ### Parameters
6493
+
6494
+ Name | Type | Description | Notes
6495
+ ------------- | ------------- | ------------- | -------------
6496
+ **insert_blank_column_at_first** | **BOOLEAN**| Insert blank column at first | [optional]
6497
+ **minimize_the_number_of_worksheets** | **BOOLEAN**| Minimize the number of worksheets | [optional]
6498
+ **uniform_worksheets** | **BOOLEAN**| Uniform worksheets | [optional]
6499
+ **password** | **String**| The password (Base64). | [optional]
6500
+ **file** | **File**| A file to be converted. | [optional]
6501
+
6502
+ ### Return type
6503
+
6504
+ **File**
6505
+
6506
+ ### HTTP request headers
6507
+
6508
+ - **Content-Type**: multipart/form-data
6509
+ - **Accept**: multipart/form-data
6510
+
6511
+
6512
+
6461
6513
  # **post_popup_annotation**
6462
6514
  > AsposeResponse post_popup_annotation(name, annotation_id, annotation, opts)
6463
6515
 
@@ -25,10 +25,18 @@ module AsposePdfCloud
25
25
  class PdfApi
26
26
  attr_accessor :api_client
27
27
 
28
- def initialize(app_key, app_sid, api_client = ApiClient.default)
28
+ def initialize(app_key, app_sid, host = "", self_host = false, api_client = ApiClient.default)
29
29
  @api_client = api_client
30
+ @api_client.config.self_host = self_host
30
31
  @api_client.config.app_key = app_key
31
32
  @api_client.config.app_sid = app_sid
33
+ if host != ""
34
+ if @api_client.config.self_host
35
+ @api_client.config.self_host_url = host
36
+ else
37
+ @api_client.config.host = host
38
+ end
39
+ end
32
40
  end
33
41
 
34
42
 
@@ -11600,6 +11608,78 @@ module AsposePdfCloud
11600
11608
  return data, status_code, headers
11601
11609
  end
11602
11610
 
11611
+ # Converts PDF document (located on storage) to Text format and returns resulting file in response content
11612
+ #
11613
+ # @param name The document name.
11614
+ # @param [Hash] opts the optional parameters
11615
+ # @option opts [String] :folder The document folder.
11616
+ # @option opts [String] :storage The document storage.
11617
+ # @return [File]
11618
+ def get_pdf_in_storage_to_text(name, opts = {})
11619
+ @api_client.request_token_if_needed
11620
+ data, _status_code, _headers = get_pdf_in_storage_to_text_with_http_info(name, opts)
11621
+ rescue ApiError => error
11622
+ if error.code == 401
11623
+ @api_client.request_token_if_needed
11624
+ data, _status_code, _headers = get_pdf_in_storage_to_text_with_http_info(name, opts)
11625
+ else
11626
+ raise
11627
+ end
11628
+ return data
11629
+ end
11630
+
11631
+ # Converts PDF document (located on storage) to Text format and returns resulting file in response content
11632
+ #
11633
+ # @param name The document name.
11634
+ # @param [Hash] opts the optional parameters
11635
+ # @option opts [String] :folder The document folder.
11636
+ # @option opts [String] :storage The document storage.
11637
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
11638
+ def get_pdf_in_storage_to_text_with_http_info(name, opts = {})
11639
+ if @api_client.config.debugging
11640
+ @api_client.config.logger.debug "Calling API: PdfApi.get_pdf_in_storage_to_text ..."
11641
+ end
11642
+ # verify the required parameter 'name' is set
11643
+ if @api_client.config.client_side_validation && name.nil?
11644
+ fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.get_pdf_in_storage_to_text"
11645
+ end
11646
+ # resource path
11647
+ local_var_path = "/pdf/{name}/convert/text".sub('{' + 'name' + '}', name.to_s)
11648
+
11649
+ # query parameters
11650
+ query_params = {}
11651
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
11652
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
11653
+
11654
+ # header parameters
11655
+ header_params = {}
11656
+ # HTTP header 'Accept' (if needed)
11657
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
11658
+ # HTTP header 'Content-Type'
11659
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
11660
+
11661
+ # form parameters
11662
+ form_params = {}
11663
+ # Fix header in file
11664
+ post_body = nil
11665
+
11666
+ # http body (model)
11667
+ # Fix header in file
11668
+ # post_body = nil
11669
+ auth_names = ['JWT']
11670
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
11671
+ :header_params => header_params,
11672
+ :query_params => query_params,
11673
+ :form_params => form_params,
11674
+ :body => post_body,
11675
+ :auth_names => auth_names,
11676
+ :return_type => 'File')
11677
+ if @api_client.config.debugging
11678
+ @api_client.config.logger.debug "API called: PdfApi#get_pdf_in_storage_to_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
11679
+ end
11680
+ return data, status_code, headers
11681
+ end
11682
+
11603
11683
  # Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
11604
11684
  #
11605
11685
  # @param name The document name.
@@ -18975,6 +19055,82 @@ module AsposePdfCloud
18975
19055
  return data, status_code, headers
18976
19056
  end
18977
19057
 
19058
+ # Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
19059
+ #
19060
+ # @param [Hash] opts the optional parameters
19061
+ # @option opts [BOOLEAN] :insert_blank_column_at_first Insert blank column at first
19062
+ # @option opts [BOOLEAN] :minimize_the_number_of_worksheets Minimize the number of worksheets
19063
+ # @option opts [BOOLEAN] :uniform_worksheets Uniform worksheets
19064
+ # @option opts [String] :password The password (Base64).
19065
+ # @option opts [File] :file A file to be converted.
19066
+ # @return [File]
19067
+ def post_pdf_to_xlsx(opts = {})
19068
+ @api_client.request_token_if_needed
19069
+ data, _status_code, _headers = post_pdf_to_xlsx_with_http_info(opts)
19070
+ rescue ApiError => error
19071
+ if error.code == 401
19072
+ @api_client.request_token_if_needed
19073
+ data, _status_code, _headers = post_pdf_to_xlsx_with_http_info(opts)
19074
+ else
19075
+ raise
19076
+ end
19077
+ return data
19078
+ end
19079
+
19080
+ # Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
19081
+ #
19082
+ # @param [Hash] opts the optional parameters
19083
+ # @option opts [BOOLEAN] :insert_blank_column_at_first Insert blank column at first
19084
+ # @option opts [BOOLEAN] :minimize_the_number_of_worksheets Minimize the number of worksheets
19085
+ # @option opts [BOOLEAN] :uniform_worksheets Uniform worksheets
19086
+ # @option opts [String] :password The password (Base64).
19087
+ # @option opts [File] :file A file to be converted.
19088
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
19089
+ def post_pdf_to_xlsx_with_http_info(opts = {})
19090
+ if @api_client.config.debugging
19091
+ @api_client.config.logger.debug "Calling API: PdfApi.post_pdf_to_xlsx ..."
19092
+ end
19093
+ # resource path
19094
+ local_var_path = "/pdf/convert/xlsx"
19095
+
19096
+ # query parameters
19097
+ query_params = {}
19098
+ query_params[:'insertBlankColumnAtFirst'] = opts[:'insert_blank_column_at_first'] if !opts[:'insert_blank_column_at_first'].nil?
19099
+ query_params[:'minimizeTheNumberOfWorksheets'] = opts[:'minimize_the_number_of_worksheets'] if !opts[:'minimize_the_number_of_worksheets'].nil?
19100
+ query_params[:'uniformWorksheets'] = opts[:'uniform_worksheets'] if !opts[:'uniform_worksheets'].nil?
19101
+ query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
19102
+
19103
+ # header parameters
19104
+ header_params = {}
19105
+ # HTTP header 'Accept' (if needed)
19106
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
19107
+ # HTTP header 'Content-Type'
19108
+ header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
19109
+
19110
+ # form parameters
19111
+ form_params = {}
19112
+ # Fix header in file
19113
+ post_body = nil
19114
+ post_body = opts[:'file'] if !opts[:'file'].nil?
19115
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
19116
+
19117
+ # http body (model)
19118
+ # Fix header in file
19119
+ # post_body = nil
19120
+ auth_names = ['JWT']
19121
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
19122
+ :header_params => header_params,
19123
+ :query_params => query_params,
19124
+ :form_params => form_params,
19125
+ :body => post_body,
19126
+ :auth_names => auth_names,
19127
+ :return_type => 'File')
19128
+ if @api_client.config.debugging
19129
+ @api_client.config.logger.debug "API called: PdfApi#post_pdf_to_xlsx\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
19130
+ end
19131
+ return data, status_code, headers
19132
+ end
19133
+
18978
19134
  # Add document popup annotations.
18979
19135
  #
18980
19136
  # @param name The document name.
@@ -107,7 +107,9 @@ module AsposePdfCloud
107
107
  form_params = opts[:form_params] || {}
108
108
  body = opts[:body] || {}
109
109
 
110
- update_params_for_auth! header_params, query_params, opts[:auth_names]
110
+ if !@config.self_host
111
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
112
+ end
111
113
 
112
114
  req_opts = {
113
115
  :method => http_method,
@@ -124,11 +126,12 @@ module AsposePdfCloud
124
126
  end
125
127
  end
126
128
 
127
- # OAuth 2.0
128
129
  req_opts[:params] = opts[:query_params]
129
130
 
130
- add_o_auth_token(req_opts)
131
-
131
+ if !@config.self_host
132
+ # OAuth 2.0
133
+ add_o_auth_token(req_opts)
134
+ end
132
135
 
133
136
  conn = Faraday.new url, {:params => query_params, :headers => header_params} do |f|
134
137
  f.request :multipart
@@ -411,6 +414,9 @@ module AsposePdfCloud
411
414
 
412
415
  # Request access and refresh tokens if needed
413
416
  def request_token_if_needed
417
+ if @config.self_host
418
+ return
419
+ end
414
420
  # check token exists
415
421
  if @config.access_token
416
422
  return
@@ -24,6 +24,12 @@ require 'uri'
24
24
  module AsposePdfCloud
25
25
  class Configuration
26
26
 
27
+ # SelfHost
28
+ attr_accessor :self_host
29
+
30
+ # SelfHost URL
31
+ attr_accessor :self_host_url
32
+
27
33
  # App Key
28
34
  attr_accessor :app_key
29
35
 
@@ -152,7 +158,11 @@ module AsposePdfCloud
152
158
  end
153
159
 
154
160
  def base_url
155
- url = "#{scheme}://#{[host, '/v3.0'].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
161
+ if @self_host
162
+ url = self_host_url
163
+ else
164
+ url = "#{scheme}://#{[host, '/v3.0'].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
165
+ end
156
166
  URI.encode(url)
157
167
  end
158
168
 
@@ -20,5 +20,5 @@ SOFTWARE.
20
20
  =end
21
21
 
22
22
  module AsposePdfCloud
23
- VERSION = "24.2.0"
23
+ VERSION = "24.4.0"
24
24
  end
data/test/pdf_tests.rb CHANGED
@@ -32,10 +32,13 @@ class PdfTests < Minitest::Test
32
32
  def setup
33
33
  servercreds_json = File.read('../../../Settings/servercreds.json')
34
34
  creds = JSON.parse(servercreds_json)
35
- @pdf_api = PdfApi.new(creds["AppKey"], creds["AppSID"])
35
+ self_host = creds.has_key?("SelfHost") ? creds["SelfHost"] : false
36
+ app_key = creds.has_key?("AppKey") ? creds["AppKey"] : ""
37
+ app_sid = creds.has_key?("AppSID") ? creds["AppSID"] : ""
38
+ product_uri = creds.has_key?("ProductUri") ? creds["ProductUri"] : ""
39
+ @pdf_api = PdfApi.new(app_key, app_sid, product_uri, self_host)
36
40
  @temp_folder = 'TempPdfCloud'
37
41
  @test_data_folder = '../test_data/'
38
-
39
42
  config = @pdf_api.api_client.config
40
43
  config.scheme = 'https'
41
44
  end
@@ -2818,11 +2821,9 @@ class PdfTests < Minitest::Test
2818
2821
  def test_get_pdf_in_storage_to_doc
2819
2822
  file_name = '4pages.pdf'
2820
2823
  upload_file(file_name)
2821
-
2822
2824
  opts = {
2823
2825
  :folder => @temp_folder
2824
2826
  }
2825
-
2826
2827
  response = @pdf_api.get_pdf_in_storage_to_doc(file_name, opts)
2827
2828
  assert(response, 'Failed to convert PDF to DOC.')
2828
2829
  end
@@ -2831,7 +2832,6 @@ class PdfTests < Minitest::Test
2831
2832
  file_name = '4pages.pdf'
2832
2833
  upload_file(file_name)
2833
2834
  res_file = 'result.doc'
2834
-
2835
2835
  opts = {
2836
2836
  :folder => @temp_folder
2837
2837
  }
@@ -2841,9 +2841,7 @@ class PdfTests < Minitest::Test
2841
2841
 
2842
2842
  def test_put_pdf_in_request_to_doc
2843
2843
  file_name = '4pages.pdf'
2844
-
2845
2844
  res_file = 'result.doc'
2846
-
2847
2845
  opts = {
2848
2846
  :file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
2849
2847
  # :file => @test_data_folder + file_name
@@ -3039,7 +3037,6 @@ class PdfTests < Minitest::Test
3039
3037
  opts = {
3040
3038
  :folder => @temp_folder
3041
3039
  }
3042
-
3043
3040
  response = @pdf_api.get_pdf_in_storage_to_html(file_name, opts)
3044
3041
  assert(response, 'Failed to convert PDF to HTML.')
3045
3042
  end
@@ -3076,7 +3073,6 @@ class PdfTests < Minitest::Test
3076
3073
  opts = {
3077
3074
  :folder => @temp_folder
3078
3075
  }
3079
-
3080
3076
  response = @pdf_api.get_pdf_in_storage_to_epub(file_name, opts)
3081
3077
  assert(response, 'Failed to convert PDF to EPUB.')
3082
3078
  end
@@ -3186,7 +3182,6 @@ class PdfTests < Minitest::Test
3186
3182
  file_name = '4pages.pdf'
3187
3183
  upload_file(file_name)
3188
3184
  res_file = 'result.tex'
3189
-
3190
3185
  opts = {
3191
3186
  :folder => @temp_folder
3192
3187
  }
@@ -3194,12 +3189,9 @@ class PdfTests < Minitest::Test
3194
3189
  assert(response, 'Failed to convert PDF to TeX.')
3195
3190
  end
3196
3191
 
3197
-
3198
3192
  def test_put_pdf_in_request_to_te_x
3199
3193
  file_name = '4pages.pdf'
3200
-
3201
3194
  res_file = 'result.tex'
3202
-
3203
3195
  opts = {
3204
3196
  :file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
3205
3197
  }
@@ -3210,11 +3202,9 @@ class PdfTests < Minitest::Test
3210
3202
  def test_get_pdf_in_storage_to_mobi_xml
3211
3203
  file_name = '4pages.pdf'
3212
3204
  upload_file(file_name)
3213
-
3214
3205
  opts = {
3215
3206
  :folder => @temp_folder
3216
3207
  }
3217
-
3218
3208
  response = @pdf_api.get_pdf_in_storage_to_mobi_xml(file_name, opts)
3219
3209
  assert(response, 'Failed to convert PDF to Moby Xml.')
3220
3210
  end
@@ -3223,7 +3213,6 @@ class PdfTests < Minitest::Test
3223
3213
  file_name = '4pages.pdf'
3224
3214
  upload_file(file_name)
3225
3215
  res_file = 'result.mobi'
3226
-
3227
3216
  opts = {
3228
3217
  :folder => @temp_folder
3229
3218
  }
@@ -3231,12 +3220,9 @@ class PdfTests < Minitest::Test
3231
3220
  assert(response, 'Failed to convert PDF to Moby Xml.')
3232
3221
  end
3233
3222
 
3234
-
3235
3223
  def test_put_pdf_in_request_to_mobi_xml
3236
3224
  file_name = '4pages.pdf'
3237
-
3238
3225
  res_file = 'result.mobi'
3239
-
3240
3226
  opts = {
3241
3227
  :file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
3242
3228
  }
@@ -3247,11 +3233,9 @@ class PdfTests < Minitest::Test
3247
3233
  def test_get_xfa_pdf_in_storage_to_acro_form
3248
3234
  file_name = 'PdfWithXfaForm.pdf'
3249
3235
  upload_file(file_name)
3250
-
3251
3236
  opts = {
3252
3237
  :folder => @temp_folder
3253
3238
  }
3254
-
3255
3239
  response = @pdf_api.get_xfa_pdf_in_storage_to_acro_form(file_name, opts)
3256
3240
  assert(response, 'Failed to convert Xfa PDF to Acro form.')
3257
3241
  end
@@ -3260,7 +3244,6 @@ class PdfTests < Minitest::Test
3260
3244
  file_name = 'PdfWithXfaForm.pdf'
3261
3245
  upload_file(file_name)
3262
3246
  res_file = 'result.pdf'
3263
-
3264
3247
  opts = {
3265
3248
  :folder => @temp_folder
3266
3249
  }
@@ -3268,7 +3251,6 @@ class PdfTests < Minitest::Test
3268
3251
  assert(response, 'Failed to convert Xfa PDF to Acro form.')
3269
3252
  end
3270
3253
 
3271
-
3272
3254
  def test_put_xfa_pdf_in_request_to_acro_form
3273
3255
  file_name = 'PdfWithXfaForm.pdf'
3274
3256
 
@@ -3281,15 +3263,12 @@ class PdfTests < Minitest::Test
3281
3263
  assert(response, 'Failed to convert Xfa PDF to Acro form.')
3282
3264
  end
3283
3265
 
3284
-
3285
3266
  def test_get_pdf_in_storage_to_xml
3286
3267
  file_name = '4pages.pdf'
3287
3268
  upload_file(file_name)
3288
-
3289
3269
  opts = {
3290
3270
  :folder => @temp_folder
3291
3271
  }
3292
-
3293
3272
  response = @pdf_api.get_pdf_in_storage_to_xml(file_name, opts)
3294
3273
  assert(response, 'Failed to convert PDF to Xml.')
3295
3274
  end
@@ -3298,7 +3277,6 @@ class PdfTests < Minitest::Test
3298
3277
  file_name = '4pages.pdf'
3299
3278
  upload_file(file_name)
3300
3279
  res_file = 'result.xml'
3301
-
3302
3280
  opts = {
3303
3281
  :folder => @temp_folder
3304
3282
  }
@@ -3306,12 +3284,9 @@ class PdfTests < Minitest::Test
3306
3284
  assert(response, 'Failed to convert PDF to Xml.')
3307
3285
  end
3308
3286
 
3309
-
3310
3287
  def test_put_pdf_in_request_to_xml
3311
3288
  file_name = '4pages.pdf'
3312
-
3313
3289
  res_file = 'result.xml'
3314
-
3315
3290
  opts = {
3316
3291
  :file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
3317
3292
  }
@@ -3322,11 +3297,9 @@ class PdfTests < Minitest::Test
3322
3297
  def test_get_pdf_in_storage_to_xlsx
3323
3298
  file_name = '4pages.pdf'
3324
3299
  upload_file(file_name)
3325
-
3326
3300
  opts = {
3327
3301
  :folder => @temp_folder
3328
3302
  }
3329
-
3330
3303
  response = @pdf_api.get_pdf_in_storage_to_xlsx(file_name, opts)
3331
3304
  assert(response, 'Failed to convert PDF to XLS.')
3332
3305
  end
@@ -3335,7 +3308,6 @@ class PdfTests < Minitest::Test
3335
3308
  file_name = '4pages.pdf'
3336
3309
  upload_file(file_name)
3337
3310
  res_file = 'result.xlsx'
3338
-
3339
3311
  opts = {
3340
3312
  :folder => @temp_folder
3341
3313
  }
@@ -3345,9 +3317,7 @@ class PdfTests < Minitest::Test
3345
3317
 
3346
3318
  def test_put_pdf_in_request_to_xlsx
3347
3319
  file_name = '4pages.pdf'
3348
-
3349
3320
  res_file = 'result.xlsx'
3350
-
3351
3321
  opts = {
3352
3322
  :file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
3353
3323
  }
@@ -3355,6 +3325,25 @@ class PdfTests < Minitest::Test
3355
3325
  assert(response, 'Failed to convert PDF to XLS.')
3356
3326
  end
3357
3327
 
3328
+ def test_post_pdf_to_xlsx
3329
+ file_name = '4pages.pdf'
3330
+ opts = {
3331
+ :file => ::File.open(@test_data_folder + file_name, 'r') { |io| io.read(io.size) }
3332
+ }
3333
+ response = @pdf_api.post_pdf_to_xlsx(opts)
3334
+ assert(response, 'Failed to convert PDF to XLS.')
3335
+ end
3336
+
3337
+ def test_get_pdf_in_storage_to_text
3338
+ file_name = '4pages.pdf'
3339
+ upload_file(file_name)
3340
+ opts = {
3341
+ :folder => @temp_folder
3342
+ }
3343
+ response = @pdf_api.get_pdf_in_storage_to_text(file_name, opts)
3344
+ assert(response, 'Failed to convert PDF to Text.')
3345
+ end
3346
+
3358
3347
  # Convert to PDF Tests
3359
3348
 
3360
3349
  def test_get_epub_in_storage_to_pdf
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.2.0
4
+ version: 24.4.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-02-22 00:00:00.000000000 Z
11
+ date: 2024-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json