aspose_pdf_cloud 20.4.0 → 20.9.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -13
  3. data/docs/ApiInfo.md +10 -0
  4. data/docs/CheckBoxField.md +1 -0
  5. data/docs/ChoiceField.md +1 -0
  6. data/docs/ComboBoxField.md +1 -0
  7. data/docs/FormField.md +1 -0
  8. data/docs/ImageCompressionVersion.md +12 -0
  9. data/docs/ImageEncoding.md +13 -0
  10. data/docs/ListBoxField.md +1 -0
  11. data/docs/OptimizeOptions.md +13 -7
  12. data/docs/OutputFormat.md +11 -0
  13. data/docs/Paragraph.md +2 -2
  14. data/docs/PdfAType.md +3 -2
  15. data/docs/PdfApi.md +172 -22
  16. data/docs/RadioButtonField.md +1 -0
  17. data/docs/RadioButtonOptionField.md +1 -0
  18. data/docs/RedactionAnnotation.md +1 -1
  19. data/docs/SignatureCustomAppearance.md +1 -1
  20. data/docs/SignatureField.md +1 -0
  21. data/docs/TextBoxField.md +1 -0
  22. data/docs/TextState.md +2 -1
  23. data/docs/TextStyle.md +1 -0
  24. data/lib/aspose_pdf_cloud.rb +4 -0
  25. data/lib/aspose_pdf_cloud/api/pdf_api.rb +484 -32
  26. data/lib/aspose_pdf_cloud/api_client.rb +1 -1
  27. data/lib/aspose_pdf_cloud/models/api_info.rb +209 -0
  28. data/lib/aspose_pdf_cloud/models/check_box_field.rb +11 -1
  29. data/lib/aspose_pdf_cloud/models/choice_field.rb +11 -1
  30. data/lib/aspose_pdf_cloud/models/combo_box_field.rb +11 -1
  31. data/lib/aspose_pdf_cloud/models/form_field.rb +11 -1
  32. data/lib/aspose_pdf_cloud/models/image_compression_version.rb +45 -0
  33. data/lib/aspose_pdf_cloud/models/image_encoding.rb +46 -0
  34. data/lib/aspose_pdf_cloud/models/list_box_field.rb +11 -1
  35. data/lib/aspose_pdf_cloud/models/optimize_options.rb +60 -35
  36. data/lib/aspose_pdf_cloud/models/output_format.rb +44 -0
  37. data/lib/aspose_pdf_cloud/models/paragraph.rb +2 -2
  38. data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +1 -0
  39. data/lib/aspose_pdf_cloud/models/radio_button_field.rb +11 -1
  40. data/lib/aspose_pdf_cloud/models/radio_button_option_field.rb +11 -1
  41. data/lib/aspose_pdf_cloud/models/redaction_annotation.rb +1 -1
  42. data/lib/aspose_pdf_cloud/models/signature_custom_appearance.rb +1 -1
  43. data/lib/aspose_pdf_cloud/models/signature_field.rb +11 -1
  44. data/lib/aspose_pdf_cloud/models/text_box_field.rb +11 -1
  45. data/lib/aspose_pdf_cloud/models/text_state.rb +15 -5
  46. data/lib/aspose_pdf_cloud/models/text_style.rb +14 -4
  47. data/lib/aspose_pdf_cloud/version.rb +1 -1
  48. data/test/pdf_tests.rb +25 -22
  49. data/test_data/Righteous-Regular.ttf +0 -0
  50. metadata +11 -2
@@ -49,7 +49,7 @@ module AsposePdfCloud
49
49
  @default_headers = {
50
50
  'Content-Type' => "application/json",
51
51
  'x-aspose-client' => "ruby sdk",
52
- 'x-aspose-version' => "#{ AsposePdfCloud::VERSION }"
52
+ 'x-aspose-client-version' => "#{ AsposePdfCloud::VERSION }"
53
53
  }
54
54
  end
55
55
 
