groupdocs_conversion_cloud 19.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/groupdocs_conversion_cloud.rb +205 -0
- data/lib/groupdocs_conversion_cloud/api/conversion_api.rb +336 -0
- data/lib/groupdocs_conversion_cloud/api/file_api.rb +729 -0
- data/lib/groupdocs_conversion_cloud/api/folder_api.rb +694 -0
- data/lib/groupdocs_conversion_cloud/api/storage_api.rb +541 -0
- data/lib/groupdocs_conversion_cloud/api_client.rb +380 -0
- data/lib/groupdocs_conversion_cloud/api_error.rb +58 -0
- data/lib/groupdocs_conversion_cloud/configuration.rb +95 -0
- data/lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/bmp_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/cad_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/cgm_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/convert_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/convert_settings.rb +312 -0
- data/lib/groupdocs_conversion_cloud/models/csv_load_options.rb +279 -0
- data/lib/groupdocs_conversion_cloud/models/dcm_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/dcm_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/dgn_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/diagram_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/disc_usage.rb +234 -0
- data/lib/groupdocs_conversion_cloud/models/djvu_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/dng_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/dng_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/doc_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/doc_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/docm_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/docm_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/docx_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/docx_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/dot_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/dot_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/dotm_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/dotm_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/dotx_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/dotx_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/dwf_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/dwg_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/dxf_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/email_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/emf_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/emf_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/eml_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/emlx_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/epub_convert_options.rb +386 -0
- data/lib/groupdocs_conversion_cloud/models/error.rb +244 -0
- data/lib/groupdocs_conversion_cloud/models/error_details.rb +229 -0
- data/lib/groupdocs_conversion_cloud/models/file_version.rb +289 -0
- data/lib/groupdocs_conversion_cloud/models/file_versions.rb +216 -0
- data/lib/groupdocs_conversion_cloud/models/files_list.rb +216 -0
- data/lib/groupdocs_conversion_cloud/models/files_upload_result.rb +228 -0
- data/lib/groupdocs_conversion_cloud/models/gif_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/gif_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/html_convert_options.rb +301 -0
- data/lib/groupdocs_conversion_cloud/models/ico_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/ico_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/ifc_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/igs_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/image_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/image_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/j2c_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/j2c_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/j2k_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/j2k_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/jp2_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/jp2_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/jpeg_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/jpeg_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/jpf_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/jpf_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/jpg_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/jpg_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/jpm_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/jpm_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/jpx_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/jpx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/load_options.rb +204 -0
- data/lib/groupdocs_conversion_cloud/models/mht_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/mobi_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/msg_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/object_exist.rb +234 -0
- data/lib/groupdocs_conversion_cloud/models/odg_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/odg_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/odp_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/odp_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/ods_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/ods_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/odt_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/odt_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/one_load_options.rb +236 -0
- data/lib/groupdocs_conversion_cloud/models/ost_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/otp_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/otp_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/ots_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/ots_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/ott_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/ott_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/pdf_convert_options.rb +863 -0
- data/lib/groupdocs_conversion_cloud/models/pdf_load_options.rb +259 -0
- data/lib/groupdocs_conversion_cloud/models/plt_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/png_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/png_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/potm_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/potm_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/potx_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/potx_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/pps_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/pps_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/ppsm_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/ppsm_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/ppsx_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/ppsx_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/ppt_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/ppt_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/pptm_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/pptm_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/pptx_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/pptx_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/presentation_convert_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/presentation_load_options.rb +266 -0
- data/lib/groupdocs_conversion_cloud/models/psd_convert_options.rb +489 -0
- data/lib/groupdocs_conversion_cloud/models/psd_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/pst_load_options.rb +294 -0
- data/lib/groupdocs_conversion_cloud/models/rtf_convert_options.rb +341 -0
- data/lib/groupdocs_conversion_cloud/models/spreadsheet_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/spreadsheet_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/stl_load_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/storage_exist.rb +219 -0
- data/lib/groupdocs_conversion_cloud/models/storage_file.rb +264 -0
- data/lib/groupdocs_conversion_cloud/models/stored_converted_result.rb +249 -0
- data/lib/groupdocs_conversion_cloud/models/supported_format.rb +226 -0
- data/lib/groupdocs_conversion_cloud/models/svg_convert_options.rb +331 -0
- data/lib/groupdocs_conversion_cloud/models/tif_convert_options.rb +408 -0
- data/lib/groupdocs_conversion_cloud/models/tif_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/tiff_convert_options.rb +408 -0
- data/lib/groupdocs_conversion_cloud/models/tiff_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/tsv_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/tsv_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/txt_convert_options.rb +246 -0
- data/lib/groupdocs_conversion_cloud/models/txt_load_options.rb +302 -0
- data/lib/groupdocs_conversion_cloud/models/vdw_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vdx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vsd_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vsdm_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vsdx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vss_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vssm_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vssx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vst_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vstm_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vstx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vsx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/vtx_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/watermark_options.rb +364 -0
- data/lib/groupdocs_conversion_cloud/models/webp_convert_options.rb +376 -0
- data/lib/groupdocs_conversion_cloud/models/webp_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/wmf_convert_options.rb +361 -0
- data/lib/groupdocs_conversion_cloud/models/wmf_load_options.rb +214 -0
- data/lib/groupdocs_conversion_cloud/models/word_processing_convert_options.rb +326 -0
- data/lib/groupdocs_conversion_cloud/models/word_processing_load_options.rb +281 -0
- data/lib/groupdocs_conversion_cloud/models/xls2003_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xls2003_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xls_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xls_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xlsb_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xlsb_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xlsm_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xlsm_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xlsx_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xlsx_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xltm_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xltm_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xltx_convert_options.rb +296 -0
- data/lib/groupdocs_conversion_cloud/models/xltx_load_options.rb +321 -0
- data/lib/groupdocs_conversion_cloud/models/xml_load_options.rb +230 -0
- data/lib/groupdocs_conversion_cloud/models/xps_convert_options.rb +386 -0
- data/lib/groupdocs_conversion_cloud/version.rb +29 -0
- metadata +288 -0
@@ -0,0 +1,326 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="dotx_convert_options.rb">
|
4
|
+
# Copyright (c) 2003-2019 Aspose Pty Ltd
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
15
|
+
# copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
# SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'date'
|
29
|
+
|
30
|
+
module GroupDocsConversionCloud
|
31
|
+
# Dotx convert options
|
32
|
+
class DotxConvertOptions
|
33
|
+
|
34
|
+
# Start conversion from FromPage page
|
35
|
+
attr_accessor :from_page
|
36
|
+
|
37
|
+
# Number of pages to convert
|
38
|
+
attr_accessor :pages_count
|
39
|
+
|
40
|
+
# Convert specific pages. The list contains the page indexes of the pages to be converted
|
41
|
+
attr_accessor :pages
|
42
|
+
|
43
|
+
# Desired page width after conversion
|
44
|
+
attr_accessor :width
|
45
|
+
|
46
|
+
# Desired page height after conversion
|
47
|
+
attr_accessor :height
|
48
|
+
|
49
|
+
# Desired page DPI after conversion. The default resolution is: 96dpi
|
50
|
+
attr_accessor :dpi
|
51
|
+
|
52
|
+
# Set this property if you want to protect the converted document with a password
|
53
|
+
attr_accessor :password
|
54
|
+
|
55
|
+
# Specifies the zoom level in percentage. Default is 100. Default zoom is supported till Microsoft Word 2010. Starting from Microsoft Word 2013 default zoom is no longer set to document, instead it appears to use the zoom factor of the last document that was opened.
|
56
|
+
attr_accessor :zoom
|
57
|
+
|
58
|
+
# Watermark specific options
|
59
|
+
attr_accessor :watermark_options
|
60
|
+
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
62
|
+
def self.attribute_map
|
63
|
+
{
|
64
|
+
:'from_page' => :'FromPage',
|
65
|
+
:'pages_count' => :'PagesCount',
|
66
|
+
:'pages' => :'Pages',
|
67
|
+
:'width' => :'Width',
|
68
|
+
:'height' => :'Height',
|
69
|
+
:'dpi' => :'Dpi',
|
70
|
+
:'password' => :'Password',
|
71
|
+
:'zoom' => :'Zoom',
|
72
|
+
:'watermark_options' => :'WatermarkOptions'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.swagger_types
|
78
|
+
{
|
79
|
+
:'from_page' => :'Integer',
|
80
|
+
:'pages_count' => :'Integer',
|
81
|
+
:'pages' => :'Array<Integer>',
|
82
|
+
:'width' => :'Integer',
|
83
|
+
:'height' => :'Integer',
|
84
|
+
:'dpi' => :'Float',
|
85
|
+
:'password' => :'String',
|
86
|
+
:'zoom' => :'Integer',
|
87
|
+
:'watermark_options' => :'WatermarkOptions'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# Initializes the object
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
def initialize(attributes = {})
|
94
|
+
return unless attributes.is_a?(Hash)
|
95
|
+
|
96
|
+
# convert string to symbol for hash key
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
98
|
+
|
99
|
+
if attributes.key?(:'FromPage')
|
100
|
+
self.from_page = attributes[:'FromPage']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.key?(:'PagesCount')
|
104
|
+
self.pages_count = attributes[:'PagesCount']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'Pages')
|
108
|
+
if (value = attributes[:'Pages']).is_a?(Array)
|
109
|
+
self.pages = value
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'Width')
|
114
|
+
self.width = attributes[:'Width']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'Height')
|
118
|
+
self.height = attributes[:'Height']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'Dpi')
|
122
|
+
self.dpi = attributes[:'Dpi']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'Password')
|
126
|
+
self.password = attributes[:'Password']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'Zoom')
|
130
|
+
self.zoom = attributes[:'Zoom']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'WatermarkOptions')
|
134
|
+
self.watermark_options = attributes[:'WatermarkOptions']
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
140
|
+
# @return Array for valid properies with the reasons
|
141
|
+
def list_invalid_properties
|
142
|
+
invalid_properties = []
|
143
|
+
if @from_page.nil?
|
144
|
+
invalid_properties.push("invalid value for 'from_page', from_page cannot be nil.")
|
145
|
+
end
|
146
|
+
|
147
|
+
if @pages_count.nil?
|
148
|
+
invalid_properties.push("invalid value for 'pages_count', pages_count cannot be nil.")
|
149
|
+
end
|
150
|
+
|
151
|
+
if @width.nil?
|
152
|
+
invalid_properties.push("invalid value for 'width', width cannot be nil.")
|
153
|
+
end
|
154
|
+
|
155
|
+
if @height.nil?
|
156
|
+
invalid_properties.push("invalid value for 'height', height cannot be nil.")
|
157
|
+
end
|
158
|
+
|
159
|
+
if @dpi.nil?
|
160
|
+
invalid_properties.push("invalid value for 'dpi', dpi cannot be nil.")
|
161
|
+
end
|
162
|
+
|
163
|
+
if @zoom.nil?
|
164
|
+
invalid_properties.push("invalid value for 'zoom', zoom cannot be nil.")
|
165
|
+
end
|
166
|
+
|
167
|
+
return invalid_properties
|
168
|
+
end
|
169
|
+
|
170
|
+
# Check to see if the all the properties in the model are valid
|
171
|
+
# @return true if the model is valid
|
172
|
+
def valid?
|
173
|
+
return false if @from_page.nil?
|
174
|
+
return false if @pages_count.nil?
|
175
|
+
return false if @width.nil?
|
176
|
+
return false if @height.nil?
|
177
|
+
return false if @dpi.nil?
|
178
|
+
return false if @zoom.nil?
|
179
|
+
return true
|
180
|
+
end
|
181
|
+
|
182
|
+
# Checks equality by comparing each attribute.
|
183
|
+
# @param [Object] Object to be compared
|
184
|
+
def ==(other)
|
185
|
+
return true if self.equal?(other)
|
186
|
+
self.class == other.class &&
|
187
|
+
from_page == other.from_page &&
|
188
|
+
pages_count == other.pages_count &&
|
189
|
+
pages == other.pages &&
|
190
|
+
width == other.width &&
|
191
|
+
height == other.height &&
|
192
|
+
dpi == other.dpi &&
|
193
|
+
password == other.password &&
|
194
|
+
zoom == other.zoom &&
|
195
|
+
watermark_options == other.watermark_options
|
196
|
+
end
|
197
|
+
|
198
|
+
# @see the `==` method
|
199
|
+
# @param [Object] Object to be compared
|
200
|
+
def eql?(other)
|
201
|
+
self == other
|
202
|
+
end
|
203
|
+
|
204
|
+
# Calculates hash code according to all attributes.
|
205
|
+
# @return [Fixnum] Hash code
|
206
|
+
def hash
|
207
|
+
[from_page, pages_count, pages, width, height, dpi, password, zoom, watermark_options].hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Downcases first letter.
|
211
|
+
# @return downcased string
|
212
|
+
def uncap(str)
|
213
|
+
str[0, 1].downcase + str[1..-1]
|
214
|
+
end
|
215
|
+
|
216
|
+
# Builds the object from hash
|
217
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
218
|
+
# @return [Object] Returns the model itself
|
219
|
+
def build_from_hash(attributes)
|
220
|
+
return nil unless attributes.is_a?(Hash)
|
221
|
+
self.class.swagger_types.each_pair do |key, type|
|
222
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
223
|
+
value = attributes[pname]
|
224
|
+
if type =~ /\AArray<(.*)>/i
|
225
|
+
# check to ensure the input is an array given that the the attribute
|
226
|
+
# is documented as an array but the input is not
|
227
|
+
if value.is_a?(Array)
|
228
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
229
|
+
end
|
230
|
+
elsif !value.nil?
|
231
|
+
self.send("#{key}=", _deserialize(type, value))
|
232
|
+
end
|
233
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
234
|
+
end
|
235
|
+
|
236
|
+
self
|
237
|
+
end
|
238
|
+
|
239
|
+
# Deserializes the data based on type
|
240
|
+
# @param string type Data type
|
241
|
+
# @param string value Value to be deserialized
|
242
|
+
# @return [Object] Deserialized data
|
243
|
+
def _deserialize(type, value)
|
244
|
+
case type.to_sym
|
245
|
+
when :DateTime
|
246
|
+
Date.parse value
|
247
|
+
when :Date
|
248
|
+
Date.parse value
|
249
|
+
when :String
|
250
|
+
value.to_s
|
251
|
+
when :Integer
|
252
|
+
value.to_i
|
253
|
+
when :Float
|
254
|
+
value.to_f
|
255
|
+
when :BOOLEAN
|
256
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
257
|
+
true
|
258
|
+
else
|
259
|
+
false
|
260
|
+
end
|
261
|
+
when :Object
|
262
|
+
# generic object (usually a Hash), return directly
|
263
|
+
value
|
264
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
265
|
+
inner_type = Regexp.last_match[:inner_type]
|
266
|
+
value.map { |v| _deserialize(inner_type, v) }
|
267
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
268
|
+
k_type = Regexp.last_match[:k_type]
|
269
|
+
v_type = Regexp.last_match[:v_type]
|
270
|
+
{}.tap do |hash|
|
271
|
+
value.each do |k, v|
|
272
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
273
|
+
end
|
274
|
+
end
|
275
|
+
else
|
276
|
+
# model
|
277
|
+
temp_model = GroupDocsConversionCloud.const_get(type).new
|
278
|
+
temp_model.build_from_hash(value)
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
# Returns the string representation of the object
|
283
|
+
# @return [String] String presentation of the object
|
284
|
+
def to_s
|
285
|
+
to_hash.to_s
|
286
|
+
end
|
287
|
+
|
288
|
+
# to_body is an alias to to_hash (backward compatibility)
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
290
|
+
def to_body
|
291
|
+
to_hash
|
292
|
+
end
|
293
|
+
|
294
|
+
# Returns the object in the form of hash
|
295
|
+
# @return [Hash] Returns the object in the form of hash
|
296
|
+
def to_hash
|
297
|
+
hash = {}
|
298
|
+
self.class.attribute_map.each_pair do |attr, param|
|
299
|
+
value = self.send(attr)
|
300
|
+
next if value.nil?
|
301
|
+
hash[param] = _to_hash(value)
|
302
|
+
end
|
303
|
+
hash
|
304
|
+
end
|
305
|
+
|
306
|
+
# Outputs non-array value in the form of hash
|
307
|
+
# For object, use to_hash. Otherwise, just return the value
|
308
|
+
# @param [Object] value Any valid value
|
309
|
+
# @return [Hash] Returns the value in the form of hash
|
310
|
+
def _to_hash(value)
|
311
|
+
if value.is_a?(Array)
|
312
|
+
value.compact.map { |v| _to_hash(v) }
|
313
|
+
elsif value.is_a?(Hash)
|
314
|
+
{}.tap do |hash|
|
315
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
316
|
+
end
|
317
|
+
elsif value.respond_to? :to_hash
|
318
|
+
value.to_hash
|
319
|
+
else
|
320
|
+
value
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
end
|
325
|
+
|
326
|
+
end
|
@@ -0,0 +1,281 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="dotx_load_options.rb">
|
4
|
+
# Copyright (c) 2003-2019 Aspose Pty Ltd
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
15
|
+
# copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
# SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'date'
|
29
|
+
|
30
|
+
module GroupDocsConversionCloud
|
31
|
+
# Dotx load options
|
32
|
+
class DotxLoadOptions
|
33
|
+
|
34
|
+
# Default font for Words document. The following font will be used if a font is missing.
|
35
|
+
attr_accessor :default_font
|
36
|
+
|
37
|
+
# If AutoFontSubstitution is disabled, GroupDocs.Conversion uses the DefaultFont for the substitution of missing fonts. If AutoFontSubstitution is enabled, GroupDocs.Conversion evaluates all the related fields in FontInfo (Panose, Sig etc) for the missing font and finds the closest match among the available font sources. Note that font substitution mechanism will override the DefaultFont in cases when FontInfo for the missing font is available in the document. The default value is True.
|
38
|
+
attr_accessor :auto_font_substitution
|
39
|
+
|
40
|
+
# Substitute specific fonts when converting Words document.
|
41
|
+
attr_accessor :font_substitutes
|
42
|
+
|
43
|
+
# Set password to unprotect protected document
|
44
|
+
attr_accessor :password
|
45
|
+
|
46
|
+
# Hide markup and track changes for Word documents
|
47
|
+
attr_accessor :hide_word_tracked_changes
|
48
|
+
|
49
|
+
# Hide comments
|
50
|
+
attr_accessor :hide_comments
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'default_font' => :'DefaultFont',
|
56
|
+
:'auto_font_substitution' => :'AutoFontSubstitution',
|
57
|
+
:'font_substitutes' => :'FontSubstitutes',
|
58
|
+
:'password' => :'Password',
|
59
|
+
:'hide_word_tracked_changes' => :'HideWordTrackedChanges',
|
60
|
+
:'hide_comments' => :'HideComments'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# Attribute type mapping.
|
65
|
+
def self.swagger_types
|
66
|
+
{
|
67
|
+
:'default_font' => :'String',
|
68
|
+
:'auto_font_substitution' => :'BOOLEAN',
|
69
|
+
:'font_substitutes' => :'Hash<String, String>',
|
70
|
+
:'password' => :'String',
|
71
|
+
:'hide_word_tracked_changes' => :'BOOLEAN',
|
72
|
+
:'hide_comments' => :'BOOLEAN'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Initializes the object
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
78
|
+
def initialize(attributes = {})
|
79
|
+
return unless attributes.is_a?(Hash)
|
80
|
+
|
81
|
+
# convert string to symbol for hash key
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
83
|
+
|
84
|
+
if attributes.key?(:'DefaultFont')
|
85
|
+
self.default_font = attributes[:'DefaultFont']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'AutoFontSubstitution')
|
89
|
+
self.auto_font_substitution = attributes[:'AutoFontSubstitution']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'FontSubstitutes')
|
93
|
+
if (value = attributes[:'FontSubstitutes']).is_a?(Hash)
|
94
|
+
self.font_substitutes = value
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'Password')
|
99
|
+
self.password = attributes[:'Password']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'HideWordTrackedChanges')
|
103
|
+
self.hide_word_tracked_changes = attributes[:'HideWordTrackedChanges']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'HideComments')
|
107
|
+
self.hide_comments = attributes[:'HideComments']
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
113
|
+
# @return Array for valid properies with the reasons
|
114
|
+
def list_invalid_properties
|
115
|
+
invalid_properties = []
|
116
|
+
if @auto_font_substitution.nil?
|
117
|
+
invalid_properties.push("invalid value for 'auto_font_substitution', auto_font_substitution cannot be nil.")
|
118
|
+
end
|
119
|
+
|
120
|
+
if @hide_word_tracked_changes.nil?
|
121
|
+
invalid_properties.push("invalid value for 'hide_word_tracked_changes', hide_word_tracked_changes cannot be nil.")
|
122
|
+
end
|
123
|
+
|
124
|
+
if @hide_comments.nil?
|
125
|
+
invalid_properties.push("invalid value for 'hide_comments', hide_comments cannot be nil.")
|
126
|
+
end
|
127
|
+
|
128
|
+
return invalid_properties
|
129
|
+
end
|
130
|
+
|
131
|
+
# Check to see if the all the properties in the model are valid
|
132
|
+
# @return true if the model is valid
|
133
|
+
def valid?
|
134
|
+
return false if @auto_font_substitution.nil?
|
135
|
+
return false if @hide_word_tracked_changes.nil?
|
136
|
+
return false if @hide_comments.nil?
|
137
|
+
return true
|
138
|
+
end
|
139
|
+
|
140
|
+
# Checks equality by comparing each attribute.
|
141
|
+
# @param [Object] Object to be compared
|
142
|
+
def ==(other)
|
143
|
+
return true if self.equal?(other)
|
144
|
+
self.class == other.class &&
|
145
|
+
default_font == other.default_font &&
|
146
|
+
auto_font_substitution == other.auto_font_substitution &&
|
147
|
+
font_substitutes == other.font_substitutes &&
|
148
|
+
password == other.password &&
|
149
|
+
hide_word_tracked_changes == other.hide_word_tracked_changes &&
|
150
|
+
hide_comments == other.hide_comments
|
151
|
+
end
|
152
|
+
|
153
|
+
# @see the `==` method
|
154
|
+
# @param [Object] Object to be compared
|
155
|
+
def eql?(other)
|
156
|
+
self == other
|
157
|
+
end
|
158
|
+
|
159
|
+
# Calculates hash code according to all attributes.
|
160
|
+
# @return [Fixnum] Hash code
|
161
|
+
def hash
|
162
|
+
[default_font, auto_font_substitution, font_substitutes, password, hide_word_tracked_changes, hide_comments].hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Downcases first letter.
|
166
|
+
# @return downcased string
|
167
|
+
def uncap(str)
|
168
|
+
str[0, 1].downcase + str[1..-1]
|
169
|
+
end
|
170
|
+
|
171
|
+
# Builds the object from hash
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
173
|
+
# @return [Object] Returns the model itself
|
174
|
+
def build_from_hash(attributes)
|
175
|
+
return nil unless attributes.is_a?(Hash)
|
176
|
+
self.class.swagger_types.each_pair do |key, type|
|
177
|
+
pname = uncap(self.class.attribute_map[key]).intern
|
178
|
+
value = attributes[pname]
|
179
|
+
if type =~ /\AArray<(.*)>/i
|
180
|
+
# check to ensure the input is an array given that the the attribute
|
181
|
+
# is documented as an array but the input is not
|
182
|
+
if value.is_a?(Array)
|
183
|
+
self.send("#{key}=", value.map { |v| _deserialize($1, v) })
|
184
|
+
end
|
185
|
+
elsif !value.nil?
|
186
|
+
self.send("#{key}=", _deserialize(type, value))
|
187
|
+
end
|
188
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
189
|
+
end
|
190
|
+
|
191
|
+
self
|
192
|
+
end
|
193
|
+
|
194
|
+
# Deserializes the data based on type
|
195
|
+
# @param string type Data type
|
196
|
+
# @param string value Value to be deserialized
|
197
|
+
# @return [Object] Deserialized data
|
198
|
+
def _deserialize(type, value)
|
199
|
+
case type.to_sym
|
200
|
+
when :DateTime
|
201
|
+
Date.parse value
|
202
|
+
when :Date
|
203
|
+
Date.parse value
|
204
|
+
when :String
|
205
|
+
value.to_s
|
206
|
+
when :Integer
|
207
|
+
value.to_i
|
208
|
+
when :Float
|
209
|
+
value.to_f
|
210
|
+
when :BOOLEAN
|
211
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
212
|
+
true
|
213
|
+
else
|
214
|
+
false
|
215
|
+
end
|
216
|
+
when :Object
|
217
|
+
# generic object (usually a Hash), return directly
|
218
|
+
value
|
219
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
220
|
+
inner_type = Regexp.last_match[:inner_type]
|
221
|
+
value.map { |v| _deserialize(inner_type, v) }
|
222
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
223
|
+
k_type = Regexp.last_match[:k_type]
|
224
|
+
v_type = Regexp.last_match[:v_type]
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each do |k, v|
|
227
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
else
|
231
|
+
# model
|
232
|
+
temp_model = GroupDocsConversionCloud.const_get(type).new
|
233
|
+
temp_model.build_from_hash(value)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the string representation of the object
|
238
|
+
# @return [String] String presentation of the object
|
239
|
+
def to_s
|
240
|
+
to_hash.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_body
|
246
|
+
to_hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns the object in the form of hash
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_hash
|
252
|
+
hash = {}
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
254
|
+
value = self.send(attr)
|
255
|
+
next if value.nil?
|
256
|
+
hash[param] = _to_hash(value)
|
257
|
+
end
|
258
|
+
hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Outputs non-array value in the form of hash
|
262
|
+
# For object, use to_hash. Otherwise, just return the value
|
263
|
+
# @param [Object] value Any valid value
|
264
|
+
# @return [Hash] Returns the value in the form of hash
|
265
|
+
def _to_hash(value)
|
266
|
+
if value.is_a?(Array)
|
267
|
+
value.compact.map { |v| _to_hash(v) }
|
268
|
+
elsif value.is_a?(Hash)
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
271
|
+
end
|
272
|
+
elsif value.respond_to? :to_hash
|
273
|
+
value.to_hash
|
274
|
+
else
|
275
|
+
value
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|