aspose_pdf_cloud 25.3.0 → 25.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aspose_pdf_cloud/api/pdf_api.rb +280 -0
- data/lib/aspose_pdf_cloud/models/image_stamp_page_specified.rb +376 -0
- data/lib/aspose_pdf_cloud/models/text_stamp_page_specified.rb +376 -0
- data/lib/aspose_pdf_cloud/version.rb +1 -1
- data/lib/aspose_pdf_cloud.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bac2a27fab3145899b1d07ef7de5c8c94ef72bd0be5000f7e0746f359f9a5f92
|
4
|
+
data.tar.gz: c51fc513a7f94c320ee180a0e5ed598409ef155b29ff447de8f6575c6e509027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05b350fed4dc41136093a20cee3d25ac3a059242254460d06dcfc3a68a7e819dd5e5d22c38c70460278912acf9bc40f66d627c9564c3c32a370a2f2854ad76b
|
7
|
+
data.tar.gz: 27be189f6d3ac0385ddc1fe87195e2c940504fddec0f2d2cd9219bcacfbafbd1d280349cdd73ce249070979b8c613cb60a2fc1c4474e4fbe3095217343bc53e9
|
@@ -7597,6 +7597,12 @@ module AsposePdfCloud
|
|
7597
7597
|
#
|
7598
7598
|
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
|
7599
7599
|
# @param [Hash] opts the optional parameters
|
7600
|
+
# @option opts [Float] :height Page height
|
7601
|
+
# @option opts [Float] :width Page width
|
7602
|
+
# @option opts [Float] :margin_left Page margin left
|
7603
|
+
# @option opts [Float] :margin_bottom Page margin bottom
|
7604
|
+
# @option opts [Float] :margin_right Page margin right
|
7605
|
+
# @option opts [Float] :margin_top Page margin top
|
7600
7606
|
# @option opts [String] :storage The document storage.
|
7601
7607
|
# @return [File]
|
7602
7608
|
def get_mht_in_storage_to_pdf(src_path, opts = {})
|
@@ -7616,6 +7622,12 @@ module AsposePdfCloud
|
|
7616
7622
|
#
|
7617
7623
|
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
|
7618
7624
|
# @param [Hash] opts the optional parameters
|
7625
|
+
# @option opts [Float] :height Page height
|
7626
|
+
# @option opts [Float] :width Page width
|
7627
|
+
# @option opts [Float] :margin_left Page margin left
|
7628
|
+
# @option opts [Float] :margin_bottom Page margin bottom
|
7629
|
+
# @option opts [Float] :margin_right Page margin right
|
7630
|
+
# @option opts [Float] :margin_top Page margin top
|
7619
7631
|
# @option opts [String] :storage The document storage.
|
7620
7632
|
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
7621
7633
|
def get_mht_in_storage_to_pdf_with_http_info(src_path, opts = {})
|
@@ -7632,6 +7644,12 @@ module AsposePdfCloud
|
|
7632
7644
|
# query parameters
|
7633
7645
|
query_params = {}
|
7634
7646
|
query_params[:'srcPath'] = src_path
|
7647
|
+
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
7648
|
+
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
7649
|
+
query_params[:'marginLeft'] = opts[:'margin_left'] if !opts[:'margin_left'].nil?
|
7650
|
+
query_params[:'marginBottom'] = opts[:'margin_bottom'] if !opts[:'margin_bottom'].nil?
|
7651
|
+
query_params[:'marginRight'] = opts[:'margin_right'] if !opts[:'margin_right'].nil?
|
7652
|
+
query_params[:'marginTop'] = opts[:'margin_top'] if !opts[:'margin_top'].nil?
|
7635
7653
|
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
7636
7654
|
|
7637
7655
|
# header parameters
|
@@ -15597,6 +15615,90 @@ module AsposePdfCloud
|
|
15597
15615
|
return data, status_code, headers
|
15598
15616
|
end
|
15599
15617
|
|
15618
|
+
# Compare two PDF documents.
|
15619
|
+
#
|
15620
|
+
# @param path1 Path to first PDF document.
|
15621
|
+
# @param path2 Path to second PDF document.
|
15622
|
+
# @param out_path Full filename of the resulting document.
|
15623
|
+
# @param [Hash] opts the optional parameters
|
15624
|
+
# @option opts [String] :storage The documents storage.
|
15625
|
+
# @return [AsposeResponse]
|
15626
|
+
def post_compare_pdf(path1, path2, out_path, opts = {})
|
15627
|
+
@api_client.request_token_if_needed
|
15628
|
+
data, _status_code, _headers = post_compare_pdf_with_http_info(path1, path2, out_path, opts)
|
15629
|
+
rescue ApiError => error
|
15630
|
+
if error.code == 401
|
15631
|
+
@api_client.request_token_if_needed
|
15632
|
+
data, _status_code, _headers = post_compare_pdf_with_http_info(path1, path2, out_path, opts)
|
15633
|
+
else
|
15634
|
+
raise
|
15635
|
+
end
|
15636
|
+
return data
|
15637
|
+
end
|
15638
|
+
|
15639
|
+
# Compare two PDF documents.
|
15640
|
+
#
|
15641
|
+
# @param path1 Path to first PDF document.
|
15642
|
+
# @param path2 Path to second PDF document.
|
15643
|
+
# @param out_path Full filename of the resulting document.
|
15644
|
+
# @param [Hash] opts the optional parameters
|
15645
|
+
# @option opts [String] :storage The documents storage.
|
15646
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
15647
|
+
def post_compare_pdf_with_http_info(path1, path2, out_path, opts = {})
|
15648
|
+
if @api_client.config.debugging
|
15649
|
+
@api_client.config.logger.debug "Calling API: PdfApi.post_compare_pdf ..."
|
15650
|
+
end
|
15651
|
+
# verify the required parameter 'path1' is set
|
15652
|
+
if @api_client.config.client_side_validation && path1.nil?
|
15653
|
+
fail ArgumentError, "Missing the required parameter 'path1' when calling PdfApi.post_compare_pdf"
|
15654
|
+
end
|
15655
|
+
# verify the required parameter 'path2' is set
|
15656
|
+
if @api_client.config.client_side_validation && path2.nil?
|
15657
|
+
fail ArgumentError, "Missing the required parameter 'path2' when calling PdfApi.post_compare_pdf"
|
15658
|
+
end
|
15659
|
+
# verify the required parameter 'out_path' is set
|
15660
|
+
if @api_client.config.client_side_validation && out_path.nil?
|
15661
|
+
fail ArgumentError, "Missing the required parameter 'out_path' when calling PdfApi.post_compare_pdf"
|
15662
|
+
end
|
15663
|
+
# resource path
|
15664
|
+
local_var_path = "/pdf/compare"
|
15665
|
+
|
15666
|
+
# query parameters
|
15667
|
+
query_params = {}
|
15668
|
+
query_params[:'path1'] = path1
|
15669
|
+
query_params[:'path2'] = path2
|
15670
|
+
query_params[:'outPath'] = out_path
|
15671
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
15672
|
+
|
15673
|
+
# header parameters
|
15674
|
+
header_params = {}
|
15675
|
+
# HTTP header 'Accept' (if needed)
|
15676
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
15677
|
+
# HTTP header 'Content-Type'
|
15678
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
15679
|
+
|
15680
|
+
# form parameters
|
15681
|
+
form_params = {}
|
15682
|
+
# Fix header in file
|
15683
|
+
post_body = nil
|
15684
|
+
|
15685
|
+
# http body (model)
|
15686
|
+
# Fix header in file
|
15687
|
+
# post_body = nil
|
15688
|
+
auth_names = ['JWT']
|
15689
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
15690
|
+
:header_params => header_params,
|
15691
|
+
:query_params => query_params,
|
15692
|
+
:form_params => form_params,
|
15693
|
+
:body => post_body,
|
15694
|
+
:auth_names => auth_names,
|
15695
|
+
:return_type => 'AsposeResponse')
|
15696
|
+
if @api_client.config.debugging
|
15697
|
+
@api_client.config.logger.debug "API called: PdfApi#post_compare_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
15698
|
+
end
|
15699
|
+
return data, status_code, headers
|
15700
|
+
end
|
15701
|
+
|
15600
15702
|
# Create empty document.
|
15601
15703
|
#
|
15602
15704
|
# @param name The new document name.
|
@@ -16083,6 +16185,86 @@ module AsposePdfCloud
|
|
16083
16185
|
return data, status_code, headers
|
16084
16186
|
end
|
16085
16187
|
|
16188
|
+
# Add document image stamps to specified pages.
|
16189
|
+
#
|
16190
|
+
# @param name The document name.
|
16191
|
+
# @param stamps The array of stamps.
|
16192
|
+
# @param [Hash] opts the optional parameters
|
16193
|
+
# @option opts [String] :storage The document storage.
|
16194
|
+
# @option opts [String] :folder The document folder.
|
16195
|
+
# @option opts [String] :password Base64 encoded password.
|
16196
|
+
# @return [AsposeResponse]
|
16197
|
+
def post_document_image_stamps_page_specified(name, stamps, opts = {})
|
16198
|
+
@api_client.request_token_if_needed
|
16199
|
+
data, _status_code, _headers = post_document_image_stamps_page_specified_with_http_info(name, stamps, opts)
|
16200
|
+
rescue ApiError => error
|
16201
|
+
if error.code == 401
|
16202
|
+
@api_client.request_token_if_needed
|
16203
|
+
data, _status_code, _headers = post_document_image_stamps_page_specified_with_http_info(name, stamps, opts)
|
16204
|
+
else
|
16205
|
+
raise
|
16206
|
+
end
|
16207
|
+
return data
|
16208
|
+
end
|
16209
|
+
|
16210
|
+
# Add document image stamps to specified pages.
|
16211
|
+
#
|
16212
|
+
# @param name The document name.
|
16213
|
+
# @param stamps The array of stamps.
|
16214
|
+
# @param [Hash] opts the optional parameters
|
16215
|
+
# @option opts [String] :storage The document storage.
|
16216
|
+
# @option opts [String] :folder The document folder.
|
16217
|
+
# @option opts [String] :password Base64 encoded password.
|
16218
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
16219
|
+
def post_document_image_stamps_page_specified_with_http_info(name, stamps, opts = {})
|
16220
|
+
if @api_client.config.debugging
|
16221
|
+
@api_client.config.logger.debug "Calling API: PdfApi.post_document_image_stamps_page_specified ..."
|
16222
|
+
end
|
16223
|
+
# verify the required parameter 'name' is set
|
16224
|
+
if @api_client.config.client_side_validation && name.nil?
|
16225
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_image_stamps_page_specified"
|
16226
|
+
end
|
16227
|
+
# verify the required parameter 'stamps' is set
|
16228
|
+
if @api_client.config.client_side_validation && stamps.nil?
|
16229
|
+
fail ArgumentError, "Missing the required parameter 'stamps' when calling PdfApi.post_document_image_stamps_page_specified"
|
16230
|
+
end
|
16231
|
+
# resource path
|
16232
|
+
local_var_path = "/pdf/{name}/stamps/image/pagespecified".sub('{' + 'name' + '}', name.to_s)
|
16233
|
+
|
16234
|
+
# query parameters
|
16235
|
+
query_params = {}
|
16236
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
16237
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
16238
|
+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
|
16239
|
+
|
16240
|
+
# header parameters
|
16241
|
+
header_params = {}
|
16242
|
+
# HTTP header 'Accept' (if needed)
|
16243
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
16244
|
+
# HTTP header 'Content-Type'
|
16245
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
16246
|
+
|
16247
|
+
# form parameters
|
16248
|
+
form_params = {}
|
16249
|
+
# Fix header in file
|
16250
|
+
post_body = nil
|
16251
|
+
|
16252
|
+
# http body (model)
|
16253
|
+
post_body = @api_client.object_to_http_body(stamps)
|
16254
|
+
auth_names = ['JWT']
|
16255
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
16256
|
+
:header_params => header_params,
|
16257
|
+
:query_params => query_params,
|
16258
|
+
:form_params => form_params,
|
16259
|
+
:body => post_body,
|
16260
|
+
:auth_names => auth_names,
|
16261
|
+
:return_type => 'AsposeResponse')
|
16262
|
+
if @api_client.config.debugging
|
16263
|
+
@api_client.config.logger.debug "API called: PdfApi#post_document_image_stamps_page_specified\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
16264
|
+
end
|
16265
|
+
return data, status_code, headers
|
16266
|
+
end
|
16267
|
+
|
16086
16268
|
# Add document page number stamps.
|
16087
16269
|
#
|
16088
16270
|
# @param name The document name.
|
@@ -16492,6 +16674,86 @@ module AsposePdfCloud
|
|
16492
16674
|
return data, status_code, headers
|
16493
16675
|
end
|
16494
16676
|
|
16677
|
+
# Add document text stamps to specified pages.
|
16678
|
+
#
|
16679
|
+
# @param name The document name.
|
16680
|
+
# @param stamps The array of stamps.
|
16681
|
+
# @param [Hash] opts the optional parameters
|
16682
|
+
# @option opts [String] :storage The document storage.
|
16683
|
+
# @option opts [String] :folder The document folder.
|
16684
|
+
# @option opts [String] :password Base64 encoded password.
|
16685
|
+
# @return [AsposeResponse]
|
16686
|
+
def post_document_text_stamps_page_specified(name, stamps, opts = {})
|
16687
|
+
@api_client.request_token_if_needed
|
16688
|
+
data, _status_code, _headers = post_document_text_stamps_page_specified_with_http_info(name, stamps, opts)
|
16689
|
+
rescue ApiError => error
|
16690
|
+
if error.code == 401
|
16691
|
+
@api_client.request_token_if_needed
|
16692
|
+
data, _status_code, _headers = post_document_text_stamps_page_specified_with_http_info(name, stamps, opts)
|
16693
|
+
else
|
16694
|
+
raise
|
16695
|
+
end
|
16696
|
+
return data
|
16697
|
+
end
|
16698
|
+
|
16699
|
+
# Add document text stamps to specified pages.
|
16700
|
+
#
|
16701
|
+
# @param name The document name.
|
16702
|
+
# @param stamps The array of stamps.
|
16703
|
+
# @param [Hash] opts the optional parameters
|
16704
|
+
# @option opts [String] :storage The document storage.
|
16705
|
+
# @option opts [String] :folder The document folder.
|
16706
|
+
# @option opts [String] :password Base64 encoded password.
|
16707
|
+
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
16708
|
+
def post_document_text_stamps_page_specified_with_http_info(name, stamps, opts = {})
|
16709
|
+
if @api_client.config.debugging
|
16710
|
+
@api_client.config.logger.debug "Calling API: PdfApi.post_document_text_stamps_page_specified ..."
|
16711
|
+
end
|
16712
|
+
# verify the required parameter 'name' is set
|
16713
|
+
if @api_client.config.client_side_validation && name.nil?
|
16714
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling PdfApi.post_document_text_stamps_page_specified"
|
16715
|
+
end
|
16716
|
+
# verify the required parameter 'stamps' is set
|
16717
|
+
if @api_client.config.client_side_validation && stamps.nil?
|
16718
|
+
fail ArgumentError, "Missing the required parameter 'stamps' when calling PdfApi.post_document_text_stamps_page_specified"
|
16719
|
+
end
|
16720
|
+
# resource path
|
16721
|
+
local_var_path = "/pdf/{name}/stamps/text/pagespecified".sub('{' + 'name' + '}', name.to_s)
|
16722
|
+
|
16723
|
+
# query parameters
|
16724
|
+
query_params = {}
|
16725
|
+
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
16726
|
+
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
16727
|
+
query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
|
16728
|
+
|
16729
|
+
# header parameters
|
16730
|
+
header_params = {}
|
16731
|
+
# HTTP header 'Accept' (if needed)
|
16732
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
16733
|
+
# HTTP header 'Content-Type'
|
16734
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
16735
|
+
|
16736
|
+
# form parameters
|
16737
|
+
form_params = {}
|
16738
|
+
# Fix header in file
|
16739
|
+
post_body = nil
|
16740
|
+
|
16741
|
+
# http body (model)
|
16742
|
+
post_body = @api_client.object_to_http_body(stamps)
|
16743
|
+
auth_names = ['JWT']
|
16744
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
16745
|
+
:header_params => header_params,
|
16746
|
+
:query_params => query_params,
|
16747
|
+
:form_params => form_params,
|
16748
|
+
:body => post_body,
|
16749
|
+
:auth_names => auth_names,
|
16750
|
+
:return_type => 'AsposeResponse')
|
16751
|
+
if @api_client.config.debugging
|
16752
|
+
@api_client.config.logger.debug "API called: PdfApi#post_document_text_stamps_page_specified\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
16753
|
+
end
|
16754
|
+
return data, status_code, headers
|
16755
|
+
end
|
16756
|
+
|
16495
16757
|
# Encrypt document in storage.
|
16496
16758
|
#
|
16497
16759
|
# @param name Document name.
|
@@ -23992,6 +24254,12 @@ module AsposePdfCloud
|
|
23992
24254
|
# @param name The document name.
|
23993
24255
|
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
|
23994
24256
|
# @param [Hash] opts the optional parameters
|
24257
|
+
# @option opts [Float] :height Page height
|
24258
|
+
# @option opts [Float] :width Page width
|
24259
|
+
# @option opts [Float] :margin_left Page margin left
|
24260
|
+
# @option opts [Float] :margin_bottom Page margin bottom
|
24261
|
+
# @option opts [Float] :margin_right Page margin right
|
24262
|
+
# @option opts [Float] :margin_top Page margin top
|
23995
24263
|
# @option opts [String] :dst_folder The destination document folder.
|
23996
24264
|
# @option opts [String] :storage The document storage.
|
23997
24265
|
# @return [AsposeResponse]
|
@@ -24013,6 +24281,12 @@ module AsposePdfCloud
|
|
24013
24281
|
# @param name The document name.
|
24014
24282
|
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
|
24015
24283
|
# @param [Hash] opts the optional parameters
|
24284
|
+
# @option opts [Float] :height Page height
|
24285
|
+
# @option opts [Float] :width Page width
|
24286
|
+
# @option opts [Float] :margin_left Page margin left
|
24287
|
+
# @option opts [Float] :margin_bottom Page margin bottom
|
24288
|
+
# @option opts [Float] :margin_right Page margin right
|
24289
|
+
# @option opts [Float] :margin_top Page margin top
|
24016
24290
|
# @option opts [String] :dst_folder The destination document folder.
|
24017
24291
|
# @option opts [String] :storage The document storage.
|
24018
24292
|
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
|
@@ -24034,6 +24308,12 @@ module AsposePdfCloud
|
|
24034
24308
|
# query parameters
|
24035
24309
|
query_params = {}
|
24036
24310
|
query_params[:'srcPath'] = src_path
|
24311
|
+
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
24312
|
+
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
24313
|
+
query_params[:'marginLeft'] = opts[:'margin_left'] if !opts[:'margin_left'].nil?
|
24314
|
+
query_params[:'marginBottom'] = opts[:'margin_bottom'] if !opts[:'margin_bottom'].nil?
|
24315
|
+
query_params[:'marginRight'] = opts[:'margin_right'] if !opts[:'margin_right'].nil?
|
24316
|
+
query_params[:'marginTop'] = opts[:'margin_top'] if !opts[:'margin_top'].nil?
|
24037
24317
|
query_params[:'dstFolder'] = opts[:'dst_folder'] if !opts[:'dst_folder'].nil?
|
24038
24318
|
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
24039
24319
|
|
@@ -0,0 +1,376 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2025 Aspose.PDF Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'date'
|
23
|
+
require 'time'
|
24
|
+
|
25
|
+
module AsposePdfCloud
|
26
|
+
# Represents Pdf stamps.
|
27
|
+
class ImageStampPageSpecified
|
28
|
+
# Link to the document.
|
29
|
+
attr_accessor :links
|
30
|
+
|
31
|
+
# Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top.
|
32
|
+
attr_accessor :background
|
33
|
+
|
34
|
+
# Gets or sets Horizontal alignment of stamp on the page.
|
35
|
+
attr_accessor :horizontal_alignment
|
36
|
+
|
37
|
+
# Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0.
|
38
|
+
attr_accessor :opacity
|
39
|
+
|
40
|
+
# Sets or gets the rotation of stamp content according Rotation values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None.
|
41
|
+
attr_accessor :rotate
|
42
|
+
|
43
|
+
# Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle.
|
44
|
+
attr_accessor :rotate_angle
|
45
|
+
|
46
|
+
# Horizontal stamp coordinate, starting from the left.
|
47
|
+
attr_accessor :x_indent
|
48
|
+
|
49
|
+
# Vertical stamp coordinate, starting from the bottom.
|
50
|
+
attr_accessor :y_indent
|
51
|
+
|
52
|
+
# Zooming factor of the stamp. Allows to scale stamp.
|
53
|
+
attr_accessor :zoom
|
54
|
+
|
55
|
+
# Gets or sets the file name.
|
56
|
+
attr_accessor :file_name
|
57
|
+
|
58
|
+
# Gets or sets image width. Setting this property allos to scal image horizontally.
|
59
|
+
attr_accessor :width
|
60
|
+
|
61
|
+
# Gets or sets image height. Setting this image allows to scale image vertically.
|
62
|
+
attr_accessor :height
|
63
|
+
|
64
|
+
# Gets or sets vertical alignment of stamp on page.
|
65
|
+
attr_accessor :vertical_alignment
|
66
|
+
|
67
|
+
# Gets or sets bottom margin of stamp.
|
68
|
+
attr_accessor :bottom_margin
|
69
|
+
|
70
|
+
# Gets or sets left margin of stamp.
|
71
|
+
attr_accessor :left_margin
|
72
|
+
|
73
|
+
# Gets or sets top margin of stamp.
|
74
|
+
attr_accessor :top_margin
|
75
|
+
|
76
|
+
# Gets or sets right margin of stamp.
|
77
|
+
attr_accessor :right_margin
|
78
|
+
|
79
|
+
# Page number.
|
80
|
+
attr_accessor :page_number
|
81
|
+
|
82
|
+
|
83
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
84
|
+
def self.attribute_map
|
85
|
+
{
|
86
|
+
:'links' => :'Links',
|
87
|
+
:'background' => :'Background',
|
88
|
+
:'horizontal_alignment' => :'HorizontalAlignment',
|
89
|
+
:'opacity' => :'Opacity',
|
90
|
+
:'rotate' => :'Rotate',
|
91
|
+
:'rotate_angle' => :'RotateAngle',
|
92
|
+
:'x_indent' => :'XIndent',
|
93
|
+
:'y_indent' => :'YIndent',
|
94
|
+
:'zoom' => :'Zoom',
|
95
|
+
:'file_name' => :'FileName',
|
96
|
+
:'width' => :'Width',
|
97
|
+
:'height' => :'Height',
|
98
|
+
:'vertical_alignment' => :'VerticalAlignment',
|
99
|
+
:'bottom_margin' => :'BottomMargin',
|
100
|
+
:'left_margin' => :'LeftMargin',
|
101
|
+
:'top_margin' => :'TopMargin',
|
102
|
+
:'right_margin' => :'RightMargin',
|
103
|
+
:'page_number' => :'PageNumber'
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
107
|
+
# Attribute type mapping.
|
108
|
+
def self.swagger_types
|
109
|
+
{
|
110
|
+
:'links' => :'Array<Link>',
|
111
|
+
:'background' => :'BOOLEAN',
|
112
|
+
:'horizontal_alignment' => :'HorizontalAlignment',
|
113
|
+
:'opacity' => :'Float',
|
114
|
+
:'rotate' => :'Rotation',
|
115
|
+
:'rotate_angle' => :'Float',
|
116
|
+
:'x_indent' => :'Float',
|
117
|
+
:'y_indent' => :'Float',
|
118
|
+
:'zoom' => :'Float',
|
119
|
+
:'file_name' => :'String',
|
120
|
+
:'width' => :'Float',
|
121
|
+
:'height' => :'Float',
|
122
|
+
:'vertical_alignment' => :'VerticalAlignment',
|
123
|
+
:'bottom_margin' => :'Float',
|
124
|
+
:'left_margin' => :'Float',
|
125
|
+
:'top_margin' => :'Float',
|
126
|
+
:'right_margin' => :'Float',
|
127
|
+
:'page_number' => :'Integer'
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
# Initializes the object
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
def initialize(attributes = {})
|
134
|
+
return unless attributes.is_a?(Hash)
|
135
|
+
|
136
|
+
# convert string to symbol for hash key
|
137
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
138
|
+
|
139
|
+
if attributes.has_key?(:'Links')
|
140
|
+
if (value = attributes[:'Links']).is_a?(Array)
|
141
|
+
self.links = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'Background')
|
146
|
+
self.background = attributes[:'Background']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'HorizontalAlignment')
|
150
|
+
self.horizontal_alignment = attributes[:'HorizontalAlignment']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'Opacity')
|
154
|
+
self.opacity = attributes[:'Opacity']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'Rotate')
|
158
|
+
self.rotate = attributes[:'Rotate']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'RotateAngle')
|
162
|
+
self.rotate_angle = attributes[:'RotateAngle']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'XIndent')
|
166
|
+
self.x_indent = attributes[:'XIndent']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'YIndent')
|
170
|
+
self.y_indent = attributes[:'YIndent']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.has_key?(:'Zoom')
|
174
|
+
self.zoom = attributes[:'Zoom']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.has_key?(:'FileName')
|
178
|
+
self.file_name = attributes[:'FileName']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.has_key?(:'Width')
|
182
|
+
self.width = attributes[:'Width']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'Height')
|
186
|
+
self.height = attributes[:'Height']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'VerticalAlignment')
|
190
|
+
self.vertical_alignment = attributes[:'VerticalAlignment']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'BottomMargin')
|
194
|
+
self.bottom_margin = attributes[:'BottomMargin']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.has_key?(:'LeftMargin')
|
198
|
+
self.left_margin = attributes[:'LeftMargin']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.has_key?(:'TopMargin')
|
202
|
+
self.top_margin = attributes[:'TopMargin']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.has_key?(:'RightMargin')
|
206
|
+
self.right_margin = attributes[:'RightMargin']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.has_key?(:'PageNumber')
|
210
|
+
self.page_number = attributes[:'PageNumber']
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
216
|
+
# @return Array for valid properies with the reasons
|
217
|
+
def list_invalid_properties
|
218
|
+
invalid_properties = Array.new
|
219
|
+
if @page_number.nil?
|
220
|
+
invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
|
221
|
+
end
|
222
|
+
|
223
|
+
return invalid_properties
|
224
|
+
end
|
225
|
+
|
226
|
+
# Check to see if the all the properties in the model are valid
|
227
|
+
# @return true if the model is valid
|
228
|
+
def valid?
|
229
|
+
return false if @page_number.nil?
|
230
|
+
return true
|
231
|
+
end
|
232
|
+
|
233
|
+
# Checks equality by comparing each attribute.
|
234
|
+
# @param [Object] Object to be compared
|
235
|
+
def ==(o)
|
236
|
+
return true if self.equal?(o)
|
237
|
+
self.class == o.class &&
|
238
|
+
links == o.links &&
|
239
|
+
background == o.background &&
|
240
|
+
horizontal_alignment == o.horizontal_alignment &&
|
241
|
+
opacity == o.opacity &&
|
242
|
+
rotate == o.rotate &&
|
243
|
+
rotate_angle == o.rotate_angle &&
|
244
|
+
x_indent == o.x_indent &&
|
245
|
+
y_indent == o.y_indent &&
|
246
|
+
zoom == o.zoom &&
|
247
|
+
file_name == o.file_name &&
|
248
|
+
width == o.width &&
|
249
|
+
height == o.height &&
|
250
|
+
vertical_alignment == o.vertical_alignment &&
|
251
|
+
bottom_margin == o.bottom_margin &&
|
252
|
+
left_margin == o.left_margin &&
|
253
|
+
top_margin == o.top_margin &&
|
254
|
+
right_margin == o.right_margin &&
|
255
|
+
page_number == o.page_number
|
256
|
+
end
|
257
|
+
|
258
|
+
# @see the `==` method
|
259
|
+
# @param [Object] Object to be compared
|
260
|
+
def eql?(o)
|
261
|
+
self == o
|
262
|
+
end
|
263
|
+
|
264
|
+
# Calculates hash code according to all attributes.
|
265
|
+
# @return [Fixnum] Hash code
|
266
|
+
def hash
|
267
|
+
[links, background, horizontal_alignment, opacity, rotate, rotate_angle, x_indent, y_indent, zoom, file_name, width, height, vertical_alignment, bottom_margin, left_margin, top_margin, right_margin, page_number].hash
|
268
|
+
end
|
269
|
+
|
270
|
+
# Builds the object from hash
|
271
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
272
|
+
# @return [Object] Returns the model itself
|
273
|
+
def build_from_hash(attributes)
|
274
|
+
return nil unless attributes.is_a?(Hash)
|
275
|
+
self.class.swagger_types.each_pair do |key, type|
|
276
|
+
if type =~ /\AArray<(.*)>/i
|
277
|
+
# check to ensure the input is an array given that the the attribute
|
278
|
+
# is documented as an array but the input is not
|
279
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
280
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
281
|
+
end
|
282
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
283
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
284
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
285
|
+
end
|
286
|
+
|
287
|
+
self
|
288
|
+
end
|
289
|
+
|
290
|
+
# Deserializes the data based on type
|
291
|
+
# @param string type Data type
|
292
|
+
# @param string value Value to be deserialized
|
293
|
+
# @return [Object] Deserialized data
|
294
|
+
def _deserialize(type, value)
|
295
|
+
case type.to_sym
|
296
|
+
when :DateTime
|
297
|
+
DateTime.parse(value)
|
298
|
+
when :Date
|
299
|
+
Date.parse(value)
|
300
|
+
when :String
|
301
|
+
value.to_s
|
302
|
+
when :Integer
|
303
|
+
value.to_i
|
304
|
+
when :Float
|
305
|
+
value.to_f
|
306
|
+
when :BOOLEAN
|
307
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
308
|
+
true
|
309
|
+
else
|
310
|
+
false
|
311
|
+
end
|
312
|
+
when :Object
|
313
|
+
# generic object (usually a Hash), return directly
|
314
|
+
value
|
315
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
316
|
+
inner_type = Regexp.last_match[:inner_type]
|
317
|
+
value.map { |v| _deserialize(inner_type, v) }
|
318
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
319
|
+
k_type = Regexp.last_match[:k_type]
|
320
|
+
v_type = Regexp.last_match[:v_type]
|
321
|
+
{}.tap do |hash|
|
322
|
+
value.each do |k, v|
|
323
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
324
|
+
end
|
325
|
+
end
|
326
|
+
else # model
|
327
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
328
|
+
temp_model.build_from_hash(value)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
# Returns the string representation of the object
|
333
|
+
# @return [String] String presentation of the object
|
334
|
+
def to_s
|
335
|
+
to_hash.to_s
|
336
|
+
end
|
337
|
+
|
338
|
+
# to_body is an alias to to_hash (backward compatibility)
|
339
|
+
# @return [Hash] Returns the object in the form of hash
|
340
|
+
def to_body
|
341
|
+
to_hash
|
342
|
+
end
|
343
|
+
|
344
|
+
# Returns the object in the form of hash
|
345
|
+
# @return [Hash] Returns the object in the form of hash
|
346
|
+
def to_hash
|
347
|
+
hash = {}
|
348
|
+
self.class.attribute_map.each_pair do |attr, param|
|
349
|
+
value = self.send(attr)
|
350
|
+
next if value.nil?
|
351
|
+
hash[param] = _to_hash(value)
|
352
|
+
end
|
353
|
+
hash
|
354
|
+
end
|
355
|
+
|
356
|
+
# Outputs non-array value in the form of hash
|
357
|
+
# For object, use to_hash. Otherwise, just return the value
|
358
|
+
# @param [Object] value Any valid value
|
359
|
+
# @return [Hash] Returns the value in the form of hash
|
360
|
+
def _to_hash(value)
|
361
|
+
if value.is_a?(Array)
|
362
|
+
value.compact.map{ |v| _to_hash(v) }
|
363
|
+
elsif value.is_a?(Hash)
|
364
|
+
{}.tap do |hash|
|
365
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
366
|
+
end
|
367
|
+
elsif value.respond_to? :to_hash
|
368
|
+
value.to_hash
|
369
|
+
else
|
370
|
+
value
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
end
|
375
|
+
|
376
|
+
end
|
@@ -0,0 +1,376 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2025 Aspose.PDF Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'date'
|
23
|
+
require 'time'
|
24
|
+
|
25
|
+
module AsposePdfCloud
|
26
|
+
# Represents Pdf stamps.
|
27
|
+
class TextStampPageSpecified
|
28
|
+
# Link to the document.
|
29
|
+
attr_accessor :links
|
30
|
+
|
31
|
+
# Sets or gets a bool value that indicates the content is stamped as background. If the value is true, the stamp content is layed at the bottom. By defalt, the value is false, the stamp content is layed at the top.
|
32
|
+
attr_accessor :background
|
33
|
+
|
34
|
+
# Gets or sets Horizontal alignment of stamp on the page.
|
35
|
+
attr_accessor :horizontal_alignment
|
36
|
+
|
37
|
+
# Gets or sets a value to indicate the stamp opacity. The value is from 0.0 to 1.0. By default the value is 1.0.
|
38
|
+
attr_accessor :opacity
|
39
|
+
|
40
|
+
# Sets or gets the rotation of stamp content according Rotation values. Note. This property is for set angles which are multiples of 90 degrees (0, 90, 180, 270 degrees). To set arbitrary angle use RotateAngle property. If angle set by ArbitraryAngle is not multiple of 90 then Rotate property returns Rotation.None.
|
41
|
+
attr_accessor :rotate
|
42
|
+
|
43
|
+
# Gets or sets rotate angle of stamp in degrees. This property allows to set arbitrary rotate angle.
|
44
|
+
attr_accessor :rotate_angle
|
45
|
+
|
46
|
+
# Horizontal stamp coordinate, starting from the left.
|
47
|
+
attr_accessor :x_indent
|
48
|
+
|
49
|
+
# Vertical stamp coordinate, starting from the bottom.
|
50
|
+
attr_accessor :y_indent
|
51
|
+
|
52
|
+
# Zooming factor of the stamp. Allows to scale stamp.
|
53
|
+
attr_accessor :zoom
|
54
|
+
|
55
|
+
# Alignment of the text inside the stamp.
|
56
|
+
attr_accessor :text_alignment
|
57
|
+
|
58
|
+
# Gets or sets string value which is used as stamp on the page.
|
59
|
+
attr_accessor :value
|
60
|
+
|
61
|
+
# Gets text properties of the stamp. See TextState for details.
|
62
|
+
attr_accessor :text_state
|
63
|
+
|
64
|
+
# Gets or sets vertical alignment of stamp on page.
|
65
|
+
attr_accessor :vertical_alignment
|
66
|
+
|
67
|
+
# Gets or sets bottom margin of stamp.
|
68
|
+
attr_accessor :bottom_margin
|
69
|
+
|
70
|
+
# Gets or sets left margin of stamp.
|
71
|
+
attr_accessor :left_margin
|
72
|
+
|
73
|
+
# Gets or sets top margin of stamp.
|
74
|
+
attr_accessor :top_margin
|
75
|
+
|
76
|
+
# Gets or sets right margin of stamp.
|
77
|
+
attr_accessor :right_margin
|
78
|
+
|
79
|
+
# Page number.
|
80
|
+
attr_accessor :page_number
|
81
|
+
|
82
|
+
|
83
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
84
|
+
def self.attribute_map
|
85
|
+
{
|
86
|
+
:'links' => :'Links',
|
87
|
+
:'background' => :'Background',
|
88
|
+
:'horizontal_alignment' => :'HorizontalAlignment',
|
89
|
+
:'opacity' => :'Opacity',
|
90
|
+
:'rotate' => :'Rotate',
|
91
|
+
:'rotate_angle' => :'RotateAngle',
|
92
|
+
:'x_indent' => :'XIndent',
|
93
|
+
:'y_indent' => :'YIndent',
|
94
|
+
:'zoom' => :'Zoom',
|
95
|
+
:'text_alignment' => :'TextAlignment',
|
96
|
+
:'value' => :'Value',
|
97
|
+
:'text_state' => :'TextState',
|
98
|
+
:'vertical_alignment' => :'VerticalAlignment',
|
99
|
+
:'bottom_margin' => :'BottomMargin',
|
100
|
+
:'left_margin' => :'LeftMargin',
|
101
|
+
:'top_margin' => :'TopMargin',
|
102
|
+
:'right_margin' => :'RightMargin',
|
103
|
+
:'page_number' => :'PageNumber'
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
107
|
+
# Attribute type mapping.
|
108
|
+
def self.swagger_types
|
109
|
+
{
|
110
|
+
:'links' => :'Array<Link>',
|
111
|
+
:'background' => :'BOOLEAN',
|
112
|
+
:'horizontal_alignment' => :'HorizontalAlignment',
|
113
|
+
:'opacity' => :'Float',
|
114
|
+
:'rotate' => :'Rotation',
|
115
|
+
:'rotate_angle' => :'Float',
|
116
|
+
:'x_indent' => :'Float',
|
117
|
+
:'y_indent' => :'Float',
|
118
|
+
:'zoom' => :'Float',
|
119
|
+
:'text_alignment' => :'HorizontalAlignment',
|
120
|
+
:'value' => :'String',
|
121
|
+
:'text_state' => :'TextState',
|
122
|
+
:'vertical_alignment' => :'VerticalAlignment',
|
123
|
+
:'bottom_margin' => :'Float',
|
124
|
+
:'left_margin' => :'Float',
|
125
|
+
:'top_margin' => :'Float',
|
126
|
+
:'right_margin' => :'Float',
|
127
|
+
:'page_number' => :'Integer'
|
128
|
+
}
|
129
|
+
end
|
130
|
+
|
131
|
+
# Initializes the object
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
def initialize(attributes = {})
|
134
|
+
return unless attributes.is_a?(Hash)
|
135
|
+
|
136
|
+
# convert string to symbol for hash key
|
137
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
138
|
+
|
139
|
+
if attributes.has_key?(:'Links')
|
140
|
+
if (value = attributes[:'Links']).is_a?(Array)
|
141
|
+
self.links = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'Background')
|
146
|
+
self.background = attributes[:'Background']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'HorizontalAlignment')
|
150
|
+
self.horizontal_alignment = attributes[:'HorizontalAlignment']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'Opacity')
|
154
|
+
self.opacity = attributes[:'Opacity']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'Rotate')
|
158
|
+
self.rotate = attributes[:'Rotate']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'RotateAngle')
|
162
|
+
self.rotate_angle = attributes[:'RotateAngle']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'XIndent')
|
166
|
+
self.x_indent = attributes[:'XIndent']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'YIndent')
|
170
|
+
self.y_indent = attributes[:'YIndent']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.has_key?(:'Zoom')
|
174
|
+
self.zoom = attributes[:'Zoom']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.has_key?(:'TextAlignment')
|
178
|
+
self.text_alignment = attributes[:'TextAlignment']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.has_key?(:'Value')
|
182
|
+
self.value = attributes[:'Value']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'TextState')
|
186
|
+
self.text_state = attributes[:'TextState']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'VerticalAlignment')
|
190
|
+
self.vertical_alignment = attributes[:'VerticalAlignment']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'BottomMargin')
|
194
|
+
self.bottom_margin = attributes[:'BottomMargin']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.has_key?(:'LeftMargin')
|
198
|
+
self.left_margin = attributes[:'LeftMargin']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.has_key?(:'TopMargin')
|
202
|
+
self.top_margin = attributes[:'TopMargin']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.has_key?(:'RightMargin')
|
206
|
+
self.right_margin = attributes[:'RightMargin']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.has_key?(:'PageNumber')
|
210
|
+
self.page_number = attributes[:'PageNumber']
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
|
215
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
216
|
+
# @return Array for valid properies with the reasons
|
217
|
+
def list_invalid_properties
|
218
|
+
invalid_properties = Array.new
|
219
|
+
if @page_number.nil?
|
220
|
+
invalid_properties.push("invalid value for 'page_number', page_number cannot be nil.")
|
221
|
+
end
|
222
|
+
|
223
|
+
return invalid_properties
|
224
|
+
end
|
225
|
+
|
226
|
+
# Check to see if the all the properties in the model are valid
|
227
|
+
# @return true if the model is valid
|
228
|
+
def valid?
|
229
|
+
return false if @page_number.nil?
|
230
|
+
return true
|
231
|
+
end
|
232
|
+
|
233
|
+
# Checks equality by comparing each attribute.
|
234
|
+
# @param [Object] Object to be compared
|
235
|
+
def ==(o)
|
236
|
+
return true if self.equal?(o)
|
237
|
+
self.class == o.class &&
|
238
|
+
links == o.links &&
|
239
|
+
background == o.background &&
|
240
|
+
horizontal_alignment == o.horizontal_alignment &&
|
241
|
+
opacity == o.opacity &&
|
242
|
+
rotate == o.rotate &&
|
243
|
+
rotate_angle == o.rotate_angle &&
|
244
|
+
x_indent == o.x_indent &&
|
245
|
+
y_indent == o.y_indent &&
|
246
|
+
zoom == o.zoom &&
|
247
|
+
text_alignment == o.text_alignment &&
|
248
|
+
value == o.value &&
|
249
|
+
text_state == o.text_state &&
|
250
|
+
vertical_alignment == o.vertical_alignment &&
|
251
|
+
bottom_margin == o.bottom_margin &&
|
252
|
+
left_margin == o.left_margin &&
|
253
|
+
top_margin == o.top_margin &&
|
254
|
+
right_margin == o.right_margin &&
|
255
|
+
page_number == o.page_number
|
256
|
+
end
|
257
|
+
|
258
|
+
# @see the `==` method
|
259
|
+
# @param [Object] Object to be compared
|
260
|
+
def eql?(o)
|
261
|
+
self == o
|
262
|
+
end
|
263
|
+
|
264
|
+
# Calculates hash code according to all attributes.
|
265
|
+
# @return [Fixnum] Hash code
|
266
|
+
def hash
|
267
|
+
[links, background, horizontal_alignment, opacity, rotate, rotate_angle, x_indent, y_indent, zoom, text_alignment, value, text_state, vertical_alignment, bottom_margin, left_margin, top_margin, right_margin, page_number].hash
|
268
|
+
end
|
269
|
+
|
270
|
+
# Builds the object from hash
|
271
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
272
|
+
# @return [Object] Returns the model itself
|
273
|
+
def build_from_hash(attributes)
|
274
|
+
return nil unless attributes.is_a?(Hash)
|
275
|
+
self.class.swagger_types.each_pair do |key, type|
|
276
|
+
if type =~ /\AArray<(.*)>/i
|
277
|
+
# check to ensure the input is an array given that the the attribute
|
278
|
+
# is documented as an array but the input is not
|
279
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
280
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
281
|
+
end
|
282
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
283
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
284
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
285
|
+
end
|
286
|
+
|
287
|
+
self
|
288
|
+
end
|
289
|
+
|
290
|
+
# Deserializes the data based on type
|
291
|
+
# @param string type Data type
|
292
|
+
# @param string value Value to be deserialized
|
293
|
+
# @return [Object] Deserialized data
|
294
|
+
def _deserialize(type, value)
|
295
|
+
case type.to_sym
|
296
|
+
when :DateTime
|
297
|
+
DateTime.parse(value)
|
298
|
+
when :Date
|
299
|
+
Date.parse(value)
|
300
|
+
when :String
|
301
|
+
value.to_s
|
302
|
+
when :Integer
|
303
|
+
value.to_i
|
304
|
+
when :Float
|
305
|
+
value.to_f
|
306
|
+
when :BOOLEAN
|
307
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
308
|
+
true
|
309
|
+
else
|
310
|
+
false
|
311
|
+
end
|
312
|
+
when :Object
|
313
|
+
# generic object (usually a Hash), return directly
|
314
|
+
value
|
315
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
316
|
+
inner_type = Regexp.last_match[:inner_type]
|
317
|
+
value.map { |v| _deserialize(inner_type, v) }
|
318
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
319
|
+
k_type = Regexp.last_match[:k_type]
|
320
|
+
v_type = Regexp.last_match[:v_type]
|
321
|
+
{}.tap do |hash|
|
322
|
+
value.each do |k, v|
|
323
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
324
|
+
end
|
325
|
+
end
|
326
|
+
else # model
|
327
|
+
temp_model = AsposePdfCloud.const_get(type).new
|
328
|
+
temp_model.build_from_hash(value)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
# Returns the string representation of the object
|
333
|
+
# @return [String] String presentation of the object
|
334
|
+
def to_s
|
335
|
+
to_hash.to_s
|
336
|
+
end
|
337
|
+
|
338
|
+
# to_body is an alias to to_hash (backward compatibility)
|
339
|
+
# @return [Hash] Returns the object in the form of hash
|
340
|
+
def to_body
|
341
|
+
to_hash
|
342
|
+
end
|
343
|
+
|
344
|
+
# Returns the object in the form of hash
|
345
|
+
# @return [Hash] Returns the object in the form of hash
|
346
|
+
def to_hash
|
347
|
+
hash = {}
|
348
|
+
self.class.attribute_map.each_pair do |attr, param|
|
349
|
+
value = self.send(attr)
|
350
|
+
next if value.nil?
|
351
|
+
hash[param] = _to_hash(value)
|
352
|
+
end
|
353
|
+
hash
|
354
|
+
end
|
355
|
+
|
356
|
+
# Outputs non-array value in the form of hash
|
357
|
+
# For object, use to_hash. Otherwise, just return the value
|
358
|
+
# @param [Object] value Any valid value
|
359
|
+
# @return [Hash] Returns the value in the form of hash
|
360
|
+
def _to_hash(value)
|
361
|
+
if value.is_a?(Array)
|
362
|
+
value.compact.map{ |v| _to_hash(v) }
|
363
|
+
elsif value.is_a?(Hash)
|
364
|
+
{}.tap do |hash|
|
365
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
366
|
+
end
|
367
|
+
elsif value.respond_to? :to_hash
|
368
|
+
value.to_hash
|
369
|
+
else
|
370
|
+
value
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
end
|
375
|
+
|
376
|
+
end
|
data/lib/aspose_pdf_cloud.rb
CHANGED
@@ -300,6 +300,7 @@ require_relative 'aspose_pdf_cloud/models/common_figure_annotation'
|
|
300
300
|
require_relative 'aspose_pdf_cloud/models/file_attachment_annotation'
|
301
301
|
require_relative 'aspose_pdf_cloud/models/free_text_annotation'
|
302
302
|
require_relative 'aspose_pdf_cloud/models/highlight_annotation'
|
303
|
+
require_relative 'aspose_pdf_cloud/models/image_stamp_page_specified'
|
303
304
|
require_relative 'aspose_pdf_cloud/models/ink_annotation'
|
304
305
|
require_relative 'aspose_pdf_cloud/models/line_annotation'
|
305
306
|
require_relative 'aspose_pdf_cloud/models/list_box_field'
|
@@ -311,6 +312,7 @@ require_relative 'aspose_pdf_cloud/models/squiggly_annotation'
|
|
311
312
|
require_relative 'aspose_pdf_cloud/models/stamp_annotation'
|
312
313
|
require_relative 'aspose_pdf_cloud/models/strike_out_annotation'
|
313
314
|
require_relative 'aspose_pdf_cloud/models/text_annotation'
|
315
|
+
require_relative 'aspose_pdf_cloud/models/text_stamp_page_specified'
|
314
316
|
require_relative 'aspose_pdf_cloud/models/underline_annotation'
|
315
317
|
require_relative 'aspose_pdf_cloud/models/circle_annotation'
|
316
318
|
require_relative 'aspose_pdf_cloud/models/poly_line_annotation'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aspose_pdf_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 25.
|
4
|
+
version: 25.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aspose PDF Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- lib/aspose_pdf_cloud/models/image_response.rb
|
175
175
|
- lib/aspose_pdf_cloud/models/image_src_type.rb
|
176
176
|
- lib/aspose_pdf_cloud/models/image_stamp.rb
|
177
|
+
- lib/aspose_pdf_cloud/models/image_stamp_page_specified.rb
|
177
178
|
- lib/aspose_pdf_cloud/models/image_template.rb
|
178
179
|
- lib/aspose_pdf_cloud/models/image_templates_request.rb
|
179
180
|
- lib/aspose_pdf_cloud/models/images.rb
|
@@ -336,6 +337,7 @@ files:
|
|
336
337
|
- lib/aspose_pdf_cloud/models/text_replace_list_request.rb
|
337
338
|
- lib/aspose_pdf_cloud/models/text_replace_response.rb
|
338
339
|
- lib/aspose_pdf_cloud/models/text_stamp.rb
|
340
|
+
- lib/aspose_pdf_cloud/models/text_stamp_page_specified.rb
|
339
341
|
- lib/aspose_pdf_cloud/models/text_state.rb
|
340
342
|
- lib/aspose_pdf_cloud/models/text_style.rb
|
341
343
|
- lib/aspose_pdf_cloud/models/timestamp_settings.rb
|