aspose_pdf_cloud 18.7.0 → 18.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/aspose_pdf_cloud.gemspec +53 -49
- data/lib/aspose_pdf_cloud.rb +150 -145
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +12907 -11705
- data/lib/aspose_pdf_cloud/api_client.rb +2 -2
- data/lib/aspose_pdf_cloud/api_error.rb +47 -47
- data/lib/aspose_pdf_cloud/configuration.rb +175 -185
- data/lib/aspose_pdf_cloud/models/annotation.rb +332 -260
- data/lib/aspose_pdf_cloud/models/annotation_flags.rb +52 -0
- data/lib/aspose_pdf_cloud/models/annotation_info.rb +342 -0
- data/lib/aspose_pdf_cloud/models/annotation_state.rb +49 -0
- data/lib/aspose_pdf_cloud/models/annotation_type.rb +69 -0
- data/lib/aspose_pdf_cloud/models/{annotations.rb → annotations_info.rb} +211 -211
- data/lib/aspose_pdf_cloud/models/{annotations_response.rb → annotations_info_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/antialiasing_processing_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/append_document.rb +233 -228
- data/lib/aspose_pdf_cloud/models/{saa_spose_response.rb → aspose_response.rb} +213 -213
- data/lib/aspose_pdf_cloud/models/attachment.rb +270 -270
- data/lib/aspose_pdf_cloud/models/attachment_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/attachments.rb +211 -211
- data/lib/aspose_pdf_cloud/models/attachments_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/color.rb +244 -244
- data/lib/aspose_pdf_cloud/models/color_depth.rb +45 -45
- data/lib/aspose_pdf_cloud/models/compression_type.rb +46 -46
- data/lib/aspose_pdf_cloud/models/doc_format.rb +43 -43
- data/lib/aspose_pdf_cloud/models/doc_recognition_mode.rb +43 -43
- data/lib/aspose_pdf_cloud/models/document.rb +220 -220
- data/lib/aspose_pdf_cloud/models/{text_item_response.rb → document_page_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/document_pages_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_privilege.rb +298 -298
- data/lib/aspose_pdf_cloud/models/document_properties.rb +211 -211
- data/lib/aspose_pdf_cloud/models/document_properties_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_property.rb +227 -227
- data/lib/aspose_pdf_cloud/models/document_property_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/document_response.rb +233 -233
- data/lib/aspose_pdf_cloud/models/epub_recognition_mode.rb +44 -44
- data/lib/aspose_pdf_cloud/models/field.rb +254 -254
- data/lib/aspose_pdf_cloud/models/field_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/field_type.rb +45 -44
- data/lib/aspose_pdf_cloud/models/fields.rb +211 -211
- data/lib/aspose_pdf_cloud/models/fields_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/font_encoding_rules.rb +43 -43
- data/lib/aspose_pdf_cloud/models/font_saving_modes.rb +45 -45
- data/lib/aspose_pdf_cloud/models/font_styles.rb +45 -43
- data/lib/aspose_pdf_cloud/models/free_text_annotation.rb +382 -0
- data/lib/aspose_pdf_cloud/models/{annotation_response.rb → free_text_annotation_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/{text_items.rb → free_text_annotations.rb} +211 -211
- data/lib/aspose_pdf_cloud/models/{text_items_response.rb → free_text_annotations_response.rb} +222 -222
- data/lib/aspose_pdf_cloud/models/free_text_intent.rb +44 -0
- data/lib/aspose_pdf_cloud/models/horizontal_alignment.rb +45 -44
- data/lib/aspose_pdf_cloud/models/html_document_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/html_markup_generation_modes.rb +43 -43
- data/lib/aspose_pdf_cloud/models/image.rb +250 -220
- data/lib/aspose_pdf_cloud/models/image_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/image_src_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/image_template.rb +281 -281
- data/lib/aspose_pdf_cloud/models/image_templates_request.rb +230 -230
- data/lib/aspose_pdf_cloud/models/images.rb +211 -211
- data/lib/aspose_pdf_cloud/models/images_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/justification.rb +44 -0
- data/lib/aspose_pdf_cloud/models/letters_positioning_methods.rb +43 -43
- data/lib/aspose_pdf_cloud/models/line_spacing.rb +43 -43
- data/lib/aspose_pdf_cloud/models/link.rb +228 -228
- data/lib/aspose_pdf_cloud/models/link_action_type.rb +47 -46
- data/lib/aspose_pdf_cloud/models/link_annotation.rb +254 -236
- data/lib/aspose_pdf_cloud/models/link_annotation_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/link_annotations.rb +211 -211
- data/lib/aspose_pdf_cloud/models/link_annotations_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/link_element.rb +200 -200
- data/lib/aspose_pdf_cloud/models/link_highlighting_mode.rb +46 -45
- data/lib/aspose_pdf_cloud/models/margin_info.rb +244 -244
- data/lib/aspose_pdf_cloud/models/markup_annotation.rb +342 -0
- data/lib/aspose_pdf_cloud/models/merge_documents.rb +205 -200
- data/lib/aspose_pdf_cloud/models/optimize_options.rb +293 -293
- data/lib/aspose_pdf_cloud/models/page.rb +228 -228
- data/lib/aspose_pdf_cloud/models/page_word_count.rb +218 -218
- data/lib/aspose_pdf_cloud/models/pages.rb +211 -211
- data/lib/aspose_pdf_cloud/models/paragraph.rb +303 -303
- data/lib/aspose_pdf_cloud/models/parts_embedding_modes.rb +44 -44
- data/lib/aspose_pdf_cloud/models/pdf_a_type.rb +43 -43
- data/lib/aspose_pdf_cloud/models/raster_images_saving_modes.rb +44 -44
- data/lib/aspose_pdf_cloud/models/{document_text_replace_response.rb → rectangle_pdf.rb} +244 -231
- data/lib/aspose_pdf_cloud/models/rotation.rb +45 -44
- data/lib/aspose_pdf_cloud/models/segment.rb +211 -206
- data/lib/aspose_pdf_cloud/models/shape_type.rb +44 -44
- data/lib/aspose_pdf_cloud/models/signature.rb +338 -333
- data/lib/aspose_pdf_cloud/models/signature_type.rb +44 -42
- data/lib/aspose_pdf_cloud/models/signature_verify_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/split_result.rb +200 -200
- data/lib/aspose_pdf_cloud/models/split_result_document.rb +238 -238
- data/lib/aspose_pdf_cloud/models/split_result_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/stamp.rb +413 -413
- data/lib/aspose_pdf_cloud/models/stamp_type.rb +45 -44
- data/lib/aspose_pdf_cloud/models/{tiff_export_options.rb → text_annotation.rb} +382 -348
- data/lib/aspose_pdf_cloud/models/text_annotation_response.rb +222 -0
- data/lib/aspose_pdf_cloud/models/{text_item.rb → text_annotations.rb} +211 -218
- data/lib/aspose_pdf_cloud/models/text_annotations_response.rb +222 -0
- data/lib/aspose_pdf_cloud/models/text_horizontal_alignment.rb +47 -47
- data/lib/aspose_pdf_cloud/models/text_icon.rb +52 -0
- data/lib/aspose_pdf_cloud/models/text_line.rb +215 -210
- data/lib/aspose_pdf_cloud/models/text_rect.rb +220 -220
- data/lib/aspose_pdf_cloud/models/text_rects.rb +199 -199
- data/lib/aspose_pdf_cloud/models/text_rects_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_replace.rb +253 -253
- data/lib/aspose_pdf_cloud/models/text_replace_list_request.rb +232 -232
- data/lib/aspose_pdf_cloud/models/text_replace_response.rb +222 -222
- data/lib/aspose_pdf_cloud/models/text_state.rb +248 -248
- data/lib/aspose_pdf_cloud/models/{text_format.rb → text_style.rb} +233 -227
- data/lib/aspose_pdf_cloud/models/vertical_alignment.rb +45 -45
- data/lib/aspose_pdf_cloud/models/word_count.rb +199 -199
- data/lib/aspose_pdf_cloud/models/word_count_response.rb +223 -223
- data/lib/aspose_pdf_cloud/models/wrap_mode.rb +44 -44
- data/lib/aspose_pdf_cloud/version.rb +24 -24
- data/test/pdf_tests.rb +1496 -1325
- data/test_data/TexExample.tex +304 -304
- metadata +24 -21
- data/.gitignore +0 -46
- data/.swagger-codegen-ignore +0 -58
- data/lib/aspose_pdf_cloud/models/http_status_code.rb +0 -87
- data/lib/aspose_pdf_cloud/models/images_list_request.rb +0 -205
- data/lib/aspose_pdf_cloud/models/page_text_replace_response.rb +0 -231
- data/lib/aspose_pdf_cloud/models/rectangle.rb +0 -244
- data/lib/aspose_pdf_cloud/models/text_format_response.rb +0 -222
- data/lib/aspose_pdf_cloud/models/text_replace_request.rb +0 -262
@@ -1,44 +1,44 @@
|
|
1
|
-
=begin
|
2
|
-
--------------------------------------------------------------------------------------------------------------------
|
3
|
-
Copyright (c) 2018 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
|
-
|
24
|
-
module AsposePdfCloud
|
25
|
-
class ShapeType
|
26
|
-
|
27
|
-
NONE = "None".freeze
|
28
|
-
LANDSCAPE = "Landscape".freeze
|
29
|
-
PORTRAIT = "Portrait".freeze
|
30
|
-
|
31
|
-
# Builds the enum from string
|
32
|
-
# @param [String] The enum value in the form of the string
|
33
|
-
# @return [String] The enum value
|
34
|
-
def build_from_hash(value)
|
35
|
-
# resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
|
36
|
-
# consantValues = ShapeType.constants.select{|c| c.to_s == value}
|
37
|
-
constantValues = ShapeType.constants.select{ |const_name| ShapeType.const_get(const_name) == value}
|
38
|
-
|
39
|
-
raise "Invalid ENUM value #{value} for class #ShapeType" if constantValues.empty?
|
40
|
-
value
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 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
|
+
|
24
|
+
module AsposePdfCloud
|
25
|
+
class ShapeType
|
26
|
+
|
27
|
+
NONE = "None".freeze
|
28
|
+
LANDSCAPE = "Landscape".freeze
|
29
|
+
PORTRAIT = "Portrait".freeze
|
30
|
+
|
31
|
+
# Builds the enum from string
|
32
|
+
# @param [String] The enum value in the form of the string
|
33
|
+
# @return [String] The enum value
|
34
|
+
def build_from_hash(value)
|
35
|
+
# resolve issue with Concstant Name modification (ex: "FooName" to :FOO_NAME)
|
36
|
+
# consantValues = ShapeType.constants.select{|c| c.to_s == value}
|
37
|
+
constantValues = ShapeType.constants.select{ |const_name| ShapeType.const_get(const_name) == value}
|
38
|
+
|
39
|
+
raise "Invalid ENUM value #{value} for class #ShapeType" if constantValues.empty?
|
40
|
+
value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -1,333 +1,338 @@
|
|
1
|
-
=begin
|
2
|
-
--------------------------------------------------------------------------------------------------------------------
|
3
|
-
Copyright (c) 2018 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
|
-
|
24
|
-
module AsposePdfCloud
|
25
|
-
|
26
|
-
class Signature
|
27
|
-
# Gets or sets the signature path.
|
28
|
-
attr_accessor :signature_path
|
29
|
-
|
30
|
-
# Gets or sets the type of the signature.
|
31
|
-
attr_accessor :signature_type
|
32
|
-
|
33
|
-
# Gets or sets the signature password.
|
34
|
-
attr_accessor :password
|
35
|
-
|
36
|
-
# Sets or gets a graphic appearance for the signature. Property value represents an image file name.
|
37
|
-
attr_accessor :appearance
|
38
|
-
|
39
|
-
# Gets or sets the reason of the signature.
|
40
|
-
attr_accessor :reason
|
41
|
-
|
42
|
-
# Gets or sets the contact of the signature.
|
43
|
-
attr_accessor :contact
|
44
|
-
|
45
|
-
# Gets or sets the location of the signature.
|
46
|
-
attr_accessor :location
|
47
|
-
|
48
|
-
# Gets or sets a value indicating whether this is visible. Supports only when signing particular page.
|
49
|
-
attr_accessor :visible
|
50
|
-
|
51
|
-
# Gets or sets the visible rectangle of the signature. Supports only when signing particular page.
|
52
|
-
attr_accessor :rectangle
|
53
|
-
|
54
|
-
# Gets or sets the name of the signature field. Supports only when signing document with particular form field.
|
55
|
-
attr_accessor :form_field_name
|
56
|
-
|
57
|
-
# Gets or sets the name of the person or authority signing the document..
|
58
|
-
attr_accessor :authority
|
59
|
-
|
60
|
-
# Gets or sets the time of signing.
|
61
|
-
attr_accessor :date
|
62
|
-
|
63
|
-
# Gets or sets the showproperties in signature field
|
64
|
-
attr_accessor :show_properties
|
65
|
-
|
66
|
-
|
67
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
-
def self.attribute_map
|
69
|
-
{
|
70
|
-
:'signature_path' => :'SignaturePath',
|
71
|
-
:'signature_type' => :'SignatureType',
|
72
|
-
:'password' => :'Password',
|
73
|
-
:'appearance' => :'Appearance',
|
74
|
-
:'reason' => :'Reason',
|
75
|
-
:'contact' => :'Contact',
|
76
|
-
:'location' => :'Location',
|
77
|
-
:'visible' => :'Visible',
|
78
|
-
:'rectangle' => :'Rectangle',
|
79
|
-
:'form_field_name' => :'FormFieldName',
|
80
|
-
:'authority' => :'Authority',
|
81
|
-
:'date' => :'Date',
|
82
|
-
:'show_properties' => :'ShowProperties'
|
83
|
-
}
|
84
|
-
end
|
85
|
-
|
86
|
-
# Attribute type mapping.
|
87
|
-
def self.swagger_types
|
88
|
-
{
|
89
|
-
:'signature_path' => :'String',
|
90
|
-
:'signature_type' => :'SignatureType',
|
91
|
-
:'password' => :'String',
|
92
|
-
:'appearance' => :'String',
|
93
|
-
:'reason' => :'String',
|
94
|
-
:'contact' => :'String',
|
95
|
-
:'location' => :'String',
|
96
|
-
:'visible' => :'BOOLEAN',
|
97
|
-
:'rectangle' => :'
|
98
|
-
:'form_field_name' => :'String',
|
99
|
-
:'authority' => :'String',
|
100
|
-
:'date' => :'String',
|
101
|
-
:'show_properties' => :'BOOLEAN'
|
102
|
-
}
|
103
|
-
end
|
104
|
-
|
105
|
-
# Initializes the object
|
106
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
-
def initialize(attributes = {})
|
108
|
-
return unless attributes.is_a?(Hash)
|
109
|
-
|
110
|
-
# convert string to symbol for hash key
|
111
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
112
|
-
|
113
|
-
if attributes.has_key?(:'SignaturePath')
|
114
|
-
self.signature_path = attributes[:'SignaturePath']
|
115
|
-
end
|
116
|
-
|
117
|
-
if attributes.has_key?(:'SignatureType')
|
118
|
-
self.signature_type = attributes[:'SignatureType']
|
119
|
-
end
|
120
|
-
|
121
|
-
if attributes.has_key?(:'Password')
|
122
|
-
self.password = attributes[:'Password']
|
123
|
-
end
|
124
|
-
|
125
|
-
if attributes.has_key?(:'Appearance')
|
126
|
-
self.appearance = attributes[:'Appearance']
|
127
|
-
end
|
128
|
-
|
129
|
-
if attributes.has_key?(:'Reason')
|
130
|
-
self.reason = attributes[:'Reason']
|
131
|
-
end
|
132
|
-
|
133
|
-
if attributes.has_key?(:'Contact')
|
134
|
-
self.contact = attributes[:'Contact']
|
135
|
-
end
|
136
|
-
|
137
|
-
if attributes.has_key?(:'Location')
|
138
|
-
self.location = attributes[:'Location']
|
139
|
-
end
|
140
|
-
|
141
|
-
if attributes.has_key?(:'Visible')
|
142
|
-
self.visible = attributes[:'Visible']
|
143
|
-
end
|
144
|
-
|
145
|
-
if attributes.has_key?(:'Rectangle')
|
146
|
-
self.rectangle = attributes[:'Rectangle']
|
147
|
-
end
|
148
|
-
|
149
|
-
if attributes.has_key?(:'FormFieldName')
|
150
|
-
self.form_field_name = attributes[:'FormFieldName']
|
151
|
-
end
|
152
|
-
|
153
|
-
if attributes.has_key?(:'Authority')
|
154
|
-
self.authority = attributes[:'Authority']
|
155
|
-
end
|
156
|
-
|
157
|
-
if attributes.has_key?(:'Date')
|
158
|
-
self.date = attributes[:'Date']
|
159
|
-
end
|
160
|
-
|
161
|
-
if attributes.has_key?(:'ShowProperties')
|
162
|
-
self.show_properties = attributes[:'ShowProperties']
|
163
|
-
end
|
164
|
-
|
165
|
-
end
|
166
|
-
|
167
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
168
|
-
# @return Array for valid properies with the reasons
|
169
|
-
def list_invalid_properties
|
170
|
-
invalid_properties = Array.new
|
171
|
-
if @
|
172
|
-
invalid_properties.push("invalid value for '
|
173
|
-
end
|
174
|
-
|
175
|
-
if @
|
176
|
-
invalid_properties.push("invalid value for '
|
177
|
-
end
|
178
|
-
|
179
|
-
if @
|
180
|
-
invalid_properties.push("invalid value for '
|
181
|
-
end
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
#
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
#
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
#
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
# Returns the object in the form of hash
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
end
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2018 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
|
+
|
24
|
+
module AsposePdfCloud
|
25
|
+
|
26
|
+
class Signature
|
27
|
+
# Gets or sets the signature path.
|
28
|
+
attr_accessor :signature_path
|
29
|
+
|
30
|
+
# Gets or sets the type of the signature.
|
31
|
+
attr_accessor :signature_type
|
32
|
+
|
33
|
+
# Gets or sets the signature password.
|
34
|
+
attr_accessor :password
|
35
|
+
|
36
|
+
# Sets or gets a graphic appearance for the signature. Property value represents an image file name.
|
37
|
+
attr_accessor :appearance
|
38
|
+
|
39
|
+
# Gets or sets the reason of the signature.
|
40
|
+
attr_accessor :reason
|
41
|
+
|
42
|
+
# Gets or sets the contact of the signature.
|
43
|
+
attr_accessor :contact
|
44
|
+
|
45
|
+
# Gets or sets the location of the signature.
|
46
|
+
attr_accessor :location
|
47
|
+
|
48
|
+
# Gets or sets a value indicating whether this is visible. Supports only when signing particular page.
|
49
|
+
attr_accessor :visible
|
50
|
+
|
51
|
+
# Gets or sets the visible rectangle of the signature. Supports only when signing particular page.
|
52
|
+
attr_accessor :rectangle
|
53
|
+
|
54
|
+
# Gets or sets the name of the signature field. Supports only when signing document with particular form field.
|
55
|
+
attr_accessor :form_field_name
|
56
|
+
|
57
|
+
# Gets or sets the name of the person or authority signing the document..
|
58
|
+
attr_accessor :authority
|
59
|
+
|
60
|
+
# Gets or sets the time of signing.
|
61
|
+
attr_accessor :date
|
62
|
+
|
63
|
+
# Gets or sets the showproperties in signature field
|
64
|
+
attr_accessor :show_properties
|
65
|
+
|
66
|
+
|
67
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
+
def self.attribute_map
|
69
|
+
{
|
70
|
+
:'signature_path' => :'SignaturePath',
|
71
|
+
:'signature_type' => :'SignatureType',
|
72
|
+
:'password' => :'Password',
|
73
|
+
:'appearance' => :'Appearance',
|
74
|
+
:'reason' => :'Reason',
|
75
|
+
:'contact' => :'Contact',
|
76
|
+
:'location' => :'Location',
|
77
|
+
:'visible' => :'Visible',
|
78
|
+
:'rectangle' => :'Rectangle',
|
79
|
+
:'form_field_name' => :'FormFieldName',
|
80
|
+
:'authority' => :'Authority',
|
81
|
+
:'date' => :'Date',
|
82
|
+
:'show_properties' => :'ShowProperties'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Attribute type mapping.
|
87
|
+
def self.swagger_types
|
88
|
+
{
|
89
|
+
:'signature_path' => :'String',
|
90
|
+
:'signature_type' => :'SignatureType',
|
91
|
+
:'password' => :'String',
|
92
|
+
:'appearance' => :'String',
|
93
|
+
:'reason' => :'String',
|
94
|
+
:'contact' => :'String',
|
95
|
+
:'location' => :'String',
|
96
|
+
:'visible' => :'BOOLEAN',
|
97
|
+
:'rectangle' => :'RectanglePdf',
|
98
|
+
:'form_field_name' => :'String',
|
99
|
+
:'authority' => :'String',
|
100
|
+
:'date' => :'String',
|
101
|
+
:'show_properties' => :'BOOLEAN'
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# Initializes the object
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
def initialize(attributes = {})
|
108
|
+
return unless attributes.is_a?(Hash)
|
109
|
+
|
110
|
+
# convert string to symbol for hash key
|
111
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
112
|
+
|
113
|
+
if attributes.has_key?(:'SignaturePath')
|
114
|
+
self.signature_path = attributes[:'SignaturePath']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'SignatureType')
|
118
|
+
self.signature_type = attributes[:'SignatureType']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'Password')
|
122
|
+
self.password = attributes[:'Password']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'Appearance')
|
126
|
+
self.appearance = attributes[:'Appearance']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'Reason')
|
130
|
+
self.reason = attributes[:'Reason']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'Contact')
|
134
|
+
self.contact = attributes[:'Contact']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'Location')
|
138
|
+
self.location = attributes[:'Location']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'Visible')
|
142
|
+
self.visible = attributes[:'Visible']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'Rectangle')
|
146
|
+
self.rectangle = attributes[:'Rectangle']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'FormFieldName')
|
150
|
+
self.form_field_name = attributes[:'FormFieldName']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'Authority')
|
154
|
+
self.authority = attributes[:'Authority']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'Date')
|
158
|
+
self.date = attributes[:'Date']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'ShowProperties')
|
162
|
+
self.show_properties = attributes[:'ShowProperties']
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
166
|
+
|
167
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
168
|
+
# @return Array for valid properies with the reasons
|
169
|
+
def list_invalid_properties
|
170
|
+
invalid_properties = Array.new
|
171
|
+
if @signature_path.nil?
|
172
|
+
invalid_properties.push("invalid value for 'signature_path', signature_path cannot be nil.")
|
173
|
+
end
|
174
|
+
|
175
|
+
if @signature_type.nil?
|
176
|
+
invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
|
177
|
+
end
|
178
|
+
|
179
|
+
if @visible.nil?
|
180
|
+
invalid_properties.push("invalid value for 'visible', visible cannot be nil.")
|
181
|
+
end
|
182
|
+
|
183
|
+
if @show_properties.nil?
|
184
|
+
invalid_properties.push("invalid value for 'show_properties', show_properties cannot be nil.")
|
185
|
+
end
|
186
|
+
|
187
|
+
return invalid_properties
|
188
|
+
end
|
189
|
+
|
190
|
+
# Check to see if the all the properties in the model are valid
|
191
|
+
# @return true if the model is valid
|
192
|
+
def valid?
|
193
|
+
return false if @signature_path.nil?
|
194
|
+
return false if @signature_type.nil?
|
195
|
+
return false if @visible.nil?
|
196
|
+
return false if @show_properties.nil?
|
197
|
+
return true
|
198
|
+
end
|
199
|
+
|
200
|
+
# Checks equality by comparing each attribute.
|
201
|
+
# @param [Object] Object to be compared
|
202
|
+
def ==(o)
|
203
|
+
return true if self.equal?(o)
|
204
|
+
self.class == o.class &&
|
205
|
+
signature_path == o.signature_path &&
|
206
|
+
signature_type == o.signature_type &&
|
207
|
+
password == o.password &&
|
208
|
+
appearance == o.appearance &&
|
209
|
+
reason == o.reason &&
|
210
|
+
contact == o.contact &&
|
211
|
+
location == o.location &&
|
212
|
+
visible == o.visible &&
|
213
|
+
rectangle == o.rectangle &&
|
214
|
+
form_field_name == o.form_field_name &&
|
215
|
+
authority == o.authority &&
|
216
|
+
date == o.date &&
|
217
|
+
show_properties == o.show_properties
|
218
|
+
end
|
219
|
+
|
220
|
+
# @see the `==` method
|
221
|
+
# @param [Object] Object to be compared
|
222
|
+
def eql?(o)
|
223
|
+
self == o
|
224
|
+
end
|
225
|
+
|
226
|
+
# Calculates hash code according to all attributes.
|
227
|
+
# @return [Fixnum] Hash code
|
228
|
+
def hash
|
229
|
+
[signature_path, signature_type, password, appearance, reason, contact, location, visible, rectangle, form_field_name, authority, date, show_properties].hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Builds the object from hash
|
233
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
234
|
+
# @return [Object] Returns the model itself
|
235
|
+
def build_from_hash(attributes)
|
236
|
+
return nil unless attributes.is_a?(Hash)
|
237
|
+
self.class.swagger_types.each_pair do |key, type|
|
238
|
+
if type =~ /\AArray<(.*)>/i
|
239
|
+
# check to ensure the input is an array given that the the attribute
|
240
|
+
# is documented as an array but the input is not
|
241
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
242
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
243
|
+
end
|
244
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
245
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
246
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
247
|
+
end
|
248
|
+
|
249
|
+
self
|
250
|
+
end
|
251
|
+
|
252
|
+
# Deserializes the data based on type
|
253
|
+
# @param string type Data type
|
254
|
+
# @param string value Value to be deserialized
|
255
|
+
# @return [Object] Deserialized data
|
256
|
+
def _deserialize(type, value)
|
257
|
+
case type.to_sym
|
258
|
+
when :DateTime
|
259
|
+
DateTime.parse(value)
|
260
|
+
when :Date
|
261
|
+
Date.parse(value)
|
262
|
+
when :String
|
263
|
+
value.to_s
|
264
|
+
when :Integer
|
265
|
+
value.to_i
|
266
|
+
when :Float
|
267
|
+
value.to_f
|
268
|
+
when :BOOLEAN
|
269
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
270
|
+
true
|
271
|
+
else
|
272
|
+
false
|
273
|
+
end
|
274
|
+
when :Object
|
275
|
+
# generic object (usually a Hash), return directly
|
276
|
+
value
|
277
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
278
|
+
inner_type = Regexp.last_match[:inner_type]
|
279
|
+
value.map { |v| _deserialize(inner_type, v) }
|
280
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
281
|
+
k_type = Regexp.last_match[:k_type]
|
282
|
+
v_type = Regexp.last_match[:v_type]
|
283
|
+
{}.tap do |hash|
|
284
|
+
value.each do |k, v|
|
285
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
286
|
+
end
|
287
|
+
end
|
288
|
+
else # model
|
289
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
290
|
+
temp_model.build_from_hash(value)
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
# Returns the string representation of the object
|
295
|
+
# @return [String] String presentation of the object
|
296
|
+
def to_s
|
297
|
+
to_hash.to_s
|
298
|
+
end
|
299
|
+
|
300
|
+
# to_body is an alias to to_hash (backward compatibility)
|
301
|
+
# @return [Hash] Returns the object in the form of hash
|
302
|
+
def to_body
|
303
|
+
to_hash
|
304
|
+
end
|
305
|
+
|
306
|
+
# Returns the object in the form of hash
|
307
|
+
# @return [Hash] Returns the object in the form of hash
|
308
|
+
def to_hash
|
309
|
+
hash = {}
|
310
|
+
self.class.attribute_map.each_pair do |attr, param|
|
311
|
+
value = self.send(attr)
|
312
|
+
next if value.nil?
|
313
|
+
hash[param] = _to_hash(value)
|
314
|
+
end
|
315
|
+
hash
|
316
|
+
end
|
317
|
+
|
318
|
+
# Outputs non-array value in the form of hash
|
319
|
+
# For object, use to_hash. Otherwise, just return the value
|
320
|
+
# @param [Object] value Any valid value
|
321
|
+
# @return [Hash] Returns the value in the form of hash
|
322
|
+
def _to_hash(value)
|
323
|
+
if value.is_a?(Array)
|
324
|
+
value.compact.map{ |v| _to_hash(v) }
|
325
|
+
elsif value.is_a?(Hash)
|
326
|
+
{}.tap do |hash|
|
327
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
328
|
+
end
|
329
|
+
elsif value.respond_to? :to_hash
|
330
|
+
value.to_hash
|
331
|
+
else
|
332
|
+
value
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
end
|
337
|
+
|
338
|
+
end
|