aspose_pdf_cloud 25.3.0 → 25.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: aaec8fc461525e716118d03203a605b18fbe3864946c87a7796c4e08758ec826
4
- data.tar.gz: 3353a017f8c5f93491ee0e6987b70f3c085331db635d927f61144e7fec1e3c35
3
+ metadata.gz: 8bfd44640900db5a437f006bf094007227c4ce19d05fa6e68670eb05f5fa243f
4
+ data.tar.gz: 2d55140414f45c0314e2f5e98d67d3bafb8d62f1b1c08733bd844bd08b3f373c
5
5
  SHA512:
6
- metadata.gz: 196124de881dc16658e42bccdd73c2e65711e5bf3a3c65d995cc3a4e748c9236da765ccc1e4628dbea2f9fccc374a46afed0c721a2c25bc8a0b995142af7abea
7
- data.tar.gz: 2dc1ca8f846349442cc217e69e1218f0c12c20e33dd36e9428e7fd798c17daccc610fdf70c827fdc15962dddbac5d80f3a015c609694522ce36fe628a96113c9
6
+ metadata.gz: ca7f01dc8a7b1bc8f01375e99577cd3f7ea7dbb2f08d3e3c97b90f4dea39921106b26d8571545932692f3727032207c74d57696b4b693f0a1ecf510a9f8205dc
7
+ data.tar.gz: 7ce2a92fa489bb3fd1fb83b82383922ed9c36472ce5d70e112e59b0031968ef56892bfe91251c8c83162d3167f44cc17c80099ad9fed5280037a9f80756c1045
@@ -16083,6 +16083,86 @@ module AsposePdfCloud
16083
16083
  return data, status_code, headers
16084
16084
  end
16085
16085
 
16086
+ # Add document image stamps to specified pages.
16087
+ #
16088
+ # @param name The document name.
16089
+ # @param stamps The array of stamps.
16090
+ # @param [Hash] opts the optional parameters
16091
+ # @option opts [String] :storage The document storage.
16092
+ # @option opts [String] :folder The document folder.
16093
+ # @option opts [String] :password Base64 encoded password.
16094
+ # @return [AsposeResponse]
16095
+ def post_document_image_stamps_page_specified(name, stamps, opts = {})
16096
+ @api_client.request_token_if_needed
16097
+ data, _status_code, _headers = post_document_image_stamps_page_specified_with_http_info(name, stamps, opts)
16098
+ rescue ApiError => error
16099
+ if error.code == 401
16100
+ @api_client.request_token_if_needed
16101
+ data, _status_code, _headers = post_document_image_stamps_page_specified_with_http_info(name, stamps, opts)
16102
+ else
16103
+ raise
16104
+ end
16105
+ return data
16106
+ end
16107
+
16108
+ # Add document image stamps to specified pages.
16109
+ #
16110
+ # @param name The document name.
16111
+ # @param stamps The array of stamps.
16112
+ # @param [Hash] opts the optional parameters
16113
+ # @option opts [String] :storage The document storage.
16114
+ # @option opts [String] :folder The document folder.
16115
+ # @option opts [String] :password Base64 encoded password.
16116
+ # @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
16117
+ def post_document_image_stamps_page_specified_with_http_info(name, stamps, opts = {})
16118
+ if @api_client.config.debugging
16119
+ @api_client.config.logger.debug "Calling API: PdfApi.post_document_image_stamps_page_specified ..."
16120
+ end
16121
+ # verify the required parameter 'name' is set
16122
+ if @api_client.config.client_side_validation && name.nil?
16123
+ fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_image_stamps_page_specified"
16124
+ end
16125
+ # verify the required parameter 'stamps' is set
16126
+ if @api_client.config.client_side_validation && stamps.nil?
16127
+ fail ArgumentError, "Missing the required parameter 'stamps' when calling PdfApi.post_document_image_stamps_page_specified"
16128
+ end
16129
+ # resource path
16130
+ local_var_path = "/pdf/{name}/stamps/image/pagespecified".sub('{' + 'name' + '}', name.to_s)
16131
+
16132
+ # query parameters
16133
+ query_params = {}
16134
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
16135
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
16136
+ query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
16137
+
16138
+ # header parameters
16139
+ header_params = {}
16140
+ # HTTP header 'Accept' (if needed)
16141
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
16142
+ # HTTP header 'Content-Type'
16143
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
16144
+
16145
+ # form parameters
16146
+ form_params = {}
16147
+ # Fix header in file
16148
+ post_body = nil
16149
+
16150
+ # http body (model)
16151
+ post_body = @api_client.object_to_http_body(stamps)
16152
+ auth_names = ['JWT']
16153
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
16154
+ :header_params => header_params,
16155
+ :query_params => query_params,
16156
+ :form_params => form_params,
16157
+ :body => post_body,
16158
+ :auth_names => auth_names,
16159
+ :return_type => 'AsposeResponse')
16160
+ if @api_client.config.debugging
16161
+ @api_client.config.logger.debug "API called: PdfApi#post_document_image_stamps_page_specified\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
16162
+ end
16163
+ return data, status_code, headers
16164
+ end
16165
+
16086
16166
  # Add document page number stamps.
