aspose_pdf_cloud 20.2.0 → 20.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af58bd7d4aa4e5b0f43ca49cf3b329f1f155ad48d232a49aa1c53ebe504a107f
4
- data.tar.gz: dad5e6f25080326035ee6e1ac4839a8503ed7f8937b64564d8e420ab2c6a1994
3
+ metadata.gz: 1f4f395755c2160d5c2fde37eb255960fece4c95c0b9a4b4c4a83ec399fe1943
4
+ data.tar.gz: 40157c56345e6071e05d5eb23411aa3ceb058d41eaa61170e321070ebf794843
5
5
  SHA512:
6
- metadata.gz: 7550ab54227bd21daacf5bcbed057e5d150584188a3f9374efff4cd1fda23fdb31615ea8d0c7c956b3a69049ce275acca66be9ab561e31088c3aa9f78ab7b5df
7
- data.tar.gz: 2f33e5fc28f212caa69d028706d2fc1b738f5c6ca0866969187cdff2d5224873175ef3d335a21f3d367469bc87486a2d6e497206bafd0c60024463c6f687d9a9
6
+ metadata.gz: c470535c09dc1070d2786dd6e118e84ec2e4b48d14ce04bf24912d400b599816ff9ae39ca4dc23fc9d61014116965191934b0e06c113ac373b2e2da92c5c3adc
7
+ data.tar.gz: 9ec85aaad2b5b33d29bb21aa7d6aaae554d04982c65a6ae75e1e3434db2f8b59c67cbe86aa88e5e813a2832424682f4ae9fc03cf68266da30db4e69439c8258e
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Aspose.PDF Cloud
2
2
 
3
3
  - API version: 3.0
4
- - Package version: 20.2.0
4
+ - Package version: 20.4.0
5
5
 
