Skip to content

Commit a06939c

Browse files
authored
Merge pull request #115 from aspose-pdf-cloud/develop
update to 25.5
2 parents 990785f + 0ba9f60 commit a06939c

File tree

10 files changed

+467
-37
lines changed

10 files changed

+467
-37
lines changed

README.md

Lines changed: 2 additions & 2 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
## Unit Tests

docs/PdfApi.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ Method | HTTP request | Description
203203
[**PostChangePasswordDocumentInStorage**](PdfApi.md#postchangepassworddocumentinstorage) | **POST** /pdf/\{name}/changepassword | Change document password in storage.
204204
[**PostCheckBoxFields**](PdfApi.md#postcheckboxfields) | **POST** /pdf/\{name}/fields/checkbox | Add document checkbox fields.
205205
[**PostComboBoxFields**](PdfApi.md#postcomboboxfields) | **POST** /pdf/\{name}/fields/combobox | Add document combobox fields.
206+
[**PostComparePdf**](PdfApi.md#postcomparepdf) | **POST** /pdf/compare | Compare two PDF documents.
206207
[**PostCreateDocument**](PdfApi.md#postcreatedocument) | **POST** /pdf/\{name} | Create empty document.
207208
[**PostCreateField**](PdfApi.md#postcreatefield) | **POST** /pdf/\{name}/fields | Create field.
208209
[**PostDecryptDocumentInStorage**](PdfApi.md#postdecryptdocumentinstorage) | **POST** /pdf/\{name}/decrypt | Decrypt document in storage.
@@ -3055,7 +3056,7 @@ Name | Type | Description | Notes
30553056

30563057
<a name="getmhtinstoragetopdf"></a>
30573058
# **GetMhtInStorageToPdf**
3058-
> System.IO.Stream GetMhtInStorageToPdf (string srcPath, string storage = null)
3059+
> System.IO.Stream GetMhtInStorageToPdf (string srcPath, double? height = null, double? width = null, double? marginLeft = null, double? marginBottom = null, double? marginRight = null, double? marginTop = null, string storage = null)
30593060
30603061
Convert MHT file (located on storage) to PDF format and return resulting file in response.
30613062

@@ -3065,6 +3066,12 @@ Convert MHT file (located on storage) to PDF format and return resulting file in
30653066
Name | Type | Description | Notes
30663067
------------- | ------------- | ------------- | -------------
30673068
**srcPath** | **string**| Full source filename (ex. /folder1/folder2/template.mht) |
3069+
**height** | **double?**| Page height | [optional]
3070+
**width** | **double?**| Page width | [optional]
3071+
**marginLeft** | **double?**| Page margin left | [optional]
3072+
**marginBottom** | **double?**| Page margin bottom | [optional]
3073+
**marginRight** | **double?**| Page margin right | [optional]
3074+
**marginTop** | **double?**| Page margin top | [optional]
30683075
**storage** | **string**| The document storage. | [optional]
30693076

30703077
### Return type
@@ -5816,6 +5823,33 @@ Name | Type | Description | Notes
58165823

58175824
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
58185825

5826+
<a name="postcomparepdf"></a>
5827+
# **PostComparePdf**
5828+
> AsposeResponse PostComparePdf (string path1, string path2, string outPath, string storage = null)
5829+
5830+
Compare two PDF documents.
5831+
5832+
5833+
### Parameters
5834+
5835+
Name | Type | Description | Notes
5836+
------------- | ------------- | ------------- | -------------
5837+
**path1** | **string**| Path to first PDF document. |
5838+
**path2** | **string**| Path to second PDF document. |
5839+
**outPath** | **string**| Full filename of the resulting document. |
5840+
**storage** | **string**| The documents storage. | [optional]
5841+
5842+
### Return type
5843+
5844+
[**AsposeResponse**](AsposeResponse.md)
5845+
5846+
### HTTP request headers
5847+
5848+
- **Content-Type**: application/json
5849+
- **Accept**: application/json
5850+
5851+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
5852+
58195853
<a name="postcreatedocument"></a>
58205854
# **PostCreateDocument**
58215855
> DocumentResponse PostCreateDocument (string name, DocumentConfig documentConfig, string storage = null, string folder = null)
@@ -8726,7 +8760,7 @@ Name | Type | Description | Notes
87268760

87278761
<a name="putmhtinstoragetopdf"></a>
87288762
# **PutMhtInStorageToPdf**
8729-
> AsposeResponse PutMhtInStorageToPdf (string name, string srcPath, string dstFolder = null, string storage = null)
8763+
> AsposeResponse PutMhtInStorageToPdf (string name, string srcPath, double? height = null, double? width = null, double? marginLeft = null, double? marginBottom = null, double? marginRight = null, double? marginTop = null, string dstFolder = null, string storage = null)
87308764
87318765
Convert MHT file (located on storage) to PDF format and upload resulting file to storage.
87328766

@@ -8737,6 +8771,12 @@ Name | Type | Description | Notes
87378771
------------- | ------------- | ------------- | -------------
87388772
**name** | **string**| The document name. |
87398773
**srcPath** | **string**| Full source filename (ex. /folder1/folder2/template.mht) |
8774+
**height** | **double?**| Page height | [optional]
8775+
**width** | **double?**| Page width | [optional]
8776+
**marginLeft** | **double?**| Page margin left | [optional]
8777+
**marginBottom** | **double?**| Page margin bottom | [optional]
8778+
**marginRight** | **double?**| Page margin right | [optional]
8779+
**marginTop** | **double?**| Page margin top | [optional]
87408780
**dstFolder** | **string**| The destination document folder. | [optional]
87418781
**storage** | **string**| The document storage. | [optional]
87428782

src/Aspose.Pdf.Cloud.Sdk.Test/Aspose.Pdf.Cloud.Sdk.Test.Core.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<Project Sdk="Microsoft.NET.Sdk">
3-
42
<PropertyGroup>
53
<TargetFramework>net6.0</TargetFramework>
64
<AssemblyName>Aspose.Pdf.Cloud.Sdk.Test</AssemblyName>
@@ -11,19 +9,16 @@
119
<GenerateAssemblyKeyFile>false</GenerateAssemblyKeyFile>
1210
<Configurations>Debug;Release</Configurations>
1311
</PropertyGroup>
14-
1512
<ItemGroup>
1613
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
1714
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.7.0" />
1815
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1916
<PackageReference Include="NUnit" Version="3.13.0" />
2017
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
2118
</ItemGroup>
22-
2319
<ItemGroup>
2420
<ProjectReference Include="..\Aspose.Pdf.Cloud.Sdk\Aspose.Pdf.Cloud.Sdk.Core.csproj" />
2521
</ItemGroup>
26-
2722
<ItemGroup>
2823
<Compile Include="AnnotationsTests.cs" />
2924
<Compile Include="AppendTests.cs" />
@@ -48,6 +43,7 @@
4843
<Compile Include="LinkAnnotationsTests.cs" />
4944
<Compile Include="MergeTests.cs" />
5045
<Compile Include="MovieAnnotationsTests.cs" />
46+
<Compile Include="OrganizeTests.cs" />
5147
<Compile Include="PageConvertToImageTests.cs" />
5248
<Compile Include="PolygonAnnotationsTests.cs" />
5349
<Compile Include="PolyLineAnnotationsTests.cs" />
@@ -74,5 +70,4 @@
7470
<Compile Include="XmpMetadataTests.cs" />
7571
<Compile Include="StorageTests.cs" />
7672
</ItemGroup>
77-
78-
</Project>
73+
</Project>

src/Aspose.Pdf.Cloud.Sdk.Test/Aspose.Pdf.Cloud.Sdk.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ OpenAPI spec version: 1.1
8282
<Compile Include="LinkAnnotationsTests.cs" />
8383
<Compile Include="MergeTests.cs" />
8484
<Compile Include="MovieAnnotationsTests.cs" />
85+
<Compile Include="OrganizeTests.cs" />
8586
<Compile Include="PageConvertToImageTests.cs" />
8687
<Compile Include="PolygonAnnotationsTests.cs" />
8788
<Compile Include="PolyLineAnnotationsTests.cs" />

src/Aspose.Pdf.Cloud.Sdk.Test/ConvertToPdfTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void GetMhtInStorageToPdfTest()
133133
string name = "MhtExample.mht";
134134
UploadFile(name, name);
135135

136-
using (var response = PdfApi.GetMhtInStorageToPdf(Path.Combine(TempFolder, name)))
136+
using (var response = PdfApi.GetMhtInStorageToPdf(Path.Combine(TempFolder, name), null, null, null, null, null, null))
137137
{
138138
Assert.That(response.Length, Is.GreaterThan(0));
139139
}
@@ -149,7 +149,7 @@ public void PutMhtInStorageToPdfTest()
149149
UploadFile(name, name);
150150
string resultName = "fromMht.pdf";
151151

152-
var response = PdfApi.PutMhtInStorageToPdf(resultName, Path.Combine(TempFolder, name), TempFolder);
152+
var response = PdfApi.PutMhtInStorageToPdf(resultName, Path.Combine(TempFolder, name), null, null, null, null, null, null, TempFolder);
153153
Assert.That(response.Code, Is.EqualTo(200));
154154
}
155155

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose" file="PagesTests.cs">
3+
// Copyright (c) 2025 Aspose.PDF Cloud
4+
// </copyright>
5+
// <summary>
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
26+
using System;
27+
using System.IO;
28+
using System.Net;
29+
using System.Text;
30+
using Aspose.Pdf.Cloud.Sdk.Model;
31+
using NUnit.Framework;
32+
33+
namespace Aspose.Pdf.Cloud.Sdk.Test
34+
{
35+
/// <summary>
36+
/// Class for testing Organize Api
37+
/// </summary>
38+
[TestFixture]
39+
public class OrganizeTests : TestsBase
40+
{
41+
42+
/// <summary>
43+
/// Test PostComparePdf
44+
/// </summary>
45+
[Test]
46+
public void PostComparePdfTest()
47+
{
48+
string name1 = "4pages.pdf";
49+
UploadFile(name1, name1);
50+
string name2 = "4pagesPdfA.pdf";
51+
UploadFile(name2, name2);
52+
string output = "output.pdf";
53+
54+
var response = PdfApi.PostComparePdf(TempFolder + "/" + name1, TempFolder + "/" + name2, output);
55+
Assert.That(response.Code, Is.EqualTo(200));
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)