Skip to content

Commit f64400d

Browse files
authored
Merge pull request #90 from aspose-pdf-cloud/develop
update to 25.5
2 parents bd71f74 + 9cbff21 commit f64400d

File tree

5 files changed

+180
-7
lines changed

5 files changed

+180
-7
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
2929
## Read PDF Formats
3030
MHT, PCL, PS, XSLFO, MD
3131

32-
## Enhancements in Version 25.4
33-
- Add method for adding Stamp per page in batch.
32+
## Enhancements in Version 25.5
33+
- Add a method for comparing pdf files.
3434
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3535

3636
## Installation
@@ -46,15 +46,15 @@ gem build aspose_pdf_cloud.gemspec
4646
Then either install the gem locally:
4747

4848
```shell
49-
gem install ./aspose_pdf_cloud-25.4.0.gem
49+
gem install ./aspose_pdf_cloud-25.5.0.gem
5050
```
51-
(for development, run `gem install --dev ./aspose_pdf_cloud-25.4.0.gem` to install the development dependencies)
51+
(for development, run `gem install --dev ./aspose_pdf_cloud-25.5.0.gem` to install the development dependencies)
5252

5353
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
5454

5555
Finally add this to the Gemfile:
5656

57-
gem 'aspose_pdf_cloud', '~> 25.4.0'
57+
gem 'aspose_pdf_cloud', '~> 25.5.0'
5858

5959
### Install from Git
6060