6
6
  [Aspose.PDF Cloud](https://products.aspose.cloud/pdf) is a true REST API that enables you to perform a wide range of document processing operations including creation, manipulation, conversion and rendering of Pdf documents in the cloud.
7
7
 
@@ -24,15 +24,15 @@ gem build aspose_pdf_cloud.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./aspose_pdf_cloud-20.2.0.gem
27
+ gem install ./aspose_pdf_cloud-20.4.0.gem
28
28
  ```
29
- (for development, run `gem install --dev ./aspose_pdf_cloud-20.2.0.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./aspose_pdf_cloud-20.4.0.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'aspose_pdf_cloud', '~> 20.2.0'
35
+ gem 'aspose_pdf_cloud', '~> 20.4.0'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -498,6 +498,7 @@ Class | Method | HTTP request | Description
498
498
  - [AsposePdfCloud::HorizontalAlignment](docs/HorizontalAlignment.md)
499
499
  - [AsposePdfCloud::HtmlDocumentType](docs/HtmlDocumentType.md)
500
500
  - [AsposePdfCloud::HtmlMarkupGenerationModes](docs/HtmlMarkupGenerationModes.md)
501
+ - [AsposePdfCloud::ImageFragment](docs/ImageFragment.md)
501
502
  - [AsposePdfCloud::ImageSrcType](docs/ImageSrcType.md)
502
503
  - [AsposePdfCloud::ImageTemplate](docs/ImageTemplate.md)
503
504
  - [AsposePdfCloud::ImageTemplatesRequest](docs/ImageTemplatesRequest.md)
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
9
9
  **border** | [**BorderInfo**](BorderInfo.md) | Gets or sets the border. | [optional]
10
10
  **background_color** | [**Color**](Color.md) | Gets or sets the background color. | [optional]
11
11
  **background_image_file** | **String** | Gets or sets the background image file. | [optional]
12
+ **background_image_storage_file** | **String** | Gets or sets path of the background image file from storage. | [optional]
12
13
  **alignment** | [**HorizontalAlignment**](HorizontalAlignment.md) | Gets or sets the alignment. | [optional]
13
14
  **default_cell_text_state** | [**TextState**](TextState.md) | Gets or sets the default cell text state. | [optional]
14
15
  **paragraphs** | [**Array<TextRect>**](TextRect.md) | Gets or sets the cell's formatted text. | [optional]
@@ -17,5 +18,7 @@ Name | Type | Description | Notes
17
18
  **col_span** | **Integer** | Gets or sets the column span. | [optional]
18
19
  **row_span** | **Integer** | Gets or sets the row span. | [optional]
19
20
  **width** | **Float** | Gets or sets the column width. | [optional]
21
+ **html_fragment** | **String** | Gets or sets Html fragment. | [optional]
22
+ **images** | [**Array<ImageFragment>**](ImageFragment.md) | Gets or sets ImageFragment list. | [optional]
20
23
 
21
24
 
@@ -0,0 +1,15 @@
1
+ # AsposePdfCloud::ImageFragment
2
+ Represents Image Fragment DTO.
3
+
4
+ ## Properties
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **image_file** | **String** | Gets or sets full storage path of image. |
8
+ **fix_width** | **Float** | Gets or sets fix width of the image. | [optional]
9
+ **fix_height** | **Float** | Gets or sets fix height of the image. | [optional]
10
+ **horizontal_alignment** | [**HorizontalAlignment**](HorizontalAlignment.md) | Gets or sets horizontal alignment of the image. | [optional]
11
+ **vertical_alignment** | [**VerticalAlignment**](VerticalAlignment.md) | Gets or sets vertical alignment of the image. | [optional]
12
+ **image_scale** | **Float** | Gets or sets ImageScale of the image. | [optional]
13
+ **margin** | [**MarginInfo**](MarginInfo.md) | Gets or sets Margin of the image. | [optional]
14
+
15
+
@@ -4000,7 +4000,6 @@ Converts PDF document (located on storage) to LaTeX format and returns resulting
4000
4000
  Name | Type | Description | Notes
4001
4001
  ------------- | ------------- | ------------- | -------------
4002
4002
  **name** | **String**| The document name. |
4003
- **pages_count** | **Integer**| Pages count. | [optional]
4004
4003
  **folder** | **String**| The document folder. | [optional]
4005
4004
  **storage** | **String**| The document storage. | [optional]
4006
4005
 
@@ -8043,7 +8042,6 @@ Converts PDF document (in request content) to LaTeX format and uploads resulting
8043
8042
  Name | Type | Description | Notes
8044
8043
  ------------- | ------------- | ------------- | -------------
8045
8044
  **out_path** | **String**| Full resulting filename (ex. /folder1/folder2/result.tex) |
8046
- **pages_count** | **Integer**| Pages count. | [optional]
8047
8045
  **storage** | **String**| The document storage. | [optional]
8048
8046
  **file** | **File**| A file to be converted. | [optional]
8049
8047
 
@@ -8424,7 +8422,6 @@ Name | Type | Description | Notes
8424
8422
  ------------- | ------------- | ------------- | -------------
8425
8423
  **name** | **String**| The document name. |
8426
8424
  **out_path** | **String**| Full resulting filename (ex. /folder1/folder2/result.tex) |
8427
- **pages_count** | **Integer**| Pages count. | [optional]
8428
8425
  **folder** | **String**| The document folder. | [optional]
8429
8426
  **storage** | **String**| The document storage. | [optional]
8430
8427
 
@@ -72,6 +72,7 @@ require_relative 'aspose_pdf_cloud/models/graph_info'
72
72
  require_relative 'aspose_pdf_cloud/models/horizontal_alignment'
73
73
  require_relative 'aspose_pdf_cloud/models/html_document_type'
74
74
  require_relative 'aspose_pdf_cloud/models/html_markup_generation_modes'
75
+ require_relative 'aspose_pdf_cloud/models/image_fragment'
75
76
  require_relative 'aspose_pdf_cloud/models/image_src_type'
76
77
  require_relative 'aspose_pdf_cloud/models/image_template'
77
78
  require_relative 'aspose_pdf_cloud/models/image_templates_request'
@@ -11222,7 +11222,6 @@ module AsposePdfCloud
11222
11222
  #
11223
11223
  # @param name The document name.
11224
11224
  # @param [Hash] opts the optional parameters
11225
- # @option opts [Integer] :pages_count Pages count.
11226
11225
  # @option opts [String] :folder The document folder.
11227
11226
  # @option opts [String] :storage The document storage.
11228
11227
  # @return [File]
@@ -11243,7 +11242,6 @@ module AsposePdfCloud
11243
11242
  #
11244
11243
  # @param name The document name.
11245
11244
  # @param [Hash] opts the optional parameters
11246
- # @option opts [Integer] :pages_count Pages count.
11247
11245
  # @option opts [String] :folder The document folder.
11248
11246
  # @option opts [String] :storage The document storage.
11249
11247
  # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
@@ -11260,7 +11258,6 @@ module AsposePdfCloud
11260
11258
 
11261
11259
  # query parameters
11262
11260
  query_params = {}
11263
- query_params[:'pagesCount'] = opts[:'pages_count'] if !opts[:'pages_count'].nil?
11264
11261
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
11265
11262
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
11266
11263
 
@@ -23991,7 +23988,6 @@ module AsposePdfCloud
23991
23988
  #
23992
23989
  # @param out_path Full resulting filename (ex. /folder1/folder2/result.tex)
23993
23990
  # @param [Hash] opts the optional parameters
23994
- # @option opts [Integer] :pages_count Pages count.
23995
23991
  # @option opts [String] :storage The document storage.
23996
23992
  # @option opts [File] :file A file to be converted.
23997
23993
  # @return [AsposeResponse]
@@ -24012,7 +24008,6 @@ module AsposePdfCloud
24012
24008
  #
24013
24009
  # @param out_path Full resulting filename (ex. /folder1/folder2/result.tex)
24014
24010
  # @param [Hash] opts the optional parameters
24015
- # @option opts [Integer] :pages_count Pages count.
24016
24011
  # @option opts [String] :storage The document storage.
24017
24012
  # @option opts [File] :file A file to be converted.
24018
24013
  # @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
@@ -24030,7 +24025,6 @@ module AsposePdfCloud
24030
24025
  # query parameters
24031
24026
  query_params = {}
24032
24027
  query_params[:'outPath'] = out_path
24033
- query_params[:'pagesCount'] = opts[:'pages_count'] if !opts[:'pages_count'].nil?
24034
24028
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
24035
24029
 
24036
24030
  # header parameters
@@ -25214,7 +25208,6 @@ module AsposePdfCloud
25214
25208
  # @param name The document name.
25215
25209
  # @param out_path Full resulting filename (ex. /folder1/folder2/result.tex)
25216
25210
  # @param [Hash] opts the optional parameters
25217
- # @option opts [Integer] :pages_count Pages count.
25218
25211
  # @option opts [String] :folder The document folder.
25219
25212
  # @option opts [String] :storage The document storage.
25220
25213
  # @return [AsposeResponse]
@@ -25236,7 +25229,6 @@ module AsposePdfCloud
25236
25229
  # @param name The document name.
25237
25230
  # @param out_path Full resulting filename (ex. /folder1/folder2/result.tex)
25238
25231
  # @param [Hash] opts the optional parameters
25239
- # @option opts [Integer] :pages_count Pages count.
25240
25232
  # @option opts [String] :folder The document folder.
25241
25233
  # @option opts [String] :storage The document storage.
25242
25234
  # @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
@@ -25258,7 +25250,6 @@ module AsposePdfCloud
25258
25250
  # query parameters
25259
25251
  query_params = {}
25260
25252
  query_params[:'outPath'] = out_path
25261
- query_params[:'pagesCount'] = opts[:'pages_count'] if !opts[:'pages_count'].nil?
25262
25253
  query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
25263
25254
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
25264
25255
 
@@ -40,6 +40,9 @@ module AsposePdfCloud
40
40
  # Gets or sets the background image file.
41
41
  attr_accessor :background_image_file
42
42
 
43
+ # Gets or sets path of the background image file from storage.
44
+ attr_accessor :background_image_storage_file
45
+
43
46
  # Gets or sets the alignment.
44
47
  attr_accessor :alignment
45
48
 
@@ -64,6 +67,12 @@ module AsposePdfCloud
64
67
  # Gets or sets the column width.
65
68
  attr_accessor :width
66
69
 
70
+ # Gets or sets Html fragment.
71
+ attr_accessor :html_fragment
72
+
73
+ # Gets or sets ImageFragment list.
74
+ attr_accessor :images
75
+
67
76
 
68
77
  # Attribute mapping from ruby-style variable name to JSON key.
69
78
  def self.attribute_map
@@ -73,6 +82,7 @@ module AsposePdfCloud
73
82
  :'border' => :'Border',
74
83
  :'background_color' => :'BackgroundColor',
75
84
  :'background_image_file' => :'BackgroundImageFile',
85
+ :'background_image_storage_file' => :'BackgroundImageStorageFile',
76
86
  :'alignment' => :'Alignment',
77
87
  :'default_cell_text_state' => :'DefaultCellTextState',
78
88
  :'paragraphs' => :'Paragraphs',
@@ -80,7 +90,9 @@ module AsposePdfCloud
80
90
  :'vertical_alignment' => :'VerticalAlignment',
81
91
  :'col_span' => :'ColSpan',
82
92
  :'row_span' => :'RowSpan',
83
- :'width' => :'Width'
93
+ :'width' => :'Width',
94
+ :'html_fragment' => :'HtmlFragment',
95
+ :'images' => :'Images'
84
96
  }