16087
16167
  #
16088
16168
  # @param name The document name.
@@ -16492,6 +16572,86 @@ module AsposePdfCloud
16492
16572
  return data, status_code, headers
16493
16573
  end
16494
16574
 
16575
+ # Add document text stamps to specified pages.
16576
+ #
16577
+ # @param name The document name.
16578
+ # @param stamps The array of stamps.
16579
+ # @param [Hash] opts the optional parameters
16580
+ # @option opts [String] :storage The document storage.
16581
+ # @option opts [String] :folder The document folder.
16582
+ # @option opts [String] :password Base64 encoded password.
16583
+ # @return [AsposeResponse]
16584
+ def post_document_text_stamps_page_specified(name, stamps, opts = {})
16585
+ @api_client.request_token_if_needed
16586
+ data, _status_code, _headers = post_document_text_stamps_page_specified_with_http_info(name, stamps, opts)
16587
+ rescue ApiError => error
16588
+ if error.code == 401
16589
+ @api_client.request_token_if_needed
16590
+ data, _status_code, _headers = post_document_text_stamps_page_specified_with_http_info(name, stamps, opts)
16591
+ else
16592
+ raise
16593
+ end
16594
+ return data
16595
+ end
16596
+
16597
+ # Add document text stamps to specified pages.
16598
+ #
16599
+ # @param name The document name.
16600
+ # @param stamps The array of stamps.
16601
+ # @param [Hash] opts the optional parameters
16602
+ # @option opts [String] :storage The document storage.
16603
+ # @option opts [String] :folder The document folder.
16604
+ # @option opts [String] :password Base64 encoded password.
16605
+ # @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
16606
+ def post_document_text_stamps_page_specified_with_http_info(name, stamps, opts = {})
16607
+ if @api_client.config.debugging
16608
+ @api_client.config.logger.debug "Calling API: PdfApi.post_document_text_stamps_page_specified ..."
16609
+ end
16610
+ # verify the required parameter 'name' is set
16611
+ if @api_client.config.client_side_validation && name.nil?
16612
+ fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_text_stamps_page_specified"
16613
+ end
16614
+ # verify the required parameter 'stamps' is set
16615
+ if @api_client.config.client_side_validation && stamps.nil?
16616
+ fail ArgumentError, "Missing the required parameter 'stamps' when calling PdfApi.post_document_text_stamps_page_specified"
16617
+ end
16618
+ # resource path
16619
+ local_var_path = "/pdf/{name}/stamps/text/pagespecified".sub('{' + 'name' + '}', name.to_s)
16620
+
16621
+ # query parameters
16622
+ query_params = {}
16623
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
16624
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
16625
+ query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
16626
+
16627
+ # header parameters
16628
+ header_params = {}
16629
+ # HTTP header 'Accept' (if needed)
16630
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
16631
+ # HTTP header 'Content-Type'
16632
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
16633
+
16634
+ # form parameters
16635
+ form_params = {}
16636
+ # Fix header in file
16637
+ post_body = nil
16638
+
16639
+ # http body (model)
16640
+ post_body = @api_client.object_to_http_body(stamps)
16641
+ auth_names = ['JWT']
16642
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
16643
+ :header_params => header_params,
16644
+ :query_params => query_params,
16645
+ :form_params => form_params,
16646
+ :body => post_body,
16647
+ :auth_names => auth_names,
16648
+ :return_type => 'AsposeResponse')
16649
+ if @api_client.config.debugging
16650
+ @api_client.config.logger.debug "API called: PdfApi#post_document_text_stamps_page_specified\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
16651
+ end
16652
+ return data, status_code, headers
16653
+ end
16654
+
16495
16655
  # Encrypt document in storage.
