aspose_pdf_cloud 24.1.0 → 24.3.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: 99727c1d6b4a70db54b8ec796b29ab72cc20c2aae135c4595487f98e3f2bfaee
4
- data.tar.gz: c345317dfd6636564da80c15a4e4556496e23ff41ac1282d08cd593766ede792
3
+ metadata.gz: 72550435cc5247c3a9be9980953afe79c9844492616effa1f23c5ccb43ab8e2d
4
+ data.tar.gz: 5d33e3c6b50170668dcf8e8e650e632dbd3e32de63c1a7e530a58e4702277cca
5
5
  SHA512:
6
- metadata.gz: cb04498615b9faecb88d6cfef946913476fc108e20863eee89c2e27bfa1653986ca9551c785a5db497f727cf31a2290f6d4e17b763772f1897e6f36a737a0d68
7
- data.tar.gz: 2795b5de5c48cc9486b1e7e3795e4380821ec1267689cf38ba88f398a47a9645fdaa7e377aa1b83ba5af33ab106afc0635dda98835fec9ed47230515caa71561
6
+ metadata.gz: 9790d12976b80d8dbb7d50288a0b202eb0e1faa1655ccc46b6ddbeaf3859a6f31c5416542958bf4337191f9048934709e1c8f8ee1d2fefdac658240cdaa5c8ee
7
+ data.tar.gz: 7fe1cf52b771e8954d5840704ad1ff3abfc059f9e6590bab2e8dd2d16a8db3e88afb4c2da89aa376600d04ea6bc0fab000bc3b8b103607fa84f8334adb4e4b23
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.1
33
- - Add support to convert password protected PDF to SVG in PutPdfInRequestToSvg API.
34
- - Add support to convert password protected PDF to SVG in PutPdfInStorageToSvg API.
32
+ ## Enhancements in Version 24.3
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.1.0.gem
48
+ gem install ./aspose_pdf_cloud-24.3.0.gem
51
49
  ```
52
- (for development, run `gem install --dev ./aspose_pdf_cloud-24.1.0.gem` to install the development dependencies)
50
+ (for development, run `gem install --dev ./aspose_pdf_cloud-24.3.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.1.0'
56
+ gem 'aspose_pdf_cloud', '~> 24.3.0'
59
57
 
60
58
  ### Install from Git
61
59
 
@@ -68,19 +66,19 @@ Add the following in the Gemfile:
68
66
 
69
67
  ```ruby
70
68
  # Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).
69
+ @pdf_api = PdfApi.new('MY_CLIENT_ID', 'MY_CLIENT_SECRET')
70
+ file_name = 'PdfWithAnnotations.pdf'
71
+ page_number = 2
72
+ opts = {
73
+ :folder => 'tempFolder'
74
+ }
75
+ response = @pdf_api.get_page_annotations(file_name, page_number, opts)
76
+ ```
71
77
 
72
- AsposePdfCloud.configure do |config|
73
- config.client_data['ClientId'] = 'MY_CLIENT_ID'
74
- config.client_data['ClientSecret'] = 'MY_CLIENT_SECRET'
75
- config.host = host
76
-
77
- file_name = 'PdfWithAnnotations.pdf'
78
- page_number = 2
79
- opts = {
80
- :folder => 'tempFolder'
81
- }
82
-
83
- response = @pdf_api.get_page_annotations(file_name, page_number, opts)
78
+ ## SelfHost Aspose.PDF Cloud
79
+ 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*:
80
+ ```ruby
81
+ @pdf_api = PdfApi.new('', '', 'MY_SELFHOST_URL', true)
84
82
  ```
85
83
 
86
84
  ## Unit Tests
@@ -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
 
@@ -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.1.0"
23
+ VERSION = "24.3.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
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.1.0
4
+ version: 24.3.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-01-25 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json