85
97
  end
86
98
 
@@ -92,6 +104,7 @@ module AsposePdfCloud
92
104
  :'border' => :'BorderInfo',
93
105
  :'background_color' => :'Color',
94
106
  :'background_image_file' => :'String',
107
+ :'background_image_storage_file' => :'String',
95
108
  :'alignment' => :'HorizontalAlignment',
96
109
  :'default_cell_text_state' => :'TextState',
97
110
  :'paragraphs' => :'Array<TextRect>',
@@ -99,7 +112,9 @@ module AsposePdfCloud
99
112
  :'vertical_alignment' => :'VerticalAlignment',
100
113
  :'col_span' => :'Integer',
101
114
  :'row_span' => :'Integer',
102
- :'width' => :'Float'
115
+ :'width' => :'Float',
116
+ :'html_fragment' => :'String',
117
+ :'images' => :'Array<ImageFragment>'
103
118
  }
104
119
  end
105
120
 
@@ -131,6 +146,10 @@ module AsposePdfCloud
131
146
  self.background_image_file = attributes[:'BackgroundImageFile']
132
147
  end
133
148
 
149
+ if attributes.has_key?(:'BackgroundImageStorageFile')
150
+ self.background_image_storage_file = attributes[:'BackgroundImageStorageFile']
151
+ end
152
+
134
153
  if attributes.has_key?(:'Alignment')