16496
16656
  #
16497
16657
  # @param name Document name.
@@ -0,0 +1,376 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2025 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 Pdf stamps.
27
+ class ImageStampPageSpecified
28
+ # Link to the document.
29
+ attr_accessor :links
30
+
31
+ # Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top.
32
+ attr_accessor :background
33
+
34
+ # Gets or sets Horizontal alignment of stamp on the page.
35
+ attr_accessor :horizontal_alignment
36
+
37
+ # Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0.
38
+ attr_accessor :opacity
39
+
40
+ # Sets or gets the rotation of stamp content according Rotation values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None.
41
+ attr_accessor :rotate
42
+
43
+ # Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle.
44
+ attr_accessor :rotate_angle
45
+
46
+ # Horizontal stamp coordinate, starting from the left.
47
+ attr_accessor :x_indent
48
+
49
+ # Vertical stamp coordinate, starting from the bottom.
50
+ attr_accessor :y_indent
51
+
52
+ # Zooming factor of the stamp. Allows to scale stamp.
53
+ attr_accessor :zoom
54
+
55
+ # Gets or sets the file name.
56
+ attr_accessor :file_name
57
+
58
+ # Gets or sets image width. Setting this property allos to scal image horizontally.
59
+ attr_accessor :width
60
+
61
+ # Gets or sets image height. Setting this image allows to scale image vertically.
62
+ attr_accessor :height
63
+
64
+ # Gets or sets vertical alignment of stamp on page.
65
+ attr_accessor :vertical_alignment
66
+
67
+ # Gets or sets bottom margin of stamp.
68
+ attr_accessor :bottom_margin
69
+
70
+ # Gets or sets left margin of stamp.
71
+ attr_accessor :left_margin
72
+
73
+ # Gets or sets top margin of stamp.
74
+ attr_accessor :top_margin
75
+
76
+ # Gets or sets right margin of stamp.
77
+ attr_accessor :right_margin
78
+
79
+ # Page number.
80
+ attr_accessor :page_number
81
+
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'links' => :'Links',
87
+ :'background' => :'Background',
88
+ :'horizontal_alignment' => :'HorizontalAlignment',
89
+ :'opacity' => :'Opacity',
90
+ :'rotate' => :'Rotate',
91
+ :'rotate_angle' => :'RotateAngle',
92
+ :'x_indent' => :'XIndent',
93
+ :'y_indent' => :'YIndent',
94
+ :'zoom' => :'Zoom',
95
+ :'file_name' => :'FileName',
96
+ :'width' => :'Width',
97
+ :'height' => :'Height',
98
+ :'vertical_alignment' => :'VerticalAlignment',
99
+ :'bottom_margin' => :'BottomMargin',
100
+ :'left_margin' => :'LeftMargin',
101
+ :'top_margin' => :'TopMargin',
102
+ :'right_margin' => :'RightMargin',
103
+ :'page_number' => :'PageNumber'
104
+ }
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.swagger_types
109
+ {
110
+ :'links' => :'Array<Link>',
111
+ :'background' => :'BOOLEAN',
112
+ :'horizontal_alignment' => :'HorizontalAlignment',
113
+ :'opacity' => :'Float',
114
+ :'rotate' => :'Rotation',
115
+ :'rotate_angle' => :'Float',
116
+ :'x_indent' => :'Float',
117
+ :'y_indent' => :'Float',
118
+ :'zoom' => :'Float',
119
+ :'file_name' => :'String',
120
+ :'width' => :'Float',
121
+ :'height' => :'Float',
122
+ :'vertical_alignment' => :'VerticalAlignment',
123
+ :'bottom_margin' => :'Float',
124
+ :'left_margin' => :'Float',
125
+ :'top_margin' => :'Float',
126
+ :'right_margin' => :'Float',
127
+ :'page_number' => :'Integer'
128
+ }
129
+ end
130
+
131
+ # Initializes the object
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ def initialize(attributes = {})
134
+ return unless attributes.is_a?(Hash)
135
+
136
+ # convert string to symbol for hash key
137
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
138
+
139
+ if attributes.has_key?(:'Links')
140
+ if (value = attributes[:'Links']).is_a?(Array)
141
+ self.links = value
142
+ end
143
+ end
144
+
145
+ if attributes.has_key?(:'Background')
146
+ self.background = attributes[:'Background']
147
+ end
148
+
149
+ if attributes.has_key?(:'HorizontalAlignment')
150
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
151
+ end
152
+
153
+ if attributes.has_key?(:'Opacity')
154
+ self.opacity = attributes[:'Opacity']
155
+ end
156
+
157
+ if attributes.has_key?(:'Rotate')
158
+ self.rotate = attributes[:'Rotate']
159
+ end
160
+
161
+ if attributes.has_key?(:'RotateAngle')
162
+ self.rotate_angle = attributes[:'RotateAngle']
163
+ end
164
+
165
+ if attributes.has_key?(:'XIndent')
166
+ self.x_indent = attributes[:'XIndent']
167
+ end
168
+
169
+ if attributes.has_key?(:'YIndent')
170
+ self.y_indent = attributes[:'YIndent']
171
+ end
172
+
173
+ if attributes.has_key?(:'Zoom')
174
+ self.zoom = attributes[:'Zoom']
175
+ end
176
+
177
+ if attributes.has_key?(:'FileName')
178
+ self.file_name = attributes[:'FileName']
179
+ end
180
+
181
+ if attributes.has_key?(:'Width')
182
+ self.width = attributes[:'Width']
183
+ end
184
+
185
+ if attributes.has_key?(:'Height')
186
+ self.height = attributes[:'Height']
187
+ end
188
+
189
+ if attributes.has_key?(:'VerticalAlignment')
190
+ self.vertical_alignment = attributes[:'VerticalAlignment']
191
+ end
192
+
193
+ if attributes.has_key?(:'BottomMargin')
194
+ self.bottom_margin = attributes[:'BottomMargin']
195
+ end
196
+
197
+ if attributes.has_key?(:'LeftMargin')
198
+ self.left_margin = attributes[:'LeftMargin']
199
+ end
200
+
201
+ if attributes.has_key?(:'TopMargin')
202
+ self.top_margin = attributes[:'TopMargin']
203
+ end
204
+
205
+ if attributes.has_key?(:'RightMargin')
206
+ self.right_margin = attributes[:'RightMargin']
207
+ end
208
+
209
+ if attributes.has_key?(:'PageNumber')
210
+ self.page_number = attributes[:'PageNumber']
211
+ end
212
+
213
+ end
214
+
215
+ # Show invalid properties with the reasons. Usually used together with valid?
216
+ # @return Array for valid properies with the reasons
217
+ def list_invalid_properties
218
+ invalid_properties = Array.new
219
+ if @page_number.nil?
220
+ invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
221
+ end
222
+
223
+ return invalid_properties
224
+ end
225
+
226
+ # Check to see if the all the properties in the model are valid
227
+ # @return true if the model is valid
228
+ def valid?
229
+ return false if @page_number.nil?
230
+ return true
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ links == o.links &&
239
+ background == o.background &&
240
+ horizontal_alignment == o.horizontal_alignment &&
241
+ opacity == o.opacity &&
242
+ rotate == o.rotate &&
243
+ rotate_angle == o.rotate_angle &&
244
+ x_indent == o.x_indent &&
245
+ y_indent == o.y_indent &&
246
+ zoom == o.zoom &&
247
+ file_name == o.file_name &&
248
+ width == o.width &&
249
+ height == o.height &&
250
+ vertical_alignment == o.vertical_alignment &&
251
+ bottom_margin == o.bottom_margin &&
252
+ left_margin == o.left_margin &&
253
+ top_margin == o.top_margin &&
254
+ right_margin == o.right_margin &&
255
+ page_number == o.page_number
256
+ end
257
+
258
+ # @see the `==` method
259
+ # @param [Object] Object to be compared
260
+ def eql?(o)
261
+ self == o
262
+ end
263
+
264
+ # Calculates hash code according to all attributes.
265
+ # @return [Fixnum] Hash code
266
+ def hash
267
+ [links, background, horizontal_alignment, opacity, rotate, rotate_angle, x_indent, y_indent, zoom, file_name, width, height, vertical_alignment, bottom_margin, left_margin, top_margin, right_margin, page_number].hash
268
+ end
269
+
270
+ # Builds the object from hash
271
+ # @param [Hash] attributes Model attributes in the form of hash
272
+ # @return [Object] Returns the model itself
273
+ def build_from_hash(attributes)
274
+ return nil unless attributes.is_a?(Hash)
275
+ self.class.swagger_types.each_pair do |key, type|
276
+ if type =~ /\AArray<(.*)>/i
277
+ # check to ensure the input is an array given that the the attribute
278
+ # is documented as an array but the input is not
279
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
280
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
281
+ end
282
+ elsif !attributes[self.class.attribute_map[key]].nil?
283
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
284
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
285
+ end
286
+
287
+ self
288
+ end
289
+
290
+ # Deserializes the data based on type
291
+ # @param string type Data type
292
+ # @param string value Value to be deserialized
293
+ # @return [Object] Deserialized data
294
+ def _deserialize(type, value)
295
+ case type.to_sym
296
+ when :DateTime
297
+ DateTime.parse(value)
298
+ when :Date
299
+ Date.parse(value)
300
+ when :String
301
+ value.to_s
302
+ when :Integer
303
+ value.to_i
304
+ when :Float
305
+ value.to_f
306
+ when :BOOLEAN
307
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
308
+ true
309
+ else
310
+ false
311
+ end
312
+ when :Object
313
+ # generic object (usually a Hash), return directly
314
+ value
315
+ when /\AArray<(?<inner_type>.+)>\z/
316
+ inner_type = Regexp.last_match[:inner_type]
317
+ value.map { |v| _deserialize(inner_type, v) }
318
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
319
+ k_type = Regexp.last_match[:k_type]
320
+ v_type = Regexp.last_match[:v_type]
321
+ {}.tap do |hash|
322
+ value.each do |k, v|
323
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
324
+ end
325
+ end
326
+ else # model
327
+ temp_model = AsposePdfCloud.const_get(type).new
328
+ temp_model.build_from_hash(value)
329
+ end
330
+ end
331
+
332
+ # Returns the string representation of the object
333
+ # @return [String] String presentation of the object
334
+ def to_s
335
+ to_hash.to_s
336
+ end
337
+
338
+ # to_body is an alias to to_hash (backward compatibility)
339
+ # @return [Hash] Returns the object in the form of hash
340
+ def to_body
341
+ to_hash
342
+ end
343
+
344
+ # Returns the object in the form of hash
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_hash
347
+ hash = {}
348
+ self.class.attribute_map.each_pair do |attr, param|
349
+ value = self.send(attr)
350
+ next if value.nil?
351
+ hash[param] = _to_hash(value)
352
+ end
353
+ hash
354
+ end
355
+
356
+ # Outputs non-array value in the form of hash
357
+ # For object, use to_hash. Otherwise, just return the value
358
+ # @param [Object] value Any valid value
359
+ # @return [Hash] Returns the value in the form of hash
360
+ def _to_hash(value)
361
+ if value.is_a?(Array)
362
+ value.compact.map{ |v| _to_hash(v) }
363
+ elsif value.is_a?(Hash)
364
+ {}.tap do |hash|
365
+ value.each { |k, v| hash[k] = _to_hash(v) }
366
+ end
367
+ elsif value.respond_to? :to_hash
368
+ value.to_hash
369
+ else
370
+ value
371
+ end
372
+ end
373
+
374
+ end
375
+
376
+ end
@@ -0,0 +1,376 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ Copyright (c) 2025 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 Pdf stamps.
27
+ class TextStampPageSpecified
28
+ # Link to the document.
29
+ attr_accessor :links
30
+
31
+ # Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top.
32
+ attr_accessor :background
33
+
34
+ # Gets or sets Horizontal alignment of stamp on the page.
35
+ attr_accessor :horizontal_alignment
36
+
37
+ # Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0.
38
+ attr_accessor :opacity
39
+
40
+ # Sets or gets the rotation of stamp content according Rotation values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None.
41
+ attr_accessor :rotate
42
+
43
+ # Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle.
44
+ attr_accessor :rotate_angle
45
+
46
+ # Horizontal stamp coordinate, starting from the left.
47
+ attr_accessor :x_indent
48
+
49
+ # Vertical stamp coordinate, starting from the bottom.
50
+ attr_accessor :y_indent
51
+
52
+ # Zooming factor of the stamp. Allows to scale stamp.
53
+ attr_accessor :zoom
54
+
55
+ # Alignment of the text inside the stamp.
56
+ attr_accessor :text_alignment
57
+
58
+ # Gets or sets string value which is used as stamp on the page.
59
+ attr_accessor :value
60
+
61
+ # Gets text properties of the stamp. See TextState for details.
62
+ attr_accessor :text_state
63
+
64
+ # Gets or sets vertical alignment of stamp on page.
65
+ attr_accessor :vertical_alignment
66
+
67
+ # Gets or sets bottom margin of stamp.
68
+ attr_accessor :bottom_margin
69
+
70
+ # Gets or sets left margin of stamp.
71
+ attr_accessor :left_margin
72
+
73
+ # Gets or sets top margin of stamp.
74
+ attr_accessor :top_margin
75
+
76
+ # Gets or sets right margin of stamp.
77
+ attr_accessor :right_margin
78
+
79
+ # Page number.
80
+ attr_accessor :page_number
81
+
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'links' => :'Links',
87
+ :'background' => :'Background',
88
+ :'horizontal_alignment' => :'HorizontalAlignment',
89
+ :'opacity' => :'Opacity',
90
+ :'rotate' => :'Rotate',
91
+ :'rotate_angle' => :'RotateAngle',
92
+ :'x_indent' => :'XIndent',
93
+ :'y_indent' => :'YIndent',
94
+ :'zoom' => :'Zoom',
95
+ :'text_alignment' => :'TextAlignment',
96
+ :'value' => :'Value',
97
+ :'text_state' => :'TextState',
98
+ :'vertical_alignment' => :'VerticalAlignment',
99
+ :'bottom_margin' => :'BottomMargin',
100
+ :'left_margin' => :'LeftMargin',
101
+ :'top_margin' => :'TopMargin',
102
+ :'right_margin' => :'RightMargin',
103
+ :'page_number' => :'PageNumber'
104
+ }
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.swagger_types
109
+ {
110
+ :'links' => :'Array<Link>',
111
+ :'background' => :'BOOLEAN',
112
+ :'horizontal_alignment' => :'HorizontalAlignment',
113
+ :'opacity' => :'Float',
114
+ :'rotate' => :'Rotation',
115
+ :'rotate_angle' => :'Float',
116
+ :'x_indent' => :'Float',
117
+ :'y_indent' => :'Float',
118
+ :'zoom' => :'Float',
119
+ :'text_alignment' => :'HorizontalAlignment',
120
+ :'value' => :'String',
121
+ :'text_state' => :'TextState',
122
+ :'vertical_alignment' => :'VerticalAlignment',
123
+ :'bottom_margin' => :'Float',
124
+ :'left_margin' => :'Float',
125
+ :'top_margin' => :'Float',
126
+ :'right_margin' => :'Float',
127
+ :'page_number' => :'Integer'
128
+ }
129
+ end
130
+
131
+ # Initializes the object
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ def initialize(attributes = {})
134
+ return unless attributes.is_a?(Hash)
135
+
136
+ # convert string to symbol for hash key
137
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
138
+
139
+ if attributes.has_key?(:'Links')
140
+ if (value = attributes[:'Links']).is_a?(Array)
141
+ self.links = value
142
+ end
143
+ end
144
+
145
+ if attributes.has_key?(:'Background')
146
+ self.background = attributes[:'Background']
147
+ end
148
+
149
+ if attributes.has_key?(:'HorizontalAlignment')
150
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
151
+ end
152
+
153
+ if attributes.has_key?(:'Opacity')
154
+ self.opacity = attributes[:'Opacity']
155
+ end
156
+
157
+ if attributes.has_key?(:'Rotate')
158
+ self.rotate = attributes[:'Rotate']
159
+ end
160
+
161
+ if attributes.has_key?(:'RotateAngle')
162
+ self.rotate_angle = attributes[:'RotateAngle']
163
+ end
164
+
165
+ if attributes.has_key?(:'XIndent')
166
+ self.x_indent = attributes[:'XIndent']
167
+ end
168
+
169
+ if attributes.has_key?(:'YIndent')
170
+ self.y_indent = attributes[:'YIndent']
171
+ end
172
+
173
+ if attributes.has_key?(:'Zoom')
174
+ self.zoom = attributes[:'Zoom']
175
+ end
176
+
177
+ if attributes.has_key?(:'TextAlignment')
178
+ self.text_alignment = attributes[:'TextAlignment']
179
+ end
180
+
181
+ if attributes.has_key?(:'Value')
182
+ self.value = attributes[:'Value']
183
+ end
184
+
185
+ if attributes.has_key?(:'TextState')
186
+ self.text_state = attributes[:'TextState']
187
+ end
188
+
189
+ if attributes.has_key?(:'VerticalAlignment')
190
+ self.vertical_alignment = attributes[:'VerticalAlignment']
191
+ end
192
+
193
+ if attributes.has_key?(:'BottomMargin')
194
+ self.bottom_margin = attributes[:'BottomMargin']
195
+ end
196
+
197
+ if attributes.has_key?(:'LeftMargin')
198
+ self.left_margin = attributes[:'LeftMargin']
199
+ end
200
+
201
+ if attributes.has_key?(:'TopMargin')
202
+ self.top_margin = attributes[:'TopMargin']
203
+ end
204
+
205
+ if attributes.has_key?(:'RightMargin')
206
+ self.right_margin = attributes[:'RightMargin']
207
+ end
208
+
209
+ if attributes.has_key?(:'PageNumber')
210
+ self.page_number = attributes[:'PageNumber']
211
+ end
212
+
213
+ end
214
+
215
+ # Show invalid properties with the reasons. Usually used together with valid?
216
+ # @return Array for valid properies with the reasons
217
+ def list_invalid_properties
218
+ invalid_properties = Array.new
219
+ if @page_number.nil?
220
+ invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
221
+ end
222
+
223
+ return invalid_properties
224
+ end
225
+
226
+ # Check to see if the all the properties in the model are valid
227
+ # @return true if the model is valid
228
+ def valid?
229
+ return false if @page_number.nil?
230
+ return true
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ links == o.links &&
239
+ background == o.background &&
240
+ horizontal_alignment == o.horizontal_alignment &&
241
+ opacity == o.opacity &&
242
+ rotate == o.rotate &&
243
+ rotate_angle == o.rotate_angle &&
244
+ x_indent == o.x_indent &&
245
+ y_indent == o.y_indent &&
246
+ zoom == o.zoom &&
247
+ text_alignment == o.text_alignment &&
248
+ value == o.value &&
249
+ text_state == o.text_state &&
250
+ vertical_alignment == o.vertical_alignment &&
251
+ bottom_margin == o.bottom_margin &&
252
+ left_margin == o.left_margin &&
253
+ top_margin == o.top_margin &&
254
+ right_margin == o.right_margin &&
255
+ page_number == o.page_number
256
+ end
257
+
258
+ # @see the `==` method
259
+ # @param [Object] Object to be compared
260
+ def eql?(o)
261
+ self == o
262
+ end
263
+
264
+ # Calculates hash code according to all attributes.
265
+ # @return [Fixnum] Hash code
266
+ def hash
267
+ [links, background, horizontal_alignment, opacity, rotate, rotate_angle, x_indent, y_indent, zoom, text_alignment, value, text_state, vertical_alignment, bottom_margin, left_margin, top_margin, right_margin, page_number].hash
268
+ end
269
+
270
+ # Builds the object from hash
271
+ # @param [Hash] attributes Model attributes in the form of hash
272
+ # @return [Object] Returns the model itself
273
+ def build_from_hash(attributes)
274
+ return nil unless attributes.is_a?(Hash)
275
+ self.class.swagger_types.each_pair do |key, type|
276
+ if type =~ /\AArray<(.*)>/i
277
+ # check to ensure the input is an array given that the the attribute
278
+ # is documented as an array but the input is not
279
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
280
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
281
+ end
282
+ elsif !attributes[self.class.attribute_map[key]].nil?
283
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
284
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
285
+ end
286
+
287
+ self
288
+ end
289
+
290
+ # Deserializes the data based on type
291
+ # @param string type Data type
292
+ # @param string value Value to be deserialized
293
+ # @return [Object] Deserialized data
294
+ def _deserialize(type, value)
295
+ case type.to_sym
296
+ when :DateTime
297
+ DateTime.parse(value)
298
+ when :Date
299
+ Date.parse(value)
300
+ when :String
301
+ value.to_s
302
+ when :Integer
303
+ value.to_i
304
+ when :Float
305
+ value.to_f
306
+ when :BOOLEAN
307
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
308
+ true
309
+ else
310
+ false
311
+ end
312
+ when :Object
313
+ # generic object (usually a Hash), return directly
314
+ value
315
+ when /\AArray<(?<inner_type>.+)>\z/
316
+ inner_type = Regexp.last_match[:inner_type]
317
+ value.map { |v| _deserialize(inner_type, v) }
318
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
319
+ k_type = Regexp.last_match[:k_type]
320
+ v_type = Regexp.last_match[:v_type]
321
+ {}.tap do |hash|
322
+ value.each do |k, v|
323
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
324
+ end
325
+ end
326
+ else # model
327
+ temp_model = AsposePdfCloud.const_get(type).new
328
+ temp_model.build_from_hash(value)
329
+ end
330
+ end
331
+
332
+ # Returns the string representation of the object
333
+ # @return [String] String presentation of the object
334
+ def to_s
335
+ to_hash.to_s
336
+ end
337
+
338
+ # to_body is an alias to to_hash (backward compatibility)
339
+ # @return [Hash] Returns the object in the form of hash
340
+ def to_body
341
+ to_hash
342
+ end
343
+
344
+ # Returns the object in the form of hash
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_hash
347
+ hash = {}
348
+ self.class.attribute_map.each_pair do |attr, param|
349
+ value = self.send(attr)
350
+ next if value.nil?
351
+ hash[param] = _to_hash(value)
352
+ end
353
+ hash
354
+ end
355
+
356
+ # Outputs non-array value in the form of hash
357
+ # For object, use to_hash. Otherwise, just return the value
358
+ # @param [Object] value Any valid value
359
+ # @return [Hash] Returns the value in the form of hash
360
+ def _to_hash(value)
361
+ if value.is_a?(Array)
362
+ value.compact.map{ |v| _to_hash(v) }
363
+ elsif value.is_a?(Hash)
364
+ {}.tap do |hash|
365
+ value.each { |k, v| hash[k] = _to_hash(v) }
366
+ end
367
+ elsif value.respond_to? :to_hash
368
+ value.to_hash
369
+ else
370
+ value
371
+ end
372
+ end
373
+
374
+ end
375
+
376
+ end
@@ -20,5 +20,5 @@ SOFTWARE.
20
20
  =end