docs/PdfApi.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ Method | HTTP request | Description
203203
[**post_change_password_document_in_storage**](PdfApi.md#post_change_password_document_in_storage) | **POST** /pdf/\{name}/changepassword | Change document password in storage.
204204
[**post_check_box_fields**](PdfApi.md#post_check_box_fields) | **POST** /pdf/\{name}/fields/checkbox | Add document checkbox fields.
205205
[**post_combo_box_fields**](PdfApi.md#post_combo_box_fields) | **POST** /pdf/\{name}/fields/combobox | Add document combobox fields.
206+
[**post_compare_pdf**](PdfApi.md#post_compare_pdf) | **POST** /pdf/compare | Compare two PDF documents.
206207
[**post_create_document**](PdfApi.md#post_create_document) | **POST** /pdf/\{name} | Create empty document.
207208
[**post_create_field**](PdfApi.md#post_create_field) | **POST** /pdf/\{name}/fields | Create field.
208209
[**post_decrypt_document_in_storage**](PdfApi.md#post_decrypt_document_in_storage) | **POST** /pdf/\{name}/decrypt | Decrypt document in storage.
@@ -2863,6 +2864,12 @@ Convert MHT file (located on storage) to PDF format and return resulting file in
28632864
Name | Type | Description | Notes
28642865
------------- | ------------- | ------------- | -------------
28652866
**src_path** | **String**| Full source filename (ex. /folder1/folder2/template.mht) |
2867+
**height** | **Float**| Page height | [optional]
2868+
**width** | **Float**| Page width | [optional]
2869+
**margin_left** | **Float**| Page margin left | [optional]
2870+
**margin_bottom** | **Float**| Page margin bottom | [optional]
2871+
**margin_right** | **Float**| Page margin right | [optional]
2872+
**margin_top** | **Float**| Page margin top | [optional]
28662873
**storage** | **String**| The document storage. | [optional]
28672874

28682875
### Return type
@@ -5418,6 +5425,31 @@ Name | Type | Description | Notes
54185425

54195426

54205427

5428+
# **post_compare_pdf**
5429+
> AsposeResponse post_compare_pdf(path1, path2, out_path, opts)
5430+
5431+
Compare two PDF documents.
5432+
5433+
### Parameters
5434+
5435+
Name | Type | Description | Notes
5436+
------------- | ------------- | ------------- | -------------
5437+
**path1** | **String**| Path to first PDF document. |
5438+
**path2** | **String**| Path to second PDF document. |
5439+
**out_path** | **String**| Full filename of the resulting document. |
5440+
**storage** | **String**| The documents storage. | [optional]
5441+
5442+
### Return type
5443+
5444+
[**AsposeResponse**](AsposeResponse.md)
5445+
5446+
### HTTP request headers
5447+
5448+
- **Content-Type**: application/json
5449+
- **Accept**: application/json
5450+
5451+
5452+
54215453
# **post_create_document**
54225454
> DocumentResponse post_create_document(name, document_config, opts)
54235455
@@ -8131,6 +8163,12 @@ Name | Type | Description | Notes
81318163
------------- | ------------- | ------------- | -------------
81328164
**name** | **String**| The document name. |
81338165
**src_path** | **String**| Full source filename (ex. /folder1/folder2/template.mht) |
8166+
**height** | **Float**| Page height | [optional]
8167+
**width** | **Float**| Page width | [optional]
8168+
**margin_left** | **Float**| Page margin left | [optional]
8169+
**margin_bottom** | **Float**| Page margin bottom | [optional]
8170+
**margin_right** | **Float**| Page margin right | [optional]
8171+
**margin_top** | **Float**| Page margin top | [optional]
81348172
**dst_folder** | **String**| The destination document folder. | [optional]
81358173
**storage** | **String**| The document storage. | [optional]
81368174

lib/aspose_pdf_cloud/api/pdf_api.rb

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7597,6 +7597,12 @@ def get_markdown_in_storage_to_pdf_with_http_info(src_path, opts = {})
75977597
#
75987598
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
75997599
# @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
76007606
# @option opts [String] :storage The document storage.
76017607
# @return [File]
76027608
def get_mht_in_storage_to_pdf(src_path, opts = {})
@@ -7616,6 +7622,12 @@ def get_mht_in_storage_to_pdf(src_path, opts = {})
76167622
#
76177623
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
76187624
# @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
76197631
# @option opts [String] :storage The document storage.
76207632
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
76217633
def get_mht_in_storage_to_pdf_with_http_info(src_path, opts = {})
@@ -7632,6 +7644,12 @@ def get_mht_in_storage_to_pdf_with_http_info(src_path, opts = {})
76327644
# query parameters
76337645
query_params = {}
76347646
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?
76357653
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
76367654

76377655
# header parameters
@@ -15597,6 +15615,90 @@ def post_combo_box_fields_with_http_info(name, fields, opts = {})
1559715615
return data, status_code, headers
1559815616
end
1559915617

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+
1560015702
# Create empty document.
1560115703
#
1560215704
# @param name The new document name.
@@ -24152,6 +24254,12 @@ def put_merge_documents_with_http_info(name, merge_documents, opts = {})
2415224254
# @param name The document name.
2415324255
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
2415424256
# @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
2415524263
# @option opts [String] :dst_folder The destination document folder.
2415624264
# @option opts [String] :storage The document storage.
2415724265
# @return [AsposeResponse]
@@ -24173,6 +24281,12 @@ def put_mht_in_storage_to_pdf(name, src_path, opts = {})
2417324281
# @param name The document name.
2417424282
# @param src_path Full source filename (ex. /folder1/folder2/template.mht)
2417524283
# @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
2417624290
# @option opts [String] :dst_folder The destination document folder.
2417724291
# @option opts [String] :storage The document storage.
2417824292
# @return [Array<(AsposeResponse, Fixnum, Hash)>] AsposeResponse data, response status code and response headers
@@ -24194,6 +24308,12 @@ def put_mht_in_storage_to_pdf_with_http_info(name, src_path, opts = {})
2419424308
# query parameters
2419524309
query_params = {}
2419624310
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?
2419724317
query_params[:'dstFolder'] = opts[:'dst_folder'] if !opts[:'dst_folder'].nil?
2419824318
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
2419924319

lib/aspose_pdf_cloud/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
=end
2121

2222
module AsposePdfCloud
23-
VERSION = "25.4.0"
23+
VERSION = "25.5.0"
2424
end

test/pdf_tests.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def setup
4040
@temp_folder = 'TempPdfCloud'
4141
@test_data_folder = 'test_data/'
4242
config = @pdf_api.api_client.config
43-
config.scheme = 'https'
43+
config.scheme = 'http'
4444
end
4545

4646
def teardown
@@ -6755,4 +6755,19 @@ def test_post_xmp_metadata
67556755
assert(response, 'Failed to get xmp metadata in json format')
67566756
assert_equal(9, response[0].properties.count, 'Failed to read document xmp metadata.')
67576757
end
6758+
6759+
def test_post_compare_pdf
6760+
file_name_1 = '4pages.pdf'
6761+
upload_file(file_name_1)
6762+
6763+
file_name_2 = '4pagesPdfA.pdf'
6764+
upload_file(file_name_2)
6765+
6766+
opts = {
6767+
folder: @temp_folder
6768+
}
6769+
6770+
response = @pdf_api.post_compare_pdf(@temp_folder + '/' + file_name_1, @temp_folder + '/' + file_name_2, @temp_folder + '/' + 'output.pdf', opts)
6771+
assert(response, 'Failed to compare a PDF files.')
6772+
end
67586773
end

0 commit comments

Comments
 (0)