135
154
  self.alignment = attributes[:'Alignment']
136
155
  end
@@ -165,6 +184,16 @@ module AsposePdfCloud
165
184
  self.width = attributes[:'Width']
166
185
  end
167
186
 
187
+ if attributes.has_key?(:'HtmlFragment')
188
+ self.html_fragment = attributes[:'HtmlFragment']
189
+ end
190
+
191
+ if attributes.has_key?(:'Images')
192
+ if (value = attributes[:'Images']).is_a?(Array)
193
+ self.images = value
194
+ end
195
+ end
196
+
168
197
  end
169
198
 
170
199
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -190,6 +219,7 @@ module AsposePdfCloud
190
219
  border == o.border &&
191
220
  background_color == o.background_color &&
192
221
  background_image_file == o.background_image_file &&
222
+ background_image_storage_file == o.background_image_storage_file &&
193
223
  alignment == o.alignment &&
194
224
  default_cell_text_state == o.default_cell_text_state &&
195
225
  paragraphs == o.paragraphs &&
@@ -197,7 +227,9 @@ module AsposePdfCloud
197
227
  vertical_alignment == o.vertical_alignment &&
198
228
  col_span == o.col_span &&
199
229
  row_span == o.row_span &&
200
- width == o.width
230
+ width == o.width &&
231
+ html_fragment == o.html_fragment &&
232
+ images == o.images
201
233
  end
