Skip to content

Commit 4411fe2

Browse files
author
kirill.novinskiy@aspose.com
committed
added compare tests
1 parent 2e15477 commit 4411fe2

File tree

4 files changed

+118
-122
lines changed

4 files changed

+118
-122
lines changed

docs/PdfApi.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,12 +2765,12 @@ Convert MHT file (located on storage) to PDF format and return resulting file in
27652765
Name | Type | Description | Notes
27662766
------------- | ------------- | ------------- | -------------
27672767
**srcPath** | **String**| Full source filename (ex. /folder1/folder2/template.mht) |
2768-
**height** | **Double**| Page height |
2769-
**width** | **Double**| Page width |
2770-
**marginLeft** | **Double**| Page margin left |
2771-
**marginBottom** | **Double**| Page margin bottom |
2772-
**marginRight** | **Double**| Page margin right |
2773-
**marginTop** | **Double**| Page margin top |
2768+
**height** | **Double**| Page height | [optional]
2769+
**width** | **Double**| Page width | [optional]
2770+
**marginLeft** | **Double**| Page margin left | [optional]
2771+
**marginBottom** | **Double**| Page margin bottom | [optional]
2772+
**marginRight** | **Double**| Page margin right | [optional]
2773+
**marginTop** | **Double**| Page margin top | [optional]
27742774
**storage** | **String**| The document storage. | [optional]
27752775

27762776
### Return type
@@ -7861,12 +7861,12 @@ Name | Type | Description | Notes
78617861
------------- | ------------- | ------------- | -------------
78627862
**name** | **String**| The document name. |
78637863
**srcPath** | **String**| Full source filename (ex. /folder1/folder2/template.mht) |
7864-
**height** | **Double**| Page height |
7865-
**width** | **Double**| Page width |
7866-
**marginLeft** | **Double**| Page margin left |
7867-
**marginBottom** | **Double**| Page margin bottom |
7868-
**marginRight** | **Double**| Page margin right |
7869-
**marginTop** | **Double**| Page margin top |
7864+
**height** | **Double**| Page height | [optional]
7865+
**width** | **Double**| Page width | [optional]
7866+
**marginLeft** | **Double**| Page margin left | [optional]
7867+
**marginBottom** | **Double**| Page margin bottom | [optional]
7868+
**marginRight** | **Double**| Page margin right | [optional]
7869+
**marginTop** | **Double**| Page margin top | [optional]
78707870
**dstFolder** | **String**| The destination document folder. | [optional]
78717871
**storage** | **String**| The document storage. | [optional]
78727872

src/main/java/com/aspose/asposecloudpdf/api/PdfApi.java