@@ -0,0 +1,209 @@
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 response for ApiInfo DTO
27
+ class ApiInfo
28
+ # Product name.
29
+ attr_accessor :name
30
+
31
+ # API version.
32
+ attr_accessor :version
33
+
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'name' => :'Name',
39
+ :'version' => :'Version'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'name' => :'String',
47
+ :'version' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
+
59
+ if attributes.has_key?(:'Name')
60
+ self.name = attributes[:'Name']
61
+ end
62
+
63
+ if attributes.has_key?(:'Version')
64
+ self.version = attributes[:'Version']
65
+ end
66
+
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properies with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ name == o.name &&
88
+ version == o.version
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [name, version].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = AsposePdfCloud.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map{ |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
208
+
209
+ end
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -103,6 +106,7 @@ module AsposePdfCloud
103
106
  {
104
107
  :'links' => :'Links',
105
108
  :'partial_name' => :'PartialName',
109
+ :'full_name' => :'FullName',
106
110
  :'rect' => :'Rect',
107
111
  :'value' => :'Value',
108
112
  :'page_index' => :'PageIndex',
@@ -133,6 +137,7 @@ module AsposePdfCloud
133
137
  {
134
138
  :'links' => :'Array<Link>',
135
139
  :'partial_name' => :'String',
140
+ :'full_name' => :'String',
136
141
  :'rect' => :'Rectangle',
137
142
  :'value' => :'String',
138
143
  :'page_index' => :'Integer',
@@ -176,6 +181,10 @@ module AsposePdfCloud
176
181
  self.partial_name = attributes[:'PartialName']
177
182
  end
178
183
 
184
+ if attributes.has_key?(:'FullName')
185
+ self.full_name = attributes[:'FullName']
186
+ end
187
+
179
188
  if attributes.has_key?(:'Rect')
180
189
  self.rect = attributes[:'Rect']
181
190
  end
@@ -300,6 +309,7 @@ module AsposePdfCloud
300
309
  self.class == o.class &&
301
310
  links == o.links &&
302
311
  partial_name == o.partial_name &&
312
+ full_name == o.full_name &&
303
313
  rect == o.rect &&
304
314
  value == o.value &&
305
315
  page_index == o.page_index &&
@@ -333,7 +343,7 @@ module AsposePdfCloud
333
343
  # Calculates hash code according to all attributes.
334
344
  # @return [Fixnum] Hash code
335
345
  def hash
336
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, allowed_states, style, active_state, checked, export_value].hash
346
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, allowed_states, style, active_state, checked, export_value].hash
337
347
  end
338
348
 
339
349
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -94,6 +97,7 @@ module AsposePdfCloud
94
97
  {
95
98
  :'links' => :'Links',
96
99
  :'partial_name' => :'PartialName',
100
+ :'full_name' => :'FullName',
97
101
  :'rect' => :'Rect',
98
102
  :'value' => :'Value',
99
103
  :'page_index' => :'PageIndex',
@@ -121,6 +125,7 @@ module AsposePdfCloud
121
125
  {
122
126
  :'links' => :'Array<Link>',
123
127
  :'partial_name' => :'String',
128
+ :'full_name' => :'String',
124
129
  :'rect' => :'Rectangle',
125
130
  :'value' => :'String',
126
131
  :'page_index' => :'Integer',
@@ -161,6 +166,10 @@ module AsposePdfCloud
161
166
  self.partial_name = attributes[:'PartialName']
162
167
  end
163
168
 
169
+ if attributes.has_key?(:'FullName')
170
+ self.full_name = attributes[:'FullName']
171
+ end
172
+
164
173
  if attributes.has_key?(:'Rect')
165
174
  self.rect = attributes[:'Rect']
166
175
  end
@@ -266,6 +275,7 @@ module AsposePdfCloud
266
275
  self.class == o.class &&
267
276
  links == o.links &&
268
277
  partial_name == o.partial_name &&
278
+ full_name == o.full_name &&
269
279
  rect == o.rect &&
270
280
  value == o.value &&
271
281
  page_index == o.page_index &&
@@ -296,7 +306,7 @@ module AsposePdfCloud
296
306
  # Calculates hash code according to all attributes.
297
307
  # @return [Fixnum] Hash code
298
308
  def hash
299
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected].hash
309
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected].hash
300
310
  end
301
311
 
302
312
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -106,6 +109,7 @@ module AsposePdfCloud
106
109
  {
107
110
  :'links' => :'Links',
108
111
  :'partial_name' => :'PartialName',
112
+ :'full_name' => :'FullName',
109
113
  :'rect' => :'Rect',
110
114
  :'value' => :'Value',
111
115
  :'page_index' => :'PageIndex',
@@ -137,6 +141,7 @@ module AsposePdfCloud
137
141
  {
138
142
  :'links' => :'Array<Link>',
139
143
  :'partial_name' => :'String',
144
+ :'full_name' => :'String',
140
145
  :'rect' => :'Rectangle',
141
146
  :'value' => :'String',
142
147
  :'page_index' => :'Integer',
@@ -181,6 +186,10 @@ module AsposePdfCloud
181
186
  self.partial_name = attributes[:'PartialName']
182
187
  end
183
188
 
189
+ if attributes.has_key?(:'FullName')
190
+ self.full_name = attributes[:'FullName']
191
+ end
192
+
184
193
  if attributes.has_key?(:'Rect')
185
194
  self.rect = attributes[:'Rect']
186
195
  end
@@ -304,6 +313,7 @@ module AsposePdfCloud
304
313
  self.class == o.class &&
305
314
  links == o.links &&
306
315
  partial_name == o.partial_name &&
316
+ full_name == o.full_name &&
307
317
  rect == o.rect &&
308
318
  value == o.value &&
309
319
  page_index == o.page_index &&
@@ -338,7 +348,7 @@ module AsposePdfCloud
338
348
  # Calculates hash code according to all attributes.
339
349
  # @return [Fixnum] Hash code
340
350
  def hash
341
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, active_state, editable, spell_check].hash
351
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border, multi_select, selected, options, active_state, editable, spell_check].hash
342
352
  end
343
353
 
344
354
  # Builds the object from hash
@@ -31,6 +31,9 @@ module AsposePdfCloud
31
31
  # Field name.
32
32
  attr_accessor :partial_name
33
33
 
34
+ # Full Field name.
35
+ attr_accessor :full_name
36
+
34
37
  # Field rectangle.
35
38
  attr_accessor :rect
36
39
 
@@ -88,6 +91,7 @@ module AsposePdfCloud
88
91
  {
89
92
  :'links' => :'Links',
90
93
  :'partial_name' => :'PartialName',
94
+ :'full_name' => :'FullName',
91
95
  :'rect' => :'Rect',
92
96
  :'value' => :'Value',
93
97
  :'page_index' => :'PageIndex',
@@ -113,6 +117,7 @@ module AsposePdfCloud
113
117
  {
114
118
  :'links' => :'Array<Link>',
115
119
  :'partial_name' => :'String',
120
+ :'full_name' => :'String',
116
121
  :'rect' => :'Rectangle',
117
122
  :'value' => :'String',
118
123
  :'page_index' => :'Integer',
@@ -151,6 +156,10 @@ module AsposePdfCloud
151
156
  self.partial_name = attributes[:'PartialName']
152
157
  end
153
158
 
159
+ if attributes.has_key?(:'FullName')
160
+ self.full_name = attributes[:'FullName']
161
+ end
162
+
154
163
  if attributes.has_key?(:'Rect')
155
164
  self.rect = attributes[:'Rect']
156
165
  end
@@ -248,6 +257,7 @@ module AsposePdfCloud
248
257
  self.class == o.class &&
249
258
  links == o.links &&
250
259
  partial_name == o.partial_name &&
260
+ full_name == o.full_name &&
251
261
  rect == o.rect &&
252
262
  value == o.value &&
253
263
  page_index == o.page_index &&
@@ -276,7 +286,7 @@ module AsposePdfCloud
276
286
  # Calculates hash code according to all attributes.
277
287
  # @return [Fixnum] Hash code
278
288
  def hash
279
- [links, partial_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border].hash
289
+ [links, partial_name, full_name, rect, value, page_index, height, width, z_index, is_group, parent, is_shared_field, flags, color, contents, margin, highlighting, horizontal_alignment, vertical_alignment, border].hash
280
290
  end
281
291
 
282
292
  # Builds the object from hash
@@ -0,0 +1,45 @@
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
+ class ImageCompressionVersion
27
+
28
+ STANDARD = "Standard".freeze
29
+ FAST = "Fast".freeze
30
+ MIXED = "Mixed".freeze
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ # resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
37
+ # consantValues = ImageCompressionVersion.constants.select{|c| c.to_s == value}
38
+ constantValues = ImageCompressionVersion.constants.select{ |const_name| ImageCompressionVersion.const_get(const_name) == value}
39
+
40
+ raise "Invalid ENUM value #{value} for class #ImageCompressionVersion" if constantValues.empty?
41
+ value
42
+ end
43
+ end
44
+
45
+ end