21
21
 
22
22
  module AsposePdfCloud
23
- VERSION = "25.3.0"
23
+ VERSION = "25.4.0"
24
24
  end
@@ -300,6 +300,7 @@ require_relative 'aspose_pdf_cloud/models/common_figure_annotation'
300
300
  require_relative 'aspose_pdf_cloud/models/file_attachment_annotation'
301
301
  require_relative 'aspose_pdf_cloud/models/free_text_annotation'
302
302
  require_relative 'aspose_pdf_cloud/models/highlight_annotation'
303
+ require_relative 'aspose_pdf_cloud/models/image_stamp_page_specified'
303
304
  require_relative 'aspose_pdf_cloud/models/ink_annotation'
304
305
  require_relative 'aspose_pdf_cloud/models/line_annotation'
305
306
  require_relative 'aspose_pdf_cloud/models/list_box_field'
@@ -311,6 +312,7 @@ require_relative 'aspose_pdf_cloud/models/squiggly_annotation'
311
312
  require_relative 'aspose_pdf_cloud/models/stamp_annotation'
312
313
  require_relative 'aspose_pdf_cloud/models/strike_out_annotation'
313
314
  require_relative 'aspose_pdf_cloud/models/text_annotation'
315
+ require_relative 'aspose_pdf_cloud/models/text_stamp_page_specified'
314
316
  require_relative 'aspose_pdf_cloud/models/underline_annotation'