202
234
 
203
235
  # @see the `==` method
@@ -209,7 +241,7 @@ module AsposePdfCloud
209
241
  # Calculates hash code according to all attributes.
210
242
  # @return [Fixnum] Hash code
211
243
  def hash
212
- [is_no_border, margin, border, background_color, background_image_file, alignment, default_cell_text_state, paragraphs, is_word_wrapped, vertical_alignment, col_span, row_span, width].hash
244
+ [is_no_border, margin, border, background_color, background_image_file, background_image_storage_file, alignment, default_cell_text_state, paragraphs, is_word_wrapped, vertical_alignment, col_span, row_span, width, html_fragment, images].hash
213
245
  end
214
246
 
215
247
  # Builds the object from hash
@@ -0,0 +1,283 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2020 Aspose.PDF Cloud
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ SOFTWARE.
19
+ --------------------------------------------------------------------------------------------------------------------
20
+ =end
21
+
22
+ require 'date'
23
+ require 'time'
24
+
25
+ module AsposePdfCloud
26
+ # Represents Image Fragment DTO.
27
+ class ImageFragment
28
+ # Gets or sets full storage path of image.
29
+ attr_accessor :image_file
30
+
31
+ # Gets or sets fix width of the image.
32
+ attr_accessor :fix_width
33
+
34
+ # Gets or sets fix height of the image.
35
+ attr_accessor :fix_height
36
+
37
+ # Gets or sets horizontal alignment of the image.
38
+ attr_accessor :horizontal_alignment
39
+
40
+ # Gets or sets vertical alignment of the image.
41
+ attr_accessor :vertical_alignment
42
+
43
+ # Gets or sets ImageScale of the image.
44
+ attr_accessor :image_scale
45
+
46
+ # Gets or sets Margin of the image.
47
+ attr_accessor :margin
48
+
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'image_file' => :'ImageFile',
54
+ :'fix_width' => :'FixWidth',
55
+ :'fix_height' => :'FixHeight',
56
+ :'horizontal_alignment' => :'HorizontalAlignment',
57
+ :'vertical_alignment' => :'VerticalAlignment',
58
+ :'image_scale' => :'ImageScale',
59
+ :'margin' => :'Margin'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'image_file' => :'String',
67
+ :'fix_width' => :'Float',
68
+ :'fix_height' => :'Float',
69
+ :'horizontal_alignment' => :'HorizontalAlignment',
70
+ :'vertical_alignment' => :'VerticalAlignment',
71
+ :'image_scale' => :'Float',
72
+ :'margin' => :'MarginInfo'
73
+ }
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
+
84
+ if attributes.has_key?(:'ImageFile')
85
+ self.image_file = attributes[:'ImageFile']
86
+ end
87
+
88
+ if attributes.has_key?(:'FixWidth')
89
+ self.fix_width = attributes[:'FixWidth']
90
+ end
91
+
92
+ if attributes.has_key?(:'FixHeight')
93
+ self.fix_height = attributes[:'FixHeight']
94
+ end
95
+
96
+ if attributes.has_key?(:'HorizontalAlignment')
97
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
98
+ end
99
+
100
+ if attributes.has_key?(:'VerticalAlignment')
101
+ self.vertical_alignment = attributes[:'VerticalAlignment']
102
+ end
103
+
104
+ if attributes.has_key?(:'ImageScale')
105
+ self.image_scale = attributes[:'ImageScale']
106
+ end
107
+
108
+ if attributes.has_key?(:'Margin')
109
+ self.margin = attributes[:'Margin']
110
+ end
111
+
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properies with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ if @image_file.nil?
119
+ invalid_properties.push("invalid value for 'image_file', image_file cannot be nil.")
120
+ end
121
+
122
+ if @image_file.to_s.length < 1
123
+ invalid_properties.push("invalid value for 'image_file', the character length must be great than or equal to 1.")
124
+ end
125
+
126
+ return invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ return false if @image_file.nil?
133
+ return false if @image_file.to_s.length < 1
134
+ return true
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] image_file Value to be assigned
139
+ def image_file=(image_file)
140
+ if image_file.nil?
141
+ fail ArgumentError, "image_file cannot be nil"
142
+ end
143
+
144
+ if image_file.to_s.length < 1
145
+ fail ArgumentError, "invalid value for 'image_file', the character length must be great than or equal to 1."
146
+ end
147
+
148
+ @image_file = image_file
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ image_file == o.image_file &&
157
+ fix_width == o.fix_width &&
158
+ fix_height == o.fix_height &&
159
+ horizontal_alignment == o.horizontal_alignment &&
160
+ vertical_alignment == o.vertical_alignment &&
161
+ image_scale == o.image_scale &&
162
+ margin == o.margin
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Fixnum] Hash code
173
+ def hash
174
+ [image_file, fix_width, fix_height, horizontal_alignment, vertical_alignment, image_scale, margin].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ self.class.swagger_types.each_pair do |key, type|
183
+ if type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
187
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
188
+ end
189
+ elsif !attributes[self.class.attribute_map[key]].nil?
190
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def _deserialize(type, value)
202
+ case type.to_sym
203
+ when :DateTime
204
+ DateTime.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :BOOLEAN
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ temp_model = AsposePdfCloud.const_get(type).new
235
+ temp_model.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ next if value.nil?
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map{ |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end
@@ -20,5 +20,5 @@ SOFTWARE.
20
20
  =end
21
21
 
22
22
  module AsposePdfCloud
23
- VERSION = "20.2.0"
23
+ VERSION = "20.4.0"
24
24
  end
@@ -389,82 +389,121 @@ class PdfTests < Minitest::Test
389
389
  end
390
390
 
391
391
  def __draw_table
392
-
393
- text_state = TextState.new
394
- text_state.font = 'Arial'
395
- text_state.font_size = 10
396
- text_state.foreground_color = Color.new({:A => 0xFF, :R => 0, :G => 0xFF, :B => 0})
397
- text_state.background_color = Color.new({:A => 0xFF, :R => 0xFF, :G => 0, :B => 0})
398
- text_state.font_style = FontStyles::BOLD
399
-
400
- num_of_cols = 5
401
- num_of_rows = 5
402
-
403
- table = Table.new
404
- table.rows = Array.new(num_of_rows)
405
-
406
- col_widths = '';
407
- (1..num_of_cols).each do
408
- col_widths += ' 30'
409
- end
410
-
411
- table.column_widths = col_widths
412
-
413
- table.default_cell_text_state = text_state
414
-
415
- border_table_border = GraphInfo.new
416
-
417
- border_table_border.color = Color.new({:A => 0xFF, :R => 0, :G => 0xFF, :B => 0xFF})
418
- border_table_border.line_width = 1
419
-
420
- border_info = BorderInfo.new
421
- border_info.top = border_table_border
422
- border_info.right = border_table_border
423
- border_info.bottom = border_table_border
424
- border_info.left = border_table_border
425
-
426
- table.default_cell_border = border_info
427
- table.top = 100
428
-
429
-
430
-
431
- (0..(num_of_rows - 1)).each do |r|
432
- row = Row.new
433
- row.cells = Array.new(num_of_cols)
434
-
435
- (0..(num_of_rows - 1)).each do |c|
436
- cell = Cell.new
437
- cell.background_color = Color.new({:A => 0xFF, :R => 0xFF, :G => 0, :B => 0xFF})
438
- cell.default_cell_text_state = text_state
439
- cell.paragraphs = Array.new(1)
440
- cell.paragraphs[0] = TextRect.new({:Text => 'value'})
441
-
442
- # change properties on cell
443
-
444
- if c == 1
445
- cell.default_cell_text_state.foreground_color = Color.new({:A => 0xFF, :R => 0xFF, :G => 0, :B => 0xFF})
446
-
447
- # change properties on cell AFTER first clearing and re-adding paragraphs
448
- elsif c == 2
449
- cell.paragraphs[0] = TextRect.new({:Text => 'y'})
450
- cell.default_cell_text_state.foreground_color = Color.new({:A => 0xFF, :R => 0, :G => 0, :B => 0xFF})
451
-
452
- #change properties on paragraph
453
- elsif c == 3
454
- cell.paragraphs[0].text_state = text_state
455
- cell.paragraphs[0].text_state.foreground_color = Color.new({:A => 0xFF, :R => 0, :G => 0, :B => 0xFF})
456
-
457
- # change properties on paragraph AFTER first clearing and re-adding paragraphs
458
- elsif c == 4
459
- cell.paragraphs[0] = TextRect.new({:Text => 'y'})
460
- cell.paragraphs[0].text_state = text_state
461
- cell.paragraphs[0].text_state.foreground_color = Color.new({:A => 0xFF, :R => 0, :G => 0, :B => 0xFF})
462
- end
463
-
464
- row.cells[c] = cell
465
- end
466
- table.rows[r] = row
467
- end
392
+ colorBlack = Color.new({:A => 0xFF, :R => 0, :G => 0, :B => 0})
393
+ borderGraphInfo = GraphInfo.new({:Color => colorBlack, :LineWidth => 1})
394
+ image = 'Penguins.jpg'
395
+ table = Table.new({
396
+ :Top => 100,
397
+ :ColumnWidths => '150 300',
398
+ :IsBordersIncluded => true,
399
+ :DefaultCellTextState => TextState.new({:FontSize => 11, :ForegroundColor => Color.new({:A => 255, :R => 0, :G => 255, :B => 0})}),
400
+ :Margin => MarginInfo.new({
401
+ :Bottom => 10,
402
+ :Left => 10,
403
+ :Right => 10,
404
+ :Top => 10
405
+ }),
406
+ :Border => BorderInfo.new({
407
+ :Top => borderGraphInfo,
408
+ :Left => borderGraphInfo
409
+ }),
410
+ :DefaultCellBorder => BorderInfo.new({
411
+ :Right => borderGraphInfo,
412
+ }),
413
+ :DefaultCellPadding => MarginInfo.new({
414
+ :Top => 5,
415
+ :Left => 5,
416
+ :Right => 5,
417
+ :Bottom => 5,
418
+ }),
419
+ :Rows => [
420
+ Row.new({
421
+ :MinRowHeight => 100,
422
+ :Border => BorderInfo.new({
423
+ :Bottom => borderGraphInfo,
424
+ }),
425
+ :Cells => [
426
+ Cell.new({
427
+ :Paragraphs => [
428
+ TextRect.new({
429
+ :Text => 'BackgroundImageStorageFile field, from storage file',
430
+ :HorizontalAlignment => HorizontalAlignment::CENTER,
431
+ :TextState => TextState.new({:FontSize => 10, :ForegroundColor => Color.new({:A => 0xff, :R => 0x3d, :G => 0x8e, :B =>0xc4})}),
432
+ })
433
+ ]
434
+ }),
435
+ Cell.new({
436
+ :BackgroundColor => colorBlack,
437
+ :BackgroundImageStorageFile => "#{@temp_folder}/#{image}"
438
+ })
439
+ ]
440
+ }),
441
+ Row.new({
442
+ :MinRowHeight => 100,
443
+ :Border => BorderInfo.new({:Bottom => borderGraphInfo}),
444
+ :Cells => [
445
+ Cell.new({
446
+ :Paragraphs => [
447
+ TextRect.new({
448
+ :Text => 'HtmlFragment',
449
+ :HorizontalAlignment => HorizontalAlignment::CENTER,
450
+ :TextState => TextState.new({
451
+ :FontSize => 10,
452
+ :ForegroundColor => Color.new({:A => 255, :R => 0x3d, :G => 0x8e, :B => 0xc4}),
453
+ })
454
+ })
455
+ ]
456
+ }),
457
+ Cell.new({:HtmlFragment => '<ul><li>First</li><li>Second</li></ul>'}),
458
+ ]
459
+ }),
460
+ Row.new({
461
+ :FixedRowHeight => 100,
462
+ :Border => BorderInfo.new({:Bottom => borderGraphInfo}),
463
+ :Cells => [
464
+ Cell.new({
465
+ :Paragraphs => [
466
+ TextRect.new({:Text => 'FixedRowHeight = 100'}),
467
+ TextRect.new({
468
+ :Text => 'Images field, from storage file, without Margin and Size',
469
+ :HorizontalAlignment => HorizontalAlignment::CENTER,
470
+ :TextState => TextState.new({:FontSize => 10, :ForegroundColor => Color.new({:A => 255, :R => 0x3d, :G => 0x8e, :B => 0xc4})}),
471
+ })
472
+ ]
473
+ }),
474
+ Cell.new({
475
+ :BackgroundColor => colorBlack,
476
+ :Images => [ImageFragment.new({ImageFile: "#{@temp_folder}/#{image}"})]
477
+ })
478
+ ]
479
+ }),
480
+ Row.new({
481
+ :FixedRowHeight => 100,
482
+ :Border => BorderInfo.new({:Bottom => borderGraphInfo}),
483
+ :Cells => [
484
+ Cell.new({
485
+ :Paragraphs => [
486
+ TextRect.new({:Text => 'FixedRowHeight = 100'}),
487
+ TextRect.new({
488
+ :Text => 'Images field, from storage file, with no Margin and Size = 150x50',
489
+ :HorizontalAlignment => HorizontalAlignment::CENTER,
490
+ :TextState => TextState.new({:FontSize => 10, :ForegroundColor => Color.new({:A => 255, :R => 0x3d, :G => 0x8e, :B => 0xc4})})
491
+ })
492
+ ]
493
+ }),
494
+ Cell.new({
495
+ :BackgroundColor => colorBlack,
496
+ :Images => [
497
+ ImageFragment.new({
498
+ :ImageFile => "#{@temp_folder}/#{image}",
499
+ :ImageScale => 0.1
500
+ })
501
+ ]
502
+ })
503
+ ]
504
+ })
505
+ ]
506
+ })
468
507
  table
469
508
  end
470
509
 
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.2.0
4
+ version: 20.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: 2020-02-18 00:00:00.000000000 Z
11
+ date: 2020-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -176,6 +176,7 @@ files:
176
176
  - docs/HtmlMarkupGenerationModes.md
177
177
  - docs/Image.md
178
178
  - docs/ImageFooter.md
179
+ - docs/ImageFragment.md
179
180
  - docs/ImageHeader.md
180
181
  - docs/ImageResponse.md
181
182
  - docs/ImageSrcType.md
@@ -458,6 +459,7 @@ files:
458
459
  - lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb
459
460
  - lib/aspose_pdf_cloud/models/image.rb
460
461
  - lib/aspose_pdf_cloud/models/image_footer.rb
462
+ - lib/aspose_pdf_cloud/models/image_fragment.rb
461
463
  - lib/aspose_pdf_cloud/models/image_header.rb
462
464
  - lib/aspose_pdf_cloud/models/image_response.rb
463
465
  - lib/aspose_pdf_cloud/models/image_src_type.rb