Skip to content

Commit 0ba9f60

Browse files
author
kirill.novinskiy@aspose.com
committed
added compare tests
1 parent ff393d8 commit 0ba9f60

File tree

6 files changed

+189
-207
lines changed

6 files changed

+189
-207
lines changed

docs/PdfApi.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,7 +3056,7 @@ Name | Type | Description | Notes
30563056

30573057
<a name="getmhtinstoragetopdf"></a>
30583058
# **GetMhtInStorageToPdf**
3059-
> System.IO.Stream GetMhtInStorageToPdf (string srcPath, double? height, double? width, double? marginLeft, double? marginBottom, double? marginRight, double? marginTop, 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)
30603060
30613061
Convert MHT file (located on storage) to PDF format and return resulting file in response.
30623062

@@ -3066,12 +3066,12 @@ Convert MHT file (located on storage) to PDF format and return resulting file in
30663066
Name | Type | Description | Notes
30673067
------------- | ------------- | ------------- | -------------
30683068
**srcPath** | **string**| Full source filename (ex. /folder1/folder2/template.mht) |
3069-
**height** | **double?**| Page height |
3070-
**width** | **double?**| Page width |
3071-
**marginLeft** | **double?**| Page margin left |
3072-
**marginBottom** | **double?**| Page margin bottom |
3073-
**marginRight** | **double?**| Page margin right |
3074-
**marginTop** | **double?**| Page margin top |
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]
30753075
**storage** | **string**| The document storage. | [optional]
30763076

30773077
### Return type
@@ -8760,7 +8760,7 @@ Name | Type | Description | Notes
87608760

87618761
<a name="putmhtinstoragetopdf"></a>
87628762
# **PutMhtInStorageToPdf**
8763-
> AsposeResponse PutMhtInStorageToPdf (string name, string srcPath, double? height, double? width, double? marginLeft, double? marginBottom, double? marginRight, double? marginTop, 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)
87648764
87658765
Convert MHT file (located on storage) to PDF format and upload resulting file to storage.
87668766

@@ -8771,12 +8771,12 @@ Name | Type | Description | Notes
87718771
------------- | ------------- | ------------- | -------------
87728772
**name** | **string**| The document name. |
87738773
**srcPath** | **string**| Full source filename (ex. /folder1/folder2/template.mht) |
8774-
**height** | **double?**| Page height |
8775-
**width** | **double?**| Page width |
8776-
**marginLeft** | **double?**| Page margin left |
8777-
**marginBottom** | **double?**| Page margin bottom |
8778-
**marginRight** | **double?**| Page margin right |
8779-
**marginTop** | **double?**| Page margin top |
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]
87808780
**dstFolder** | **string**| The destination document folder. | [optional]
87818781
**storage** | **string**| The document storage. | [optional]
87828782

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)