Lines changed: 48 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -15609,12 +15609,12 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
1560915609
/**
1561015610
* Build call for getMhtInStorageToPdf
1561115611
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
15612-
* @param height Page height (required)
15613-
* @param width Page width (required)
15614-
* @param marginLeft Page margin left (required)
15615-
* @param marginBottom Page margin bottom (required)
15616-
* @param marginRight Page margin right (required)
15617-
* @param marginTop Page margin top (required)
15612+
* @param height Page height (optional)
15613+
* @param width Page width (optional)
15614+
* @param marginLeft Page margin left (optional)
15615+
* @param marginBottom Page margin bottom (optional)
15616+
* @param marginRight Page margin right (optional)
15617+
* @param marginTop Page margin top (optional)
1561815618
* @param storage The document storage. (optional)
1561915619
* @param progressListener Progress listener
1562015620
* @param progressRequestListener Progress request listener
@@ -15686,36 +15686,6 @@ private com.squareup.okhttp.Call getMhtInStorageToPdfValidateBeforeCall(String s
1568615686
throw new ApiException("Missing the required parameter 'srcPath' when calling getMhtInStorageToPdf(Async)");
1568715687
}
1568815688

15689-
// verify the required parameter 'height' is set
15690-
if (height == null) {
15691-
throw new ApiException("Missing the required parameter 'height' when calling getMhtInStorageToPdf(Async)");
15692-
}
15693-
15694-
// verify the required parameter 'width' is set
15695-
if (width == null) {
15696-
throw new ApiException("Missing the required parameter 'width' when calling getMhtInStorageToPdf(Async)");
15697-
}
15698-
15699-
// verify the required parameter 'marginLeft' is set
15700-
if (marginLeft == null) {
15701-
throw new ApiException("Missing the required parameter 'marginLeft' when calling getMhtInStorageToPdf(Async)");
15702-
}
15703-
15704-
// verify the required parameter 'marginBottom' is set
15705-
if (marginBottom == null) {
15706-
throw new ApiException("Missing the required parameter 'marginBottom' when calling getMhtInStorageToPdf(Async)");
15707-
}
15708-
15709-
// verify the required parameter 'marginRight' is set
15710-
if (marginRight == null) {
15711-
throw new ApiException("Missing the required parameter 'marginRight' when calling getMhtInStorageToPdf(Async)");
15712-
}
15713-
15714-
// verify the required parameter 'marginTop' is set
15715-
if (marginTop == null) {
15716-
throw new ApiException("Missing the required parameter 'marginTop' when calling getMhtInStorageToPdf(Async)");
15717-
}
15718-
1571915689

1572015690
com.squareup.okhttp.Call call = getMhtInStorageToPdfCall(srcPath, height, width, marginLeft, marginBottom, marginRight, marginTop, storage, progressListener, progressRequestListener);
1572115691
return call;
@@ -15726,12 +15696,12 @@ private com.squareup.okhttp.Call getMhtInStorageToPdfValidateBeforeCall(String s
1572615696
* Convert MHT file (located on storage) to PDF format and return resulting file in response.
1572715697
*
1572815698
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
15729-
* @param height Page height (required)
15730-
* @param width Page width (required)
15731-
* @param marginLeft Page margin left (required)
15732-
* @param marginBottom Page margin bottom (required)
15733-
* @param marginRight Page margin right (required)
15734-
* @param marginTop Page margin top (required)
15699+
* @param height Page height (optional)
15700+
* @param width Page width (optional)
15701+
* @param marginLeft Page margin left (optional)
15702+
* @param marginBottom Page margin bottom (optional)
15703+
* @param marginRight Page margin right (optional)
15704+
* @param marginTop Page margin top (optional)
1573515705
* @param storage The document storage. (optional)
1573615706
* @return File
1573715707
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
@@ -15758,12 +15728,12 @@ public File getMhtInStorageToPdf(String srcPath, Double height, Double width, Do
1575815728
* Convert MHT file (located on storage) to PDF format and return resulting file in response.
1575915729
*
1576015730
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
15761-
* @param height Page height (required)
15762-
* @param width Page width (required)
15763-
* @param marginLeft Page margin left (required)
15764-
* @param marginBottom Page margin bottom (required)
15765-
* @param marginRight Page margin right (required)
15766-
* @param marginTop Page margin top (required)
15731+
* @param height Page height (optional)
15732+
* @param width Page width (optional)
15733+
* @param marginLeft Page margin left (optional)
15734+
* @param marginBottom Page margin bottom (optional)
15735+
* @param marginRight Page margin right (optional)
15736+
* @param marginTop Page margin top (optional)
1576715737
* @param storage The document storage. (optional)
1576815738
* @return ApiResponse<File>
1576915739
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
@@ -15778,12 +15748,12 @@ public ApiResponse<File> getMhtInStorageToPdfWithHttpInfo(String srcPath, Double
1577815748
* Convert MHT file (located on storage) to PDF format and return resulting file in response. (asynchronously)
1577915749
*
1578015750
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
15781-
* @param height Page height (required)
15782-
* @param width Page width (required)
15783-
* @param marginLeft Page margin left (required)
15784-
* @param marginBottom Page margin bottom (required)
15785-
* @param marginRight Page margin right (required)
15786-
* @param marginTop Page margin top (required)
15751+
* @param height Page height (optional)
15752+
* @param width Page width (optional)
15753+
* @param marginLeft Page margin left (optional)
15754+
* @param marginBottom Page margin bottom (optional)
15755+
* @param marginRight Page margin right (optional)
15756+
* @param marginTop Page margin top (optional)
1578715757
* @param storage The document storage. (optional)
1578815758
* @param callback The callback to be executed when the API call finishes
1578915759
* @return The request call
@@ -49139,12 +49109,12 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
4913949109
* Build call for putMhtInStorageToPdf
4914049110
* @param name The document name. (required)
4914149111
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
49142-
* @param height Page height (required)
49143-
* @param width Page width (required)
49144-
* @param marginLeft Page margin left (required)
49145-
* @param marginBottom Page margin bottom (required)
49146-
* @param marginRight Page margin right (required)
49147-
* @param marginTop Page margin top (required)
49112+
* @param height Page height (optional)
49113+
* @param width Page width (optional)
49114+
* @param marginLeft Page margin left (optional)
49115+
* @param marginBottom Page margin bottom (optional)
49116+
* @param marginRight Page margin right (optional)
49117+
* @param marginTop Page margin top (optional)
4914849118
* @param dstFolder The destination document folder. (optional)
4914949119
* @param storage The document storage. (optional)
4915049120
* @param progressListener Progress listener
@@ -49225,36 +49195,6 @@ private com.squareup.okhttp.Call putMhtInStorageToPdfValidateBeforeCall(String n
4922549195
throw new ApiException("Missing the required parameter 'srcPath' when calling putMhtInStorageToPdf(Async)");
4922649196
}
4922749197

49228-
// verify the required parameter 'height' is set
49229-
if (height == null) {
49230-
throw new ApiException("Missing the required parameter 'height' when calling putMhtInStorageToPdf(Async)");
49231-
}
49232-
49233-
// verify the required parameter 'width' is set
49234-
if (width == null) {
49235-
throw new ApiException("Missing the required parameter 'width' when calling putMhtInStorageToPdf(Async)");
49236-
}
49237-
49238-
// verify the required parameter 'marginLeft' is set
49239-
if (marginLeft == null) {
49240-
throw new ApiException("Missing the required parameter 'marginLeft' when calling putMhtInStorageToPdf(Async)");
49241-
}
49242-
49243-
// verify the required parameter 'marginBottom' is set
49244-
if (marginBottom == null) {
49245-
throw new ApiException("Missing the required parameter 'marginBottom' when calling putMhtInStorageToPdf(Async)");
49246-
}
49247-
49248-
// verify the required parameter 'marginRight' is set
49249-
if (marginRight == null) {
49250-
throw new ApiException("Missing the required parameter 'marginRight' when calling putMhtInStorageToPdf(Async)");
49251-
}
49252-
49253-
// verify the required parameter 'marginTop' is set
49254-
if (marginTop == null) {
49255-
throw new ApiException("Missing the required parameter 'marginTop' when calling putMhtInStorageToPdf(Async)");
49256-
}
49257-
4925849198

4925949199
com.squareup.okhttp.Call call = putMhtInStorageToPdfCall(name, srcPath, height, width, marginLeft, marginBottom, marginRight, marginTop, dstFolder, storage, progressListener, progressRequestListener);
4926049200
return call;
@@ -49266,12 +49206,12 @@ private com.squareup.okhttp.Call putMhtInStorageToPdfValidateBeforeCall(String n
4926649206
*
4926749207
* @param name The document name. (required)
4926849208
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
49269-
* @param height Page height (required)
49270-
* @param width Page width (required)
49271-
* @param marginLeft Page margin left (required)
49272-
* @param marginBottom Page margin bottom (required)
49273-
* @param marginRight Page margin right (required)
49274-
* @param marginTop Page margin top (required)
49209+
* @param height Page height (optional)
49210+
* @param width Page width (optional)
49211+
* @param marginLeft Page margin left (optional)
49212+
* @param marginBottom Page margin bottom (optional)
49213+
* @param marginRight Page margin right (optional)
49214+
* @param marginTop Page margin top (optional)
4927549215
* @param dstFolder The destination document folder. (optional)
4927649216
* @param storage The document storage. (optional)
4927749217
* @return AsposeResponse
@@ -49300,12 +49240,12 @@ public AsposeResponse putMhtInStorageToPdf(String name, String srcPath, Double h
4930049240
*
4930149241
* @param name The document name. (required)
4930249242
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
49303-
* @param height Page height (required)
49304-
* @param width Page width (required)
49305-
* @param marginLeft Page margin left (required)
49306-
* @param marginBottom Page margin bottom (required)
49307-
* @param marginRight Page margin right (required)
49308-
* @param marginTop Page margin top (required)
49243+
* @param height Page height (optional)
49244+
* @param width Page width (optional)
49245+
* @param marginLeft Page margin left (optional)
49246+
* @param marginBottom Page margin bottom (optional)
49247+
* @param marginRight Page margin right (optional)
49248+
* @param marginTop Page margin top (optional)
4930949249
* @param dstFolder The destination document folder. (optional)
4931049250
* @param storage The document storage. (optional)
4931149251
* @return ApiResponse&lt;AsposeResponse&gt;
@@ -49322,12 +49262,12 @@ public ApiResponse<AsposeResponse> putMhtInStorageToPdfWithHttpInfo(String name,
4932249262
*
4932349263
* @param name The document name. (required)
4932449264
* @param srcPath Full source filename (ex. /folder1/folder2/template.mht) (required)
49325-
* @param height Page height (required)
49326-
* @param width Page width (required)
49327-
* @param marginLeft Page margin left (required)
49328-
* @param marginBottom Page margin bottom (required)
49329-
* @param marginRight Page margin right (required)
49330-
* @param marginTop Page margin top (required)
49265+
* @param height Page height (optional)
49266+
* @param width Page width (optional)
49267+
* @param marginLeft Page margin left (optional)
49268+
* @param marginBottom Page margin bottom (optional)
49269+
* @param marginRight Page margin right (optional)
49270+
* @param marginTop Page margin top (optional)
4933149271
* @param dstFolder The destination document folder. (optional)
4933249272
* @param storage The document storage. (optional)
4933349273
* @param callback The callback to be executed when the API call finishes

src/test/java/com/aspose/asposecloudpdf/api/ConvertToPdfTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void getMhtInStorageToPdfTest() throws ApiException
171171

172172
String srcPath = th.tempFolder + '/' + name;
173173

174-
File response = th.pdfApi.getMhtInStorageToPdf(srcPath, null);
174+
File response = th.pdfApi.getMhtInStorageToPdf(srcPath, null, null, null, null, null, null, null);
175175
assertNotNull(response);
176176
}
177177

@@ -192,7 +192,7 @@ public void putMhtInStorageToPdfTest() throws ApiException
192192
String srcPath = th.tempFolder + '/' + name;
193193
String resultName = "fromMht.pdf";
194194

195-
AsposeResponse response = th.pdfApi.putMhtInStorageToPdf(resultName, srcPath, th.tempFolder, null);
195+
AsposeResponse response = th.pdfApi.putMhtInStorageToPdf(resultName, srcPath, null, null, null, null, null, null, th.tempFolder, null);
196196
assertEquals(200, (int)response.getCode());
197197
}
198198

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
*
3+
* Copyright (c) 2025 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of TestHelper.getInstance() 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+
*/
21+
22+
package com.aspose.asposecloudpdf.api;
23+
24+
import com.aspose.asposecloudpdf.ApiException;
25+
import com.aspose.asposecloudpdf.model.*;
26+
27+
import org.junit.Test;
28+
29+
import static org.junit.Assert.assertEquals;
30+
31+
public class OrganizeTests {
32+
private TestHelper th;
33+
34+
public OrganizeTests() throws ApiException {
35+
th = TestHelper.getInstance();
36+
}
37+
38+
/**
39+
* PostComparePdf Test
40+
* @throws ApiException
41+
* if the Api call fails
42+
*/
43+
44+
@Test
45+
public void postComparePdfTest() throws ApiException
46+
{
47+
String name1 = "4pages.pdf";
48+
th.uploadFile(name1);
49+
String name2 = "4pagesPdfA.pdf";
50+
th.uploadFile(name2);
51+
String output = "output.pdf";
52+
53+
AsposeResponse response = th.pdfApi.postComparePdf(th.tempFolder + "/" + name1, th.tempFolder + "/" + name2, output, null);
54+
assertEquals(200, (int)response.getCode());
55+
}
56+
}

0 commit comments

Comments
 (0)