Skip to content

Commit 54df522

Browse files
author
Kirill Novinskiy
committed
Merge remote-tracking branch 'origin/release_25.9.0' into develop
2 parents b534f6f + 0b02ffa commit 54df522

File tree

7 files changed

+115
-9
lines changed

7 files changed

+115
-9
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,10 @@ 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.8
34-
- Implement document page resize functionality using the Pdf.Cloud API library.
33+
## Enhancements in Version 25.9
34+
- Implement PDF document page crop functionality using the Pdf.Cloud API library.
3535
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3636

37-
## Bugs fixed in Version 25.8
38-
- Implement delete watermark from PDF document using the Pdf.Cloud API library.
39-
4037
## Installation
4138

4239
### NPM

docs/PdfApi.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Method | HTTP request | Description
212212
*PdfApi* | [**postDocumentImageStamps**](PdfApi.md#postDocumentImageStamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
213213
*PdfApi* | [**postDocumentImageStampsPageSpecified**](PdfApi.md#postDocumentImageStampsPageSpecified) | **POST** /pdf/\{name}/stamps/image/pagespecified | Add document image stamps to specified pages.
214214
*PdfApi* | [**postDocumentPageNumberStamps**](PdfApi.md#postDocumentPageNumberStamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
215+
*PdfApi* | [**postDocumentPagesCrop**](PdfApi.md#postDocumentPagesCrop) | **POST** /pdf/\{name}/crop | Crop PDF document pages.
215216
*PdfApi* | [**postDocumentPagesResize**](PdfApi.md#postDocumentPagesResize) | **POST** /pdf/\{name}/resize | Rsize PDF document.
216217
*PdfApi* | [**postDocumentPagesRotate**](PdfApi.md#postDocumentPagesRotate) | **POST** /pdf/\{name}/rotate | Rotate PDF document.
217218
*PdfApi* | [**postDocumentTextFooter**](PdfApi.md#postDocumentTextFooter) | **POST** /pdf/\{name}/footer/text | Add document text footer.
@@ -5239,6 +5240,31 @@ Name | Type | Description | Notes
52395240

52405241
[**AsposeResponse**](AsposeResponse.md)
52415242

5243+
### HTTP request headers
5244+
5245+
- **Content-Type**: application/json
5246+
- **Accept**: application/json
5247+
5248+
<a name="postDocumentPagesCrop"></a>
5249+
## **postDocumentPagesCrop**
5250+
> postDocumentPagesCrop(name, pages, rect, storage, folder, password)
5251+
5252+
Crop PDF document pages.
5253+
5254+
### Parameters
5255+
Name | Type | Description | Notes
5256+
------------- | ------------- | ------------- | -------------
5257+
**name** | **string** | The document name. |
5258+
**pages** | **string** | Comma separated list of pages and page ranges. (Example: 1,3-5,8) |
5259+
**rect** | [**Rectangle**](Rectangle.md) | Rectangle of document area. |
5260+
**storage** | **string** | The document storage. | [optional]
5261+
**folder** | **string** | The document folder. | [optional]
5262+
**password** | **string** | Base64 encoded password. | [optional]
5263+
5264+
### Return type
5265+
5266+
[**AsposeResponse**](AsposeResponse.md)
5267+
52425268
### HTTP request headers
52435269

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

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asposepdfcloud",
3-
"version": "25.8.0",
3+
"version": "25.9.0",
44
"description": "Aspose.PDF Cloud is a REST API for creating and editing PDF files. 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. It can also be used to convert PDF files to different formats like DOC, HTML, XPS, TIFF and many more. Aspose.PDF Cloud gives you control: create PDFs from scratch or from HTML, XML, template, database, XPS or an image. Render PDFs to image formats such as JPEG, PNG, GIF, BMP, TIFF and many others. Aspose.PDF Cloud helps you manipulate elements of a PDF file like text, annotations, watermarks, signatures, bookmarks, stamps and so on. Its REST API also allows you to manage PDF pages by using features like merging, splitting, and inserting. Add images to a PDF file or convert PDF pages to images.",
55
"homepage": "https://products.aspose.cloud/pdf/cloud",
66
"author": {

src/api/api.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13006,6 +13006,80 @@ export class PdfApi {
1300613006
}
1300713007

1300813008

13009+
/**
13010+
*
13011+
* @summary Crop PDF document pages.
13012+
* @param name The document name.
13013+
* @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8)
13014+
* @param rect Rectangle of document area.
13015+
* @param storage The document storage.
13016+
* @param folder The document folder.
13017+
* @param password Base64 encoded password.
13018+
*/
13019+
public async postDocumentPagesCrop (name: string, pages: string, rect: Rectangle, storage?: string, folder?: string, password?: string) : Promise<{ response: http.IncomingMessage; body: AsposeResponse; }> {
13020+
const localVarPath = this.basePath + '/pdf/{name}/crop'
13021+
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'));
13022+
let localVarQueryParameters: any = {};
13023+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
13024+
let localVarFormParams: any = {};
13025+
13026+
// verify required parameter 'name' is not null or undefined
13027+
if (name === null || name === undefined) {
13028+
throw new Error('Required parameter name was null or undefined when calling postDocumentPagesCrop.');
13029+
}
13030+
13031+
// verify required parameter 'pages' is not null or undefined
13032+
if (pages === null || pages === undefined) {
13033+
throw new Error('Required parameter pages was null or undefined when calling postDocumentPagesCrop.');
13034+
}
13035+
13036+
// verify required parameter 'rect' is not null or undefined
13037+
if (rect === null || rect === undefined) {
13038+
throw new Error('Required parameter rect was null or undefined when calling postDocumentPagesCrop.');
13039+
}
13040+
13041+
if (pages !== undefined && null !== pages) {
13042+
localVarQueryParameters['pages'] = ObjectSerializer.serialize(pages, "string");
13043+
}
13044+
13045+
if (storage !== undefined && null !== storage) {
13046+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
13047+
}
13048+
13049+
if (folder !== undefined && null !== folder) {
13050+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
13051+
}
13052+
13053+
if (password !== undefined && null !== password) {
13054+
localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string");
13055+
}
13056+
13057+
13058+
let localVarUseFormData = false;
13059+
let fileData = null;
13060+
let localVarRequestOptions: localVarRequest.Options = {
13061+
method: 'POST',
13062+
qs: localVarQueryParameters,
13063+
headers: localVarHeaderParams,
13064+
uri: localVarPath,
13065+
useQuerystring: this._useQuerystring,
13066+
json: true,
13067+
body: ObjectSerializer.serialize(rect, "Rectangle")
13068+
};
13069+
13070+
if (Object.keys(localVarFormParams).length) {
13071+
if (localVarUseFormData) {
13072+
(<any>localVarRequestOptions).formData = localVarFormParams;
13073+
} else {
13074+
localVarRequestOptions.form = localVarFormParams;
13075+
}
13076+
}
13077+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
13078+
const result = ObjectSerializer.deserialize(response.body, "AsposeResponse");
13079+
return Promise.resolve({body: result, response});
13080+
}
13081+
13082+
1300913083
/**
1301013084
*
1301113085
* @summary Rsize PDF document.

src/requestHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async function invokeApiMethodInternal(requestOptions: request.Options, confgura
9595
//headers
9696
sa.set("User-Agent", "pdf nodejs sdk");
9797
sa.set("x-aspose-client", "nodejs sdk");
98-
sa.set("x-aspose-client-version", "25.8.0");
98+
sa.set("x-aspose-client-version", "25.9.0");
9999

100100
if (!requestOptions.headers) {
101101
requestOptions.headers = {};

test/testDocument.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,13 @@ describe("Document Tests", () => {
244244
assert.equal(result.response.statusCode, 200);
245245
});
246246
});
247+
248+
describe("PostDocumentPagesCrop Test", () => {
249+
it("should return response with code 200", async () => {
250+
const name = "4pages.pdf";
251+
await BaseTest.uploadFile(name);
252+
const result = await BaseTest.getPdfApi().postDocumentPagesCrop(name, "2-3", { lLX: 0, lLY: 0, uRX: 800, uRY: 400 },null, BaseTest.remoteTempFolder)
253+
assert.equal(result.response.statusCode, 200);
254+
});
255+
});
247256
});

0 commit comments

Comments
 (0)