Skip to content

Commit 7db83cb

Browse files
authored
Merge pull request #87 from aspose-pdf-cloud/develop
update to 25.6
2 parents 2f5770a + 79d88cf commit 7db83cb

File tree

8 files changed

+242
-12
lines changed

8 files changed

+242
-12
lines changed

README.md

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

33-
## Enhancements in Version 25.5
34-
- Add a method for comparing pdf files.
33+
## Enhancements in Version 25.6
34+
- Develop Rotate Document Pages method.
3535
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3636

3737
## Installation
@@ -56,7 +56,7 @@ Add this dependency to your project's POM:
5656
<dependency>
5757
<groupId>com.aspose</groupId>
5858
<artifactId>aspose-cloud-pdf</artifactId>
59-
<version>25.5.0</version>
59+
<version>25.6.0</version>
6060
<scope>compile</scope>
6161
</dependency>
6262
```
@@ -65,7 +65,7 @@ Add this dependency to your project's POM:
6565
Add this dependency to your project's build file:
6666

6767
```groovy
68-
compile "com.aspose:aspose-cloud-pdf:25.5.0"
68+
compile "com.aspose:aspose-cloud-pdf:25.6.0"
6969
```
7070

7171
### Others
@@ -75,7 +75,7 @@ At first generate the JAR by executing:
7575

7676
Then manually install the following JARs:
7777

78-
* target/aspose-cloud-pdf-25.5.0.jar
78+
* target/aspose-cloud-pdf-25.6.0.jar
7979
* target/lib/*.jar
8080

8181
## Getting Started

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ apply plugin: 'idea'
2020
apply plugin: 'eclipse'
2121

2222
group = 'com.aspose'
23-
version = '25.5.0'
23+
version = '25.6.0'
2424

2525
buildscript {
2626
repositories {

docs/PdfApi.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Method | HTTP request | Description
212212
[**postDocumentImageStamps**](PdfApi.md#postDocumentImageStamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
213213
[**postDocumentImageStampsPageSpecified**](PdfApi.md#postDocumentImageStampsPageSpecified) | **POST** /pdf/\{name}/stamps/image/pagespecified | Add document image stamps to specified pages.
214214
[**postDocumentPageNumberStamps**](PdfApi.md#postDocumentPageNumberStamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
215+
[**postDocumentPagesRotate**](PdfApi.md#postDocumentPagesRotate) | **POST** /pdf/\{name}/rotate | Rotate PDF document.
215216
[**postDocumentTextFooter**](PdfApi.md#postDocumentTextFooter) | **POST** /pdf/\{name}/footer/text | Add document text footer.
216217
[**postDocumentTextHeader**](PdfApi.md#postDocumentTextHeader) | **POST** /pdf/\{name}/header/text | Add document text header.
217218
[**postDocumentTextReplace**](PdfApi.md#postDocumentTextReplace) | **POST** /pdf/\{name}/text/replace | Document&#39;s replace text method.
@@ -5447,6 +5448,32 @@ Name | Type | Description | Notes
54475448

54485449
[**AsposeResponse**](AsposeResponse.md)
54495450

5451+
### HTTP request headers
5452+
5453+
- **Content-Type**: application/json
5454+
- **Accept**: application/json
5455+
5456+
<a name="postDocumentPagesRotate"></a>
5457+
# **postDocumentPagesRotate**
5458+
> AsposeResponse postDocumentPagesRotate(name, rotationAngle, pages, storage, folder, password)
5459+
5460+
Rotate PDF document.
5461+
5462+
### Parameters
5463+
5464+
Name | Type | Description | Notes
5465+
------------- | ------------- | ------------- | -------------
5466+
**name** | **String**| The document name. |
5467+
**rotationAngle** | **String**| Rotation Angle (CKW). Can be 90, 180, 270. | [enum: None, on90, on180, on270]
5468+
**pages** | **String**| Comma separated list of pages and page ranges. (Example: 1,3-5,8) |
5469+
**storage** | **String**| The document storage. | [optional]
5470+
**folder** | **String**| The document folder. | [optional]
5471+
**password** | **String**| Base64 encoded password. | [optional]
5472+
5473+
### Return type
5474+
5475+
[**AsposeResponse**](AsposeResponse.md)
5476+
54505477
### HTTP request headers
54515478

54525479
- **Content-Type**: application/json

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<artifactId>aspose-pdf-cloud</artifactId>
77
<packaging>jar</packaging>
88
<name>aspose-pdf-cloud</name>
9-
<version>25.5.0</version>
9+
<version>25.6.0</version>
1010
<url>https://www.aspose.cloud/</url>
1111
<description>Aspose.PDF Cloud is a REST API for creating and editing PDF files.
1212
Most popular features proposed by Aspose.PDF Cloud: PDF to Word, Convert PDF to Image, Merge PDF, Split PDF, Add Images to PDF, Rotate PDF.

src/main/java/com/aspose/asposecloudpdf/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public ApiClient() {
9494

9595
// Add custom headers
9696
addDefaultHeader("x-aspose-client", "java sdk");
97-
addDefaultHeader("x-aspose-client-version", "25.5.0");
97+
addDefaultHeader("x-aspose-client-version", "25.6.0");
9898

9999
// PDFCLOUD-418 Set default Connect Timeout
100100
setConnectTimeout(5 * 60 * 1000);

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

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33261,6 +33261,182 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
3326133261
apiClient.executeAsync(call, localVarReturnType, callback);
3326233262
return call;
3326333263
}
33264+
/**
33265+
* Build call for postDocumentPagesRotate
33266+
* @param name The document name. (required)
33267+
* @param rotationAngle Rotation Angle (CKW). Can be 90, 180, 270. (required)
33268+
* @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33269+
* @param storage The document storage. (optional)
33270+
* @param folder The document folder. (optional)
33271+
* @param password Base64 encoded password. (optional)
33272+
* @param progressListener Progress listener
33273+
* @param progressRequestListener Progress request listener
33274+
* @return Call to execute
33275+
* @throws ApiException If fail to serialize the request body object
33276+
*/
33277+
public com.squareup.okhttp.Call postDocumentPagesRotateCall(String name, String rotationAngle, String pages, String storage, String folder, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
33278+
Object localVarPostBody = null;
33279+
33280+
// create path and map variables
33281+
String localVarPath = "/pdf/{name}/rotate"
33282+
.replaceAll("\\{" + "name" + "\\}", apiClient.escapePathSegmentString(name.toString()));
33283+
33284+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
33285+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
33286+
if (rotationAngle != null)
33287+
localVarQueryParams.addAll(apiClient.parameterToPair("rotationAngle", rotationAngle));
33288+
if (pages != null)
33289+
localVarQueryParams.addAll(apiClient.parameterToPair("pages", pages));
33290+
if (storage != null)
33291+
localVarQueryParams.addAll(apiClient.parameterToPair("storage", storage));
33292+
if (folder != null)
33293+
localVarQueryParams.addAll(apiClient.parameterToPair("folder", folder));
33294+
if (password != null)
33295+
localVarQueryParams.addAll(apiClient.parameterToPair("password", password));
33296+
33297+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
33298+
33299+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
33300+
33301+
final String[] localVarAccepts = {
33302+
"application/json"
33303+
};
33304+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
33305+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
33306+
33307+
final String[] localVarContentTypes = {
33308+
"application/json"
33309+
};
33310+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
33311+
localVarHeaderParams.put("Content-Type", localVarContentType);
33312+
33313+
if(progressListener != null) {
33314+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
33315+
@Override
33316+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
33317+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
33318+
return originalResponse.newBuilder()
33319+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
33320+
.build();
33321+
}
33322+
});
33323+
}
33324+
33325+
String[] localVarAuthNames = new String[] { "JWT" };
33326+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
33327+
}
33328+
33329+
@SuppressWarnings("rawtypes")
33330+
private com.squareup.okhttp.Call postDocumentPagesRotateValidateBeforeCall(String name, String rotationAngle, String pages, String storage, String folder, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
33331+
33332+
// verify the required parameter 'name' is set
33333+
if (name == null) {
33334+
throw new ApiException("Missing the required parameter 'name' when calling postDocumentPagesRotate(Async)");
33335+
}
33336+
33337+
// verify the required parameter 'rotationAngle' is set
33338+
if (rotationAngle == null) {
33339+
throw new ApiException("Missing the required parameter 'rotationAngle' when calling postDocumentPagesRotate(Async)");
33340+
}
33341+
33342+
// verify the required parameter 'pages' is set
33343+
if (pages == null) {
33344+
throw new ApiException("Missing the required parameter 'pages' when calling postDocumentPagesRotate(Async)");
33345+
}
33346+
33347+
33348+
com.squareup.okhttp.Call call = postDocumentPagesRotateCall(name, rotationAngle, pages, storage, folder, password, progressListener, progressRequestListener);
33349+
return call;
33350+
33351+
}
33352+
33353+
/**
33354+
* Rotate PDF document.
33355+
*
33356+
* @param name The document name. (required)
33357+
* @param rotationAngle Rotation Angle (CKW). Can be 90, 180, 270. (required)
33358+
* @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33359+
* @param storage The document storage. (optional)
33360+
* @param folder The document folder. (optional)
33361+
* @param password Base64 encoded password. (optional)
33362+
* @return AsposeResponse
33363+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
33364+
*/
33365+
public AsposeResponse postDocumentPagesRotate(String name, String rotationAngle, String pages, String storage, String folder, String password) throws ApiException {
33366+
try
33367+
{
33368+
ApiResponse<AsposeResponse> resp = postDocumentPagesRotateWithHttpInfo(name, rotationAngle, pages, storage, folder, password);
33369+
return resp.getData();
33370+
}
33371+
catch (ApiException ex)
33372+
{
33373+
if (ex.getCode() == 401)
33374+
{
33375+
apiClient.requestToken();
33376+
ApiResponse<AsposeResponse> resp = postDocumentPagesRotateWithHttpInfo(name, rotationAngle, pages, storage, folder, password);
33377+
return resp.getData();
33378+
}
33379+
throw ex;
33380+
}
33381+
}
33382+
33383+
/**
33384+
* Rotate PDF document.
33385+
*
33386+
* @param name The document name. (required)
33387+
* @param rotationAngle Rotation Angle (CKW). Can be 90, 180, 270. (required)
33388+
* @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33389+
* @param storage The document storage. (optional)
33390+
* @param folder The document folder. (optional)
33391+
* @param password Base64 encoded password. (optional)
33392+
* @return ApiResponse&lt;AsposeResponse&gt;
33393+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
33394+
*/
33395+
public ApiResponse<AsposeResponse> postDocumentPagesRotateWithHttpInfo(String name, String rotationAngle, String pages, String storage, String folder, String password) throws ApiException {
33396+
com.squareup.okhttp.Call call = postDocumentPagesRotateValidateBeforeCall(name, rotationAngle, pages, storage, folder, password, null, null);
33397+
Type localVarReturnType = new TypeToken<AsposeResponse>(){}.getType();
33398+
return apiClient.execute(call, localVarReturnType);
33399+
}
33400+
33401+
/**
33402+
* Rotate PDF document. (asynchronously)
33403+
*
33404+
* @param name The document name. (required)
33405+
* @param rotationAngle Rotation Angle (CKW). Can be 90, 180, 270. (required)
33406+
* @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
33407+
* @param storage The document storage. (optional)
33408+
* @param folder The document folder. (optional)
33409+
* @param password Base64 encoded password. (optional)
33410+
* @param callback The callback to be executed when the API call finishes
33411+
* @return The request call
33412+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
33413+
*/
33414+
public com.squareup.okhttp.Call postDocumentPagesRotateAsync(String name, String rotationAngle, String pages, String storage, String folder, String password, final ApiCallback<AsposeResponse> callback) throws ApiException {
33415+
33416+
ProgressResponseBody.ProgressListener progressListener = null;
33417+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
33418+
33419+
if (callback != null) {
33420+
progressListener = new ProgressResponseBody.ProgressListener() {
33421+
@Override
33422+
public void update(long bytesRead, long contentLength, boolean done) {
33423+
callback.onDownloadProgress(bytesRead, contentLength, done);
33424+
}
33425+
};
33426+
33427+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
33428+
@Override
33429+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
33430+
callback.onUploadProgress(bytesWritten, contentLength, done);
33431+
}
33432+
};
33433+
}
33434+
33435+
com.squareup.okhttp.Call call = postDocumentPagesRotateValidateBeforeCall(name, rotationAngle, pages, storage, folder, password, progressListener, progressRequestListener);
33436+
Type localVarReturnType = new TypeToken<AsposeResponse>(){}.getType();
33437+
apiClient.executeAsync(call, localVarReturnType, callback);
33438+
return call;
33439+
}
3326433440
/**
3326533441
* Build call for postDocumentTextFooter
3326633442
* @param name The document name. (required)

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,22 @@ public void postOrganizeDocumentsTest() throws ApiException
300300
AsposeResponse response = TestHelper.pdfApi.postOrganizeDocuments(request, TestHelper.tempFolder + "/OrganizeMany.pdf", null);
301301
assertEquals(200, (int)response.getCode());
302302
}
303-
}
303+
304+
/**
305+
* PostDocumentPagesRotate Test
306+
* @throws ApiException
307+
* if the Api call fails
308+
*/
309+
310+
@Test
311+
public void postDocumentPagesRotateTest() throws ApiException
312+
{
313+
String name = "4pages.pdf";
314+
th.uploadFile(name);
315+
316+
String folder = th.tempFolder;
317+
318+
AsposeResponse response = th.pdfApi.postDocumentPagesRotate(name, Rotation.ON90.toString(), "2-3", null, folder, null);
319+
assertEquals(200, (int)response.getCode());
320+
}
321+
}

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,19 @@ public void putReplaceMultipleImageTest() throws ApiException
146146
String imageFileName = "butterfly.jpg";
147147
th.uploadFile(imageFileName);
148148
String folder = th.tempFolder;
149-
String imageFile = folder + '/' + imageFileName;
149+
String imageFile = folder + '/' + imageFileName;
150+
151+
ImagesResponse imagesResponse1 = th.pdfApi.getImages(name, 1, null, folder);
152+
assertEquals((int)imagesResponse1.getCode(), 200);
153+
String imageId1 = imagesResponse1.getImages().getList().get(0).getId();
154+
155+
ImagesResponse imagesResponse2 = th.pdfApi.getImages(name, 16, null, folder);
156+
assertEquals((int)imagesResponse2.getCode(), 200);
157+
String imageId2 = imagesResponse2.getImages().getList().get(0).getId();
158+
150159
ArrayList<String> imageIds = new ArrayList<String>();
151-
imageIds.add("GE5TENJVGQZTWMJYGQWDINRUFQ2DCMRMGY4TC");
152-
imageIds.add("GE5TIMJSGY3TWMJXG4WDIMBZFQ2DCOJMGQ3DK");
160+
imageIds.add(imageId1);
161+
imageIds.add(imageId2);
153162
ImagesResponse response = th.pdfApi.putReplaceMultipleImage(name, imageIds, imageFile, null, folder, null);
154163
assertEquals(200, (int)response.getCode());
155164
}

0 commit comments

Comments
 (0)