315
317
  require_relative 'aspose_pdf_cloud/models/circle_annotation'
316
318
  require_relative 'aspose_pdf_cloud/models/poly_line_annotation'
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: 25.3.0
4
+ version: 25.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: 2025-03-28 00:00:00.000000000 Z
11
+ date: 2025-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -174,6 +174,7 @@ files:
174
174
  - lib/aspose_pdf_cloud/models/image_response.rb
175
175
  - lib/aspose_pdf_cloud/models/image_src_type.rb
176
176
  - lib/aspose_pdf_cloud/models/image_stamp.rb
177
+ - lib/aspose_pdf_cloud/models/image_stamp_page_specified.rb
177
178
  - lib/aspose_pdf_cloud/models/image_template.rb
178
179
  - lib/aspose_pdf_cloud/models/image_templates_request.rb
179
180
  - lib/aspose_pdf_cloud/models/images.rb
@@ -336,6 +337,7 @@ files:
336
337
  - lib/aspose_pdf_cloud/models/text_replace_list_request.rb
337
338
  - lib/aspose_pdf_cloud/models/text_replace_response.rb
338
339
  - lib/aspose_pdf_cloud/models/text_stamp.rb
340
+ - lib/aspose_pdf_cloud/models/text_stamp_page_specified.rb
339
341
  - lib/aspose_pdf_cloud/models/text_state.rb
340
342
  - lib/aspose_pdf_cloud/models/text_style.rb
341
343
  - lib/aspose_pdf_cloud/models/timestamp_settings.rb