pdf4me 1.0.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE → LICENSE.txt} +6 -6
- data/README.md +124 -395
- data/lib/pdf4me.rb +40 -110
- data/lib/pdf4me/actions/complex_action.rb +64 -0
- data/lib/pdf4me/actions/convert_file_to_pdf.rb +30 -0
- data/lib/pdf4me/actions/convert_to_pdf.rb +14 -0
- data/lib/pdf4me/actions/create_pdf_a.rb +29 -0
- data/lib/pdf4me/actions/create_thumbnail.rb +55 -0
- data/lib/pdf4me/actions/extract_pages.rb +49 -0
- data/lib/pdf4me/actions/merge_two_pdfs.rb +34 -0
- data/lib/pdf4me/actions/optimize.rb +10 -0
- data/lib/pdf4me/actions/optimize_by_profile.rb +42 -0
- data/lib/pdf4me/actions/split_by_page_nr.rb +55 -0
- data/lib/pdf4me/actions/text_stamp.rb +63 -0
- data/lib/pdf4me/actions/wrapper_action.rb +65 -0
- data/lib/pdf4me/client.rb +87 -0
- data/lib/pdf4me/configuration.rb +9 -88
- data/lib/pdf4me/exceptions.rb +26 -0
- data/lib/pdf4me/models/base.rb +26 -0
- data/lib/pdf4me/models/convert_to_pdf_action.rb +26 -246
- data/lib/pdf4me/models/convert_to_pdf_res.rb +5 -185
- data/lib/pdf4me/models/doc_log.rb +12 -257
- data/lib/pdf4me/models/doc_metadata.rb +13 -282
- data/lib/pdf4me/models/document.rb +14 -282
- data/lib/pdf4me/models/notification.rb +8 -191
- data/lib/pdf4me/models/optimize_action.rb +72 -508
- data/lib/pdf4me/models/optimize_res.rb +5 -195
- data/lib/pdf4me/models/page.rb +12 -254
- data/lib/pdf4me/utils/assigner.rb +10 -0
- data/lib/pdf4me/utils/serializer.rb +43 -0
- data/lib/pdf4me/version.rb +1 -13
- data/spec/actions/create_pdf_a_spec.rb +21 -0
- data/spec/actions/wrapper_action_spec.rb +24 -0
- data/spec/files/4.pdf +0 -0
- data/spec/spec_helper.rb +17 -100
- metadata +70 -421
- data/Gemfile +0 -7
- data/Rakefile +0 -8
- data/docs/ActionFlow.md +0 -8
- data/docs/ApiUsageRes.md +0 -11
- data/docs/ArchiveConfig.md +0 -11
- data/docs/ArchiveJobReq.md +0 -12
- data/docs/ArchiveJobRes.md +0 -9
- data/docs/Color.md +0 -10
- data/docs/ConvertApi.md +0 -102
- data/docs/ConvertToPdf.md +0 -10
- data/docs/ConvertToPdfAction.md +0 -10
- data/docs/ConvertToPdfRes.md +0 -8
- data/docs/CreateImages.md +0 -10
- data/docs/CreateImagesRes.md +0 -8
- data/docs/CreatePdfA.md +0 -10
- data/docs/CreatePdfARes.md +0 -8
- data/docs/CustomCMSConfig.md +0 -23
- data/docs/DocAction.md +0 -8
- data/docs/DocLog.md +0 -12
- data/docs/DocMetadata.md +0 -16
- data/docs/Document.md +0 -16
- data/docs/DocumentApi.md +0 -203
- data/docs/DropDocumentReq.md +0 -20
- data/docs/DropDocumentRes.md +0 -15
- data/docs/ExecutionTrigger.md +0 -10
- data/docs/Extract.md +0 -10
- data/docs/ExtractAction.md +0 -9
- data/docs/ExtractApi.md +0 -102
- data/docs/ExtractRes.md +0 -8
- data/docs/GetDocumentListRes.md +0 -13
- data/docs/GetDocumentReq.md +0 -14
- data/docs/GetDocumentRes.md +0 -14
- data/docs/IFormFile.md +0 -13
- data/docs/Image.md +0 -15
- data/docs/ImageAction.md +0 -30
- data/docs/ImageApi.md +0 -107
- data/docs/Job.md +0 -10
- data/docs/JobApi.md +0 -197
- data/docs/JobConfig.md +0 -18
- data/docs/JobConfigRes.md +0 -8
- data/docs/KeyValuePairStringObject.md +0 -9
- data/docs/KeyValuePairStringString.md +0 -9
- data/docs/ManagementApi.md +0 -92
- data/docs/Merge.md +0 -10
- data/docs/MergeAction.md +0 -8
- data/docs/MergeApi.md +0 -102
- data/docs/MergeRes.md +0 -8
- data/docs/Notification.md +0 -9
- data/docs/OcrAction.md +0 -12
- data/docs/OcrApi.md +0 -57
- data/docs/Optimize.md +0 -10
- data/docs/OptimizeAction.md +0 -35
- data/docs/OptimizeApi.md +0 -103
- data/docs/OptimizeRes.md +0 -9
- data/docs/Page.md +0 -14
- data/docs/PageSelection.md +0 -10
- data/docs/Pdf4meAction.md +0 -12
- data/docs/Pdf4meDocument.md +0 -32
- data/docs/Pdf4meException.md +0 -8
- data/docs/PdfAAction.md +0 -14
- data/docs/PdfAApi.md +0 -102
- data/docs/PdfFont.md +0 -9
- data/docs/Pricing.md +0 -13
- data/docs/ProduceDocuments.md +0 -14
- data/docs/ProduceDocumentsRes.md +0 -8
- data/docs/ProduceOutput.md +0 -8
- data/docs/RGBSet.md +0 -10
- data/docs/RecognizeDocument.md +0 -10
- data/docs/RecognizeDocumentRes.md +0 -9
- data/docs/Rectangle.md +0 -11
- data/docs/Rotate.md +0 -10
- data/docs/RunJobRes.md +0 -10
- data/docs/SignatureConfig.md +0 -7
- data/docs/Split.md +0 -10
- data/docs/SplitAction.md +0 -11
- data/docs/SplitApi.md +0 -103
- data/docs/SplitRes.md +0 -8
- data/docs/Stamp.md +0 -10
- data/docs/StampAction.md +0 -22
- data/docs/StampApi.md +0 -110
- data/docs/StampRes.md +0 -8
- data/docs/StorageFolder.md +0 -10
- data/docs/Text.md +0 -17
- data/docs/Transform.md +0 -13
- data/docs/Translate.md +0 -9
- data/docs/UserFingerprint.md +0 -9
- data/docs/VersionRes.md +0 -8
- data/docs/java.md +0 -425
- data/lib/pdf4me/api/convert_api.rb +0 -130
- data/lib/pdf4me/api/document_api.rb +0 -218
- data/lib/pdf4me/api/extract_api.rb +0 -131
- data/lib/pdf4me/api/image_api.rb +0 -139
- data/lib/pdf4me/api/job_api.rb +0 -223
- data/lib/pdf4me/api/management_api.rb +0 -117
- data/lib/pdf4me/api/merge_api.rb +0 -131
- data/lib/pdf4me/api/ocr_api.rb +0 -74
- data/lib/pdf4me/api/optimize_api.rb +0 -139
- data/lib/pdf4me/api/pdf_a_api.rb +0 -134
- data/lib/pdf4me/api/split_api.rb +0 -135
- data/lib/pdf4me/api/stamp_api.rb +0 -159
- data/lib/pdf4me/api_client.rb +0 -380
- data/lib/pdf4me/api_error.rb +0 -38
- data/lib/pdf4me/models/action_flow.rb +0 -190
- data/lib/pdf4me/models/api_usage_res.rb +0 -219
- data/lib/pdf4me/models/archive_config.rb +0 -226
- data/lib/pdf4me/models/archive_job_req.rb +0 -249
- data/lib/pdf4me/models/archive_job_res.rb +0 -207
- data/lib/pdf4me/models/color.rb +0 -206
- data/lib/pdf4me/models/convert_to_pdf.rb +0 -209
- data/lib/pdf4me/models/create_images.rb +0 -209
- data/lib/pdf4me/models/create_images_res.rb +0 -189
- data/lib/pdf4me/models/create_pdf_a.rb +0 -209
- data/lib/pdf4me/models/create_pdf_a_res.rb +0 -189
- data/lib/pdf4me/models/custom_cms_config.rb +0 -323
- data/lib/pdf4me/models/doc_action.rb +0 -190
- data/lib/pdf4me/models/drop_document_req.rb +0 -348
- data/lib/pdf4me/models/drop_document_res.rb +0 -260
- data/lib/pdf4me/models/execution_trigger.rb +0 -206
- data/lib/pdf4me/models/extract.rb +0 -207
- data/lib/pdf4me/models/extract_action.rb +0 -201
- data/lib/pdf4me/models/extract_res.rb +0 -188
- data/lib/pdf4me/models/get_document_list_res.rb +0 -237
- data/lib/pdf4me/models/get_document_req.rb +0 -243
- data/lib/pdf4me/models/get_document_res.rb +0 -246
- data/lib/pdf4me/models/i_form_file.rb +0 -235
- data/lib/pdf4me/models/image.rb +0 -300
- data/lib/pdf4me/models/image_action.rb +0 -513
- data/lib/pdf4me/models/job.rb +0 -213
- data/lib/pdf4me/models/job_config.rb +0 -298
- data/lib/pdf4me/models/job_config_res.rb +0 -193
- data/lib/pdf4me/models/key_value_pair_string_object.rb +0 -197
- data/lib/pdf4me/models/key_value_pair_string_string.rb +0 -197
- data/lib/pdf4me/models/merge.rb +0 -209
- data/lib/pdf4me/models/merge_action.rb +0 -190
- data/lib/pdf4me/models/merge_res.rb +0 -188
- data/lib/pdf4me/models/ocr_action.rb +0 -259
- data/lib/pdf4me/models/optimize.rb +0 -209
- data/lib/pdf4me/models/page_selection.rb +0 -246
- data/lib/pdf4me/models/pdf4me_action.rb +0 -259
- data/lib/pdf4me/models/pdf4me_document.rb +0 -511
- data/lib/pdf4me/models/pdf4me_exception.rb +0 -189
- data/lib/pdf4me/models/pdf_a_action.rb +0 -297
- data/lib/pdf4me/models/pdf_font.rb +0 -213
- data/lib/pdf4me/models/pricing.rb +0 -278
- data/lib/pdf4me/models/produce_documents.rb +0 -251
- data/lib/pdf4me/models/produce_documents_res.rb +0 -191
- data/lib/pdf4me/models/produce_output.rb +0 -221
- data/lib/pdf4me/models/recognize_document.rb +0 -209
- data/lib/pdf4me/models/recognize_document_res.rb +0 -198
- data/lib/pdf4me/models/rectangle.rb +0 -215
- data/lib/pdf4me/models/rgb_set.rb +0 -206
- data/lib/pdf4me/models/rotate.rb +0 -221
- data/lib/pdf4me/models/run_job_res.rb +0 -215
- data/lib/pdf4me/models/signature_config.rb +0 -179
- data/lib/pdf4me/models/split.rb +0 -207
- data/lib/pdf4me/models/split_action.rb +0 -219
- data/lib/pdf4me/models/split_res.rb +0 -190
- data/lib/pdf4me/models/stamp.rb +0 -209
- data/lib/pdf4me/models/stamp_action.rb +0 -387
- data/lib/pdf4me/models/stamp_res.rb +0 -189
- data/lib/pdf4me/models/storage_folder.rb +0 -239
- data/lib/pdf4me/models/text.rb +0 -320
- data/lib/pdf4me/models/transform.rb +0 -263
- data/lib/pdf4me/models/translate.rb +0 -207
- data/lib/pdf4me/models/user_fingerprint.rb +0 -197
- data/lib/pdf4me/models/version_res.rb +0 -188
- data/pdf4me.gemspec +0 -47
- data/spec/api/convert_api_spec.rb +0 -60
- data/spec/api/document_api_spec.rb +0 -83
- data/spec/api/extract_api_spec.rb +0 -60
- data/spec/api/image_api_spec.rb +0 -62
- data/spec/api/job_api_spec.rb +0 -82
- data/spec/api/management_api_spec.rb +0 -57
- data/spec/api/merge_api_spec.rb +0 -60
- data/spec/api/ocr_api_spec.rb +0 -47
- data/spec/api/optimize_api_spec.rb +0 -60
- data/spec/api/pdf_a_api_spec.rb +0 -60
- data/spec/api/split_api_spec.rb +0 -60
- data/spec/api/stamp_api_spec.rb +0 -63
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/action_flow_spec.rb +0 -42
- data/spec/models/api_usage_res_spec.rb +0 -60
- data/spec/models/archive_config_spec.rb +0 -60
- data/spec/models/archive_job_req_spec.rb +0 -66
- data/spec/models/archive_job_res_spec.rb +0 -48
- data/spec/models/color_spec.rb +0 -54
- data/spec/models/convert_to_pdf_action_spec.rb +0 -62
- data/spec/models/convert_to_pdf_res_spec.rb +0 -42
- data/spec/models/convert_to_pdf_spec.rb +0 -54
- data/spec/models/create_images_res_spec.rb +0 -42
- data/spec/models/create_images_spec.rb +0 -54
- data/spec/models/create_pdf_a_res_spec.rb +0 -42
- data/spec/models/create_pdf_a_spec.rb +0 -54
- data/spec/models/custom_cms_config_spec.rb +0 -132
- data/spec/models/doc_action_spec.rb +0 -42
- data/spec/models/doc_log_spec.rb +0 -70
- data/spec/models/doc_metadata_spec.rb +0 -90
- data/spec/models/document_spec.rb +0 -90
- data/spec/models/drop_document_req_spec.rb +0 -118
- data/spec/models/drop_document_res_spec.rb +0 -84
- data/spec/models/execution_trigger_spec.rb +0 -54
- data/spec/models/extract_action_spec.rb +0 -48
- data/spec/models/extract_res_spec.rb +0 -42
- data/spec/models/extract_spec.rb +0 -54
- data/spec/models/get_document_list_res_spec.rb +0 -72
- data/spec/models/get_document_req_spec.rb +0 -78
- data/spec/models/get_document_res_spec.rb +0 -78
- data/spec/models/i_form_file_spec.rb +0 -72
- data/spec/models/image_action_spec.rb +0 -206
- data/spec/models/image_spec.rb +0 -88
- data/spec/models/job_config_res_spec.rb +0 -42
- data/spec/models/job_config_spec.rb +0 -102
- data/spec/models/job_spec.rb +0 -54
- data/spec/models/key_value_pair_string_object_spec.rb +0 -48
- data/spec/models/key_value_pair_string_string_spec.rb +0 -48
- data/spec/models/merge_action_spec.rb +0 -42
- data/spec/models/merge_res_spec.rb +0 -42
- data/spec/models/merge_spec.rb +0 -54
- data/spec/models/notification_spec.rb +0 -48
- data/spec/models/ocr_action_spec.rb +0 -70
- data/spec/models/optimize_action_spec.rb +0 -228
- data/spec/models/optimize_res_spec.rb +0 -48
- data/spec/models/optimize_spec.rb +0 -54
- data/spec/models/page_selection_spec.rb +0 -58
- data/spec/models/page_spec.rb +0 -78
- data/spec/models/pdf4me_action_spec.rb +0 -70
- data/spec/models/pdf4me_document_spec.rb +0 -202
- data/spec/models/pdf4me_exception_spec.rb +0 -42
- data/spec/models/pdf_a_action_spec.rb +0 -86
- data/spec/models/pdf_font_spec.rb +0 -48
- data/spec/models/pricing_spec.rb +0 -80
- data/spec/models/produce_documents_res_spec.rb +0 -42
- data/spec/models/produce_documents_spec.rb +0 -78
- data/spec/models/produce_output_spec.rb +0 -46
- data/spec/models/recognize_document_res_spec.rb +0 -48
- data/spec/models/recognize_document_spec.rb +0 -54
- data/spec/models/rectangle_spec.rb +0 -60
- data/spec/models/rgb_set_spec.rb +0 -54
- data/spec/models/rotate_spec.rb +0 -54
- data/spec/models/run_job_res_spec.rb +0 -54
- data/spec/models/signature_config_spec.rb +0 -36
- data/spec/models/split_action_spec.rb +0 -60
- data/spec/models/split_res_spec.rb +0 -42
- data/spec/models/split_spec.rb +0 -54
- data/spec/models/stamp_action_spec.rb +0 -142
- data/spec/models/stamp_res_spec.rb +0 -42
- data/spec/models/stamp_spec.rb +0 -54
- data/spec/models/storage_folder_spec.rb +0 -58
- data/spec/models/text_spec.rb +0 -104
- data/spec/models/transform_spec.rb +0 -72
- data/spec/models/translate_spec.rb +0 -48
- data/spec/models/user_fingerprint_spec.rb +0 -48
- data/spec/models/version_res_spec.rb +0 -42
@@ -1,514 +1,78 @@
|
|
1
|
-
=begin
|
2
|
-
#DmsApi
|
3
|
-
|
4
|
-
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
1
|
module Pdf4me
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
# Get or set the compression types for images that have an indexed (“palette”) color space.See also TPDFComprAttempt. Several values can be combined with bitwise or operators.The following values are allowed: - ComprAttemptNone - ComprAttemptRaw - ComprAttemptFlate - ComprAttemptLZW - ComprAttemptSource Other values are ignored. <para> During optimization, all set compression types are tried and the one resulting in the least memory footprint is taken. </para>{default: ComprAttemptFlate}
|
66
|
-
attr_accessor :indexed_compressions
|
67
|
-
|
68
|
-
# This option enables or disables dithering when down-sampling bi-tonal images. The only values supported are eDitherNone and eDitherFloydSteinberg. Some bi-tonal images try to evoke the impression of different levels of gray by randomly setting pixels to black.If dithering is applied during downsampling then the gray levels of such images are preserved better.If dithering is switched off then lines (e.g.text glyphs) are preserved better. {default: DitherNone}
|
69
|
-
attr_accessor :dithering_mode
|
70
|
-
|
71
|
-
# Get or set the target resolution in dots per inch (DPI) after re-sampling images for color images.See also ResolutionDPI. {default: 150}
|
72
|
-
attr_accessor :color_resolution_dpi
|
73
|
-
|
74
|
-
# Get or set the threshold resolution in dots per inch (DPI) to selectively activate re-sampling for color images.The value -1 deactivates re-sampling for color images. See also ThresholdDPI. {default: -1}
|
75
|
-
attr_accessor :color_threshold_dpi
|
76
|
-
|
77
|
-
# Get or set target resolution in dots per inch (DPI) after re-sampling images for monochrome images.See also ResolutionDPI. {default: 150}
|
78
|
-
attr_accessor :monochrome_resolution_dpi
|
79
|
-
|
80
|
-
# Get or set the threshold resolution in dots per inch (DPI) to selectively activate re-sampling for monochrome images.The value -1 deactivates re-sampling for monochrome images. See also ThresholdDPI. {default: -1}
|
81
|
-
attr_accessor :monochrome_threshold_dpi
|
82
|
-
|
83
|
-
# Get or set the resolution in DPI (dots per inch) after re-sampling images. This property affects all three image compression types(BitonalResolutionDPI, ColorResolutionDPI, MonochromeResolutionDPI). A typical value for the resolution when optimizing for the web is 150 DPI.For printing typically no re-sampling is applied(see property ThresholdDPI). Pre-blended images, images with a color key mask, mask, and soft mask images are not re-sampled. When getting ResolutionDPI, the property returns the target resolution in DPI for color images. {default: Different defaults apply to different image types}
|
84
|
-
attr_accessor :resolution_dpi
|
85
|
-
|
86
|
-
# Set the threshold in DPI (dots per inch) to selectively activate re-sampling. Only images with a resolution above the threshold DPI will be re-sampled. This property affects all three image compression types(BitonalThresholdDPI, ColorThresholdDPI, MonochromeThresholdDPI). The value -1 deactivates re-sampling. {default: -1}
|
87
|
-
attr_accessor :threshold_dpi
|
88
|
-
|
89
|
-
# Get or set the stripping mode. This mode can be configured to remove unneeded data of a PDF document such as Threads, Metadata, the PieceInfo, the StructTreeRoot entry, embedded Thumbs and the SpiderInfo entry.Also this mode is used to indicate whether to flatten form fields, links, and other annotations.Multiple values of TPDFStripType can be combined with the bitwise or operator. {default: StripThreads}
|
90
|
-
attr_accessor :strip
|
91
|
-
|
92
|
-
# Set a key-value pair in the document info dictionary. Values of predefined keys are also stored in the XMP metadata. Popular entries specified in the PDF Reference 1.7 and accepted by most PDF viewers are \"Title\", \"Author\", \"Subject\", \"Creator\" (sometimes referred to as Application), and \"Producer\" (sometimes referred to as PDF Creator).
|
93
|
-
attr_accessor :info_entries
|
94
|
-
|
95
|
-
# A signature in a PDF consist of two parts: a.The invisible digital signature in the PDF. b.The visual appearance that was attributed to the signature. Part (a) can be used by a viewing application, to verify that a document has not changed since it has been signed and report this to the user.Part(b) is merely a “decorative” element on the page without further significance. When optimizing a PDF, the PDF is altered and hence the digital signature is broken.Therefore, all signatures are removed , including parts(a) and(b). When the property FlattenSignatureFields is set to True, then digital signatures(parts (a)) are still removed, but their visual appearances(parts (b)) are flattened.I.e.the latter are retained and drawn as non-editable graphic onto the page. <para> Note: The resulting PDF can be misleading as it visually appears to be signed, but it has no digital signature and hence, a viewer application does not report any broken signature.In most cases, such a behavior is undesirable</para>
|
96
|
-
attr_accessor :flatten_signature_fields
|
97
|
-
|
98
|
-
attr_accessor :custom_properties
|
99
|
-
|
100
|
-
class EnumAttributeValidator
|
101
|
-
attr_reader :datatype
|
102
|
-
attr_reader :allowable_values
|
103
|
-
|
104
|
-
def initialize(datatype, allowable_values)
|
105
|
-
@allowable_values = allowable_values.map do |value|
|
106
|
-
case datatype.to_s
|
107
|
-
when /Integer/i
|
108
|
-
value.to_i
|
109
|
-
when /Float/i
|
110
|
-
value.to_f
|
111
|
-
else
|
112
|
-
value
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def valid?(value)
|
118
|
-
!value || allowable_values.include?(value)
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
123
|
-
def self.attribute_map
|
2
|
+
class OptimizeAction < Base
|
3
|
+
ATTRIBUTES = {
|
4
|
+
profile: 'String',
|
5
|
+
use_profile: 'BOOLEAN',
|
6
|
+
remove_redundant_objects: 'BOOLEAN',
|
7
|
+
subset_fonts: 'BOOLEAN',
|
8
|
+
optimize_resources: 'BOOLEAN',
|
9
|
+
force_compression_types: 'BOOLEAN',
|
10
|
+
force_recompression: 'BOOLEAN',
|
11
|
+
reduce_color_complexity: 'BOOLEAN',
|
12
|
+
merge_embedded_fonts: 'BOOLEAN',
|
13
|
+
bitonal_compressions: 'Array<String>',
|
14
|
+
bitonal_resolution_dpi: 'Float',
|
15
|
+
bitonal_threshold_dpi: 'Float',
|
16
|
+
clip_images: 'BOOLEAN',
|
17
|
+
continuous_compressions: 'Array<String>',
|
18
|
+
linearize: 'BOOLEAN',
|
19
|
+
image_quality: 'Integer',
|
20
|
+
indexed_compressions: 'Array<String>',
|
21
|
+
dithering_mode: 'String',
|
22
|
+
color_resolution_dpi: 'Float',
|
23
|
+
color_threshold_dpi: 'Float',
|
24
|
+
monochrome_resolution_dpi: 'Float',
|
25
|
+
monochrome_threshold_dpi: 'Float',
|
26
|
+
resolution_dpi: 'Integer',
|
27
|
+
threshold_dpi: 'Integer',
|
28
|
+
strip: 'Array<String>',
|
29
|
+
info_entries: 'Array<KeyValuePairStringString>',
|
30
|
+
flatten_signature_fields: 'BOOLEAN',
|
31
|
+
custom_properties: 'Array<KeyValuePairStringString>'
|
32
|
+
}
|
33
|
+
attr_accessor *ATTRIBUTES.keys
|
34
|
+
|
35
|
+
validates_inclusion_of(
|
36
|
+
:profile,
|
37
|
+
in: %w|default web print max|
|
38
|
+
)
|
39
|
+
validates_numericality_of(
|
40
|
+
:image_quality,
|
41
|
+
greater_than_or_equal_to: 1,
|
42
|
+
less_than_or_equal_to: 100
|
43
|
+
)
|
44
|
+
validates_inclusion_of(
|
45
|
+
:dithering_mode,
|
46
|
+
in: %w|none floydSteinberg halftone pattern g3Optimized g4Optimized atkinson|
|
47
|
+
)
|
48
|
+
|
49
|
+
def defaults
|
124
50
|
{
|
125
|
-
:
|
126
|
-
:
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
135
|
-
:
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:'strip' => :'strip',
|
150
|
-
:'info_entries' => :'infoEntries',
|
151
|
-
:'flatten_signature_fields' => :'flattenSignatureFields',
|
152
|
-
:'custom_properties' => :'customProperties'
|
51
|
+
profile: 'default',
|
52
|
+
use_profile: false,
|
53
|
+
remove_redundant_objects: false,
|
54
|
+
subset_fonts: false,
|
55
|
+
optimize_resources: false,
|
56
|
+
force_compression_types: false,
|
57
|
+
force_recompression: false,
|
58
|
+
reduce_color_complexity: false,
|
59
|
+
merge_embedded_fonts: false,
|
60
|
+
bitonal_compressions: %w|none|,
|
61
|
+
bitonal_resolution_dpi: 200,
|
62
|
+
bitonal_threshold_dpi: -1,
|
63
|
+
clip_images: false,
|
64
|
+
continuous_compressions: %w|none|,
|
65
|
+
linearize: false,
|
66
|
+
image_quality: 75,
|
67
|
+
dithering_mode: 'none',
|
68
|
+
color_resolution_dpi: 150,
|
69
|
+
color_threshold_dpi: -1,
|
70
|
+
monochrome_resolution_dpi: 150,
|
71
|
+
monochrome_threshold_dpi: -1,
|
72
|
+
threshold_dpi: -1,
|
73
|
+
strip: %w|threads|,
|
74
|
+
flatten_signature_fields: false
|
153
75
|
}
|
154
76
|
end
|
155
|
-
|
156
|
-
# Attribute type mapping.
|
157
|
-
def self.swagger_types
|
158
|
-
{
|
159
|
-
:'profile' => :'String',
|
160
|
-
:'use_profile' => :'BOOLEAN',
|
161
|
-
:'remove_redundant_objects' => :'BOOLEAN',
|
162
|
-
:'subset_fonts' => :'BOOLEAN',
|
163
|
-
:'optimize_resources' => :'BOOLEAN',
|
164
|
-
:'force_compression_types' => :'BOOLEAN',
|
165
|
-
:'force_recompression' => :'BOOLEAN',
|
166
|
-
:'reduce_color_complexity' => :'BOOLEAN',
|
167
|
-
:'merge_embedded_fonts' => :'BOOLEAN',
|
168
|
-
:'bitonal_compressions' => :'Array<String>',
|
169
|
-
:'bitonal_resolution_dpi' => :'Float',
|
170
|
-
:'bitonal_threshold_dpi' => :'Float',
|
171
|
-
:'clip_images' => :'BOOLEAN',
|
172
|
-
:'continuous_compressions' => :'Array<String>',
|
173
|
-
:'linearize' => :'BOOLEAN',
|
174
|
-
:'image_quality' => :'Integer',
|
175
|
-
:'indexed_compressions' => :'Array<String>',
|
176
|
-
:'dithering_mode' => :'String',
|
177
|
-
:'color_resolution_dpi' => :'Float',
|
178
|
-
:'color_threshold_dpi' => :'Float',
|
179
|
-
:'monochrome_resolution_dpi' => :'Float',
|
180
|
-
:'monochrome_threshold_dpi' => :'Float',
|
181
|
-
:'resolution_dpi' => :'Integer',
|
182
|
-
:'threshold_dpi' => :'Integer',
|
183
|
-
:'strip' => :'Array<String>',
|
184
|
-
:'info_entries' => :'Array<KeyValuePairStringString>',
|
185
|
-
:'flatten_signature_fields' => :'BOOLEAN',
|
186
|
-
:'custom_properties' => :'Array<KeyValuePairStringString>'
|
187
|
-
}
|
188
|
-
end
|
189
|
-
|
190
|
-
# Initializes the object
|
191
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
-
def initialize(attributes = {})
|
193
|
-
return unless attributes.is_a?(Hash)
|
194
|
-
|
195
|
-
# convert string to symbol for hash key
|
196
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
197
|
-
|
198
|
-
if attributes.has_key?(:'profile')
|
199
|
-
self.profile = attributes[:'profile']
|
200
|
-
end
|
201
|
-
|
202
|
-
if attributes.has_key?(:'useProfile')
|
203
|
-
self.use_profile = attributes[:'useProfile']
|
204
|
-
end
|
205
|
-
|
206
|
-
if attributes.has_key?(:'removeRedundantObjects')
|
207
|
-
self.remove_redundant_objects = attributes[:'removeRedundantObjects']
|
208
|
-
end
|
209
|
-
|
210
|
-
if attributes.has_key?(:'subsetFonts')
|
211
|
-
self.subset_fonts = attributes[:'subsetFonts']
|
212
|
-
end
|
213
|
-
|
214
|
-
if attributes.has_key?(:'optimizeResources')
|
215
|
-
self.optimize_resources = attributes[:'optimizeResources']
|
216
|
-
end
|
217
|
-
|
218
|
-
if attributes.has_key?(:'forceCompressionTypes')
|
219
|
-
self.force_compression_types = attributes[:'forceCompressionTypes']
|
220
|
-
end
|
221
|
-
|
222
|
-
if attributes.has_key?(:'forceRecompression')
|
223
|
-
self.force_recompression = attributes[:'forceRecompression']
|
224
|
-
end
|
225
|
-
|
226
|
-
if attributes.has_key?(:'reduceColorComplexity')
|
227
|
-
self.reduce_color_complexity = attributes[:'reduceColorComplexity']
|
228
|
-
end
|
229
|
-
|
230
|
-
if attributes.has_key?(:'mergeEmbeddedFonts')
|
231
|
-
self.merge_embedded_fonts = attributes[:'mergeEmbeddedFonts']
|
232
|
-
end
|
233
|
-
|
234
|
-
if attributes.has_key?(:'bitonalCompressions')
|
235
|
-
if (value = attributes[:'bitonalCompressions']).is_a?(Array)
|
236
|
-
self.bitonal_compressions = value
|
237
|
-
end
|
238
|
-
end
|
239
|
-
|
240
|
-
if attributes.has_key?(:'bitonalResolutionDPI')
|
241
|
-
self.bitonal_resolution_dpi = attributes[:'bitonalResolutionDPI']
|
242
|
-
end
|
243
|
-
|
244
|
-
if attributes.has_key?(:'bitonalThresholdDPI')
|
245
|
-
self.bitonal_threshold_dpi = attributes[:'bitonalThresholdDPI']
|
246
|
-
end
|
247
|
-
|
248
|
-
if attributes.has_key?(:'clipImages')
|
249
|
-
self.clip_images = attributes[:'clipImages']
|
250
|
-
end
|
251
|
-
|
252
|
-
if attributes.has_key?(:'continuousCompressions')
|
253
|
-
if (value = attributes[:'continuousCompressions']).is_a?(Array)
|
254
|
-
self.continuous_compressions = value
|
255
|
-
end
|
256
|
-
end
|
257
|
-
|
258
|
-
if attributes.has_key?(:'linearize')
|
259
|
-
self.linearize = attributes[:'linearize']
|
260
|
-
end
|
261
|
-
|
262
|
-
if attributes.has_key?(:'imageQuality')
|
263
|
-
self.image_quality = attributes[:'imageQuality']
|
264
|
-
end
|
265
|
-
|
266
|
-
if attributes.has_key?(:'indexedCompressions')
|
267
|
-
if (value = attributes[:'indexedCompressions']).is_a?(Array)
|
268
|
-
self.indexed_compressions = value
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
if attributes.has_key?(:'ditheringMode')
|
273
|
-
self.dithering_mode = attributes[:'ditheringMode']
|
274
|
-
end
|
275
|
-
|
276
|
-
if attributes.has_key?(:'colorResolutionDPI')
|
277
|
-
self.color_resolution_dpi = attributes[:'colorResolutionDPI']
|
278
|
-
end
|
279
|
-
|
280
|
-
if attributes.has_key?(:'colorThresholdDPI')
|
281
|
-
self.color_threshold_dpi = attributes[:'colorThresholdDPI']
|
282
|
-
end
|
283
|
-
|
284
|
-
if attributes.has_key?(:'monochromeResolutionDPI')
|
285
|
-
self.monochrome_resolution_dpi = attributes[:'monochromeResolutionDPI']
|
286
|
-
end
|
287
|
-
|
288
|
-
if attributes.has_key?(:'monochromeThresholdDPI')
|
289
|
-
self.monochrome_threshold_dpi = attributes[:'monochromeThresholdDPI']
|
290
|
-
end
|
291
|
-
|
292
|
-
if attributes.has_key?(:'resolutionDPI')
|
293
|
-
self.resolution_dpi = attributes[:'resolutionDPI']
|
294
|
-
end
|
295
|
-
|
296
|
-
if attributes.has_key?(:'thresholdDPI')
|
297
|
-
self.threshold_dpi = attributes[:'thresholdDPI']
|
298
|
-
end
|
299
|
-
|
300
|
-
if attributes.has_key?(:'strip')
|
301
|
-
if (value = attributes[:'strip']).is_a?(Array)
|
302
|
-
self.strip = value
|
303
|
-
end
|
304
|
-
end
|
305
|
-
|
306
|
-
if attributes.has_key?(:'infoEntries')
|
307
|
-
if (value = attributes[:'infoEntries']).is_a?(Array)
|
308
|
-
self.info_entries = value
|
309
|
-
end
|
310
|
-
end
|
311
|
-
|
312
|
-
if attributes.has_key?(:'flattenSignatureFields')
|
313
|
-
self.flatten_signature_fields = attributes[:'flattenSignatureFields']
|
314
|
-
end
|
315
|
-
|
316
|
-
if attributes.has_key?(:'customProperties')
|
317
|
-
if (value = attributes[:'customProperties']).is_a?(Array)
|
318
|
-
self.custom_properties = value
|
319
|
-
end
|
320
|
-
end
|
321
|
-
|
322
|
-
end
|
323
|
-
|
324
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
325
|
-
# @return Array for valid properties with the reasons
|
326
|
-
def list_invalid_properties
|
327
|
-
invalid_properties = Array.new
|
328
|
-
return invalid_properties
|
329
|
-
end
|
330
|
-
|
331
|
-
# Check to see if the all the properties in the model are valid
|
332
|
-
# @return true if the model is valid
|
333
|
-
def valid?
|
334
|
-
profile_validator = EnumAttributeValidator.new('String', ["default", "web", "print", "max"])
|
335
|
-
return false unless profile_validator.valid?(@profile)
|
336
|
-
dithering_mode_validator = EnumAttributeValidator.new('String', ["none", "floydSteinberg", "halftone", "pattern", "g3Optimized", "g4Optimized", "atkinson"])
|
337
|
-
return false unless dithering_mode_validator.valid?(@dithering_mode)
|
338
|
-
return true
|
339
|
-
end
|
340
|
-
|
341
|
-
# Custom attribute writer method checking allowed values (enum).
|
342
|
-
# @param [Object] profile Object to be assigned
|
343
|
-
def profile=(profile)
|
344
|
-
validator = EnumAttributeValidator.new('String', ["default", "web", "print", "max"])
|
345
|
-
unless validator.valid?(profile)
|
346
|
-
fail ArgumentError, "invalid value for 'profile', must be one of #{validator.allowable_values}."
|
347
|
-
end
|
348
|
-
@profile = profile
|
349
|
-
end
|
350
|
-
|
351
|
-
# Custom attribute writer method checking allowed values (enum).
|
352
|
-
# @param [Object] dithering_mode Object to be assigned
|
353
|
-
def dithering_mode=(dithering_mode)
|
354
|
-
validator = EnumAttributeValidator.new('String', ["none", "floydSteinberg", "halftone", "pattern", "g3Optimized", "g4Optimized", "atkinson"])
|
355
|
-
unless validator.valid?(dithering_mode)
|
356
|
-
fail ArgumentError, "invalid value for 'dithering_mode', must be one of #{validator.allowable_values}."
|
357
|
-
end
|
358
|
-
@dithering_mode = dithering_mode
|
359
|
-
end
|
360
|
-
|
361
|
-
# Checks equality by comparing each attribute.
|
362
|
-
# @param [Object] Object to be compared
|
363
|
-
def ==(o)
|
364
|
-
return true if self.equal?(o)
|
365
|
-
self.class == o.class &&
|
366
|
-
profile == o.profile &&
|
367
|
-
use_profile == o.use_profile &&
|
368
|
-
remove_redundant_objects == o.remove_redundant_objects &&
|
369
|
-
subset_fonts == o.subset_fonts &&
|
370
|
-
optimize_resources == o.optimize_resources &&
|
371
|
-
force_compression_types == o.force_compression_types &&
|
372
|
-
force_recompression == o.force_recompression &&
|
373
|
-
reduce_color_complexity == o.reduce_color_complexity &&
|
374
|
-
merge_embedded_fonts == o.merge_embedded_fonts &&
|
375
|
-
bitonal_compressions == o.bitonal_compressions &&
|
376
|
-
bitonal_resolution_dpi == o.bitonal_resolution_dpi &&
|
377
|
-
bitonal_threshold_dpi == o.bitonal_threshold_dpi &&
|
378
|
-
clip_images == o.clip_images &&
|
379
|
-
continuous_compressions == o.continuous_compressions &&
|
380
|
-
linearize == o.linearize &&
|
381
|
-
image_quality == o.image_quality &&
|
382
|
-
indexed_compressions == o.indexed_compressions &&
|
383
|
-
dithering_mode == o.dithering_mode &&
|
384
|
-
color_resolution_dpi == o.color_resolution_dpi &&
|
385
|
-
color_threshold_dpi == o.color_threshold_dpi &&
|
386
|
-
monochrome_resolution_dpi == o.monochrome_resolution_dpi &&
|
387
|
-
monochrome_threshold_dpi == o.monochrome_threshold_dpi &&
|
388
|
-
resolution_dpi == o.resolution_dpi &&
|
389
|
-
threshold_dpi == o.threshold_dpi &&
|
390
|
-
strip == o.strip &&
|
391
|
-
info_entries == o.info_entries &&
|
392
|
-
flatten_signature_fields == o.flatten_signature_fields &&
|
393
|
-
custom_properties == o.custom_properties
|
394
|
-
end
|
395
|
-
|
396
|
-
# @see the `==` method
|
397
|
-
# @param [Object] Object to be compared
|
398
|
-
def eql?(o)
|
399
|
-
self == o
|
400
|
-
end
|
401
|
-
|
402
|
-
# Calculates hash code according to all attributes.
|
403
|
-
# @return [Fixnum] Hash code
|
404
|
-
def hash
|
405
|
-
[profile, use_profile, remove_redundant_objects, subset_fonts, optimize_resources, force_compression_types, force_recompression, reduce_color_complexity, merge_embedded_fonts, bitonal_compressions, bitonal_resolution_dpi, bitonal_threshold_dpi, clip_images, continuous_compressions, linearize, image_quality, indexed_compressions, dithering_mode, color_resolution_dpi, color_threshold_dpi, monochrome_resolution_dpi, monochrome_threshold_dpi, resolution_dpi, threshold_dpi, strip, info_entries, flatten_signature_fields, custom_properties].hash
|
406
|
-
end
|
407
|
-
|
408
|
-
# Builds the object from hash
|
409
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
410
|
-
# @return [Object] Returns the model itself
|
411
|
-
def build_from_hash(attributes)
|
412
|
-
return nil unless attributes.is_a?(Hash)
|
413
|
-
self.class.swagger_types.each_pair do |key, type|
|
414
|
-
if type =~ /\AArray<(.*)>/i
|
415
|
-
# check to ensure the input is an array given that the the attribute
|
416
|
-
# is documented as an array but the input is not
|
417
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
418
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
419
|
-
end
|
420
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
421
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
422
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
423
|
-
end
|
424
|
-
|
425
|
-
self
|
426
|
-
end
|
427
|
-
|
428
|
-
# Deserializes the data based on type
|
429
|
-
# @param string type Data type
|
430
|
-
# @param string value Value to be deserialized
|
431
|
-
# @return [Object] Deserialized data
|
432
|
-
def _deserialize(type, value)
|
433
|
-
case type.to_sym
|
434
|
-
when :DateTime
|
435
|
-
DateTime.parse(value)
|
436
|
-
when :Date
|
437
|
-
Date.parse(value)
|
438
|
-
when :String
|
439
|
-
value.to_s
|
440
|
-
when :Integer
|
441
|
-
value.to_i
|
442
|
-
when :Float
|
443
|
-
value.to_f
|
444
|
-
when :BOOLEAN
|
445
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
446
|
-
true
|
447
|
-
else
|
448
|
-
false
|
449
|
-
end
|
450
|
-
when :Object
|
451
|
-
# generic object (usually a Hash), return directly
|
452
|
-
value
|
453
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
454
|
-
inner_type = Regexp.last_match[:inner_type]
|
455
|
-
value.map { |v| _deserialize(inner_type, v) }
|
456
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
457
|
-
k_type = Regexp.last_match[:k_type]
|
458
|
-
v_type = Regexp.last_match[:v_type]
|
459
|
-
{}.tap do |hash|
|
460
|
-
value.each do |k, v|
|
461
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
462
|
-
end
|
463
|
-
end
|
464
|
-
else # model
|
465
|
-
temp_model = Pdf4me.const_get(type).new
|
466
|
-
temp_model.build_from_hash(value)
|
467
|
-
end
|
468
|
-
end
|
469
|
-
|
470
|
-
# Returns the string representation of the object
|
471
|
-
# @return [String] String presentation of the object
|
472
|
-
def to_s
|
473
|
-
to_hash.to_s
|
474
|
-
end
|
475
|
-
|
476
|
-
# to_body is an alias to to_hash (backward compatibility)
|
477
|
-
# @return [Hash] Returns the object in the form of hash
|
478
|
-
def to_body
|
479
|
-
to_hash
|
480
|
-
end
|
481
|
-
|
482
|
-
# Returns the object in the form of hash
|
483
|
-
# @return [Hash] Returns the object in the form of hash
|
484
|
-
def to_hash
|
485
|
-
hash = {}
|
486
|
-
self.class.attribute_map.each_pair do |attr, param|
|
487
|
-
value = self.send(attr)
|
488
|
-
next if value.nil?
|
489
|
-
hash[param] = _to_hash(value)
|
490
|
-
end
|
491
|
-
hash
|
492
|
-
end
|
493
|
-
|
494
|
-
# Outputs non-array value in the form of hash
|
495
|
-
# For object, use to_hash. Otherwise, just return the value
|
496
|
-
# @param [Object] value Any valid value
|
497
|
-
# @return [Hash] Returns the value in the form of hash
|
498
|
-
def _to_hash(value)
|
499
|
-
if value.is_a?(Array)
|
500
|
-
value.compact.map{ |v| _to_hash(v) }
|
501
|
-
elsif value.is_a?(Hash)
|
502
|
-
{}.tap do |hash|
|
503
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
504
|
-
end
|
505
|
-
elsif value.respond_to? :to_hash
|
506
|
-
value.to_hash
|
507
|
-
else
|
508
|
-
value
|
509
|
-
end
|
510
|
-
end
|
511
|
-
|
512
77
|
end
|
513
|
-
|
514
78
|
end
|