From 2bdb0f9f51cd924d6c0ce226af501b41748cd6b8 Mon Sep 17 00:00:00 2001 From: Kirill Novinskiy Date: Thu, 21 Aug 2025 12:22:13 +0000 Subject: [PATCH] update to 25.8.0 --- README.md | 8 ++-- docs/PdfApi.md | 27 ++++++++++++++ package-lock.json | 4 +- package.json | 2 +- src/api/api.ts | 87 ++++++++++++++++++++++++++++++++++++++++++++ src/requestHelper.ts | 2 +- test/testDocument.ts | 9 +++++ 7 files changed, 131 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0fb0db98..3e920a4b 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,12 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text ## Read PDF Formats MHT, PCL, PS, XSLFO, MD -## Enhancements in Version 25.7 -- Add possibility to hide subject field in signature appearance. +## Enhancements in Version 25.8 +- Implement document page resize functionality using the Pdf.Cloud API library. - A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET. -## Bugs fixed in Version 25.7 -- PostDeleteStamps removing stamps from PDF page is incorrect. +## Bugs fixed in Version 25.8 +- Implement delete watermark from PDF document using the Pdf.Cloud API library. ## Installation diff --git a/docs/PdfApi.md b/docs/PdfApi.md index 2b68b3a1..177d6373 100644 --- a/docs/PdfApi.md +++ b/docs/PdfApi.md @@ -212,6 +212,7 @@ Method | HTTP request | Description *PdfApi* | [**postDocumentImageStamps**](PdfApi.md#postDocumentImageStamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps. *PdfApi* | [**postDocumentImageStampsPageSpecified**](PdfApi.md#postDocumentImageStampsPageSpecified) | **POST** /pdf/\{name}/stamps/image/pagespecified | Add document image stamps to specified pages. *PdfApi* | [**postDocumentPageNumberStamps**](PdfApi.md#postDocumentPageNumberStamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps. +*PdfApi* | [**postDocumentPagesResize**](PdfApi.md#postDocumentPagesResize) | **POST** /pdf/\{name}/resize | Rsize PDF document. *PdfApi* | [**postDocumentPagesRotate**](PdfApi.md#postDocumentPagesRotate) | **POST** /pdf/\{name}/rotate | Rotate PDF document. *PdfApi* | [**postDocumentTextFooter**](PdfApi.md#postDocumentTextFooter) | **POST** /pdf/\{name}/footer/text | Add document text footer. *PdfApi* | [**postDocumentTextHeader**](PdfApi.md#postDocumentTextHeader) | **POST** /pdf/\{name}/header/text | Add document text header. @@ -5238,6 +5239,32 @@ Name | Type | Description | Notes [**AsposeResponse**](AsposeResponse.md) +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +## **postDocumentPagesResize** +> postDocumentPagesResize(name, height, width, pages, storage, folder, password) + +Rsize PDF document. + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**name** | **string** | The document name. | +**height** | **number** | Page Height | +**width** | **number** | Page width | +**pages** | **string** | Comma separated list of pages and page ranges. (Example: 1,3-5,8) | +**storage** | **string** | The document storage. | [optional] +**folder** | **string** | The document folder. | [optional] +**password** | **string** | Base64 encoded password. | [optional] + +### Return type + +[**AsposeResponse**](AsposeResponse.md) + ### HTTP request headers - **Content-Type**: application/json diff --git a/package-lock.json b/package-lock.json index 3b444d87..17229a76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "asposepdfcloud", - "version": "25.7.0", + "version": "25.8.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "asposepdfcloud", - "version": "25.7.0", + "version": "25.8.0", "license": "MIT", "dependencies": { "@types/bluebird": "*", diff --git a/package.json b/package.json index 8fca2e2a..5fa43b7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "asposepdfcloud", - "version": "25.7.0", + "version": "25.8.0", "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.", "homepage": "https://products.aspose.cloud/pdf/cloud", "author": { diff --git a/src/api/api.ts b/src/api/api.ts index 948f40c6..201110ab 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -13006,6 +13006,93 @@ export class PdfApi { } + /** + * + * @summary Rsize PDF document. + * @param name The document name. + * @param height Page Height + * @param width Page width + * @param pages Comma separated list of pages and page ranges. (Example: 1,3-5,8) + * @param storage The document storage. + * @param folder The document folder. + * @param password Base64 encoded password. + */ + public async postDocumentPagesResize (name: string, height: number, width: number, pages: string, storage?: string, folder?: string, password?: string) : Promise<{ response: http.IncomingMessage; body: AsposeResponse; }> { + const localVarPath = this.basePath + '/pdf/{name}/resize' + .replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/')); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'name' is not null or undefined + if (name === null || name === undefined) { + throw new Error('Required parameter name was null or undefined when calling postDocumentPagesResize.'); + } + + // verify required parameter 'height' is not null or undefined + if (height === null || height === undefined) { + throw new Error('Required parameter height was null or undefined when calling postDocumentPagesResize.'); + } + + // verify required parameter 'width' is not null or undefined + if (width === null || width === undefined) { + throw new Error('Required parameter width was null or undefined when calling postDocumentPagesResize.'); + } + + // verify required parameter 'pages' is not null or undefined + if (pages === null || pages === undefined) { + throw new Error('Required parameter pages was null or undefined when calling postDocumentPagesResize.'); + } + + if (height !== undefined && null !== height) { + localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number"); + } + + if (width !== undefined && null !== width) { + localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number"); + } + + if (pages !== undefined && null !== pages) { + localVarQueryParameters['pages'] = ObjectSerializer.serialize(pages, "string"); + } + + if (storage !== undefined && null !== storage) { + localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string"); + } + + if (folder !== undefined && null !== folder) { + localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string"); + } + + if (password !== undefined && null !== password) { + localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string"); + } + + + let localVarUseFormData = false; + let fileData = null; + let localVarRequestOptions: localVarRequest.Options = { + method: 'POST', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData); + const result = ObjectSerializer.deserialize(response.body, "AsposeResponse"); + return Promise.resolve({body: result, response}); + } + + /** * * @summary Rotate PDF document. diff --git a/src/requestHelper.ts b/src/requestHelper.ts index fb60afdb..d1d180aa 100644 --- a/src/requestHelper.ts +++ b/src/requestHelper.ts @@ -95,7 +95,7 @@ async function invokeApiMethodInternal(requestOptions: request.Options, confgura //headers sa.set("User-Agent", "pdf nodejs sdk"); sa.set("x-aspose-client", "nodejs sdk"); - sa.set("x-aspose-client-version", "25.7.0"); + sa.set("x-aspose-client-version", "25.8.0"); if (!requestOptions.headers) { requestOptions.headers = {}; diff --git a/test/testDocument.ts b/test/testDocument.ts index 03863434..edfd1094 100644 --- a/test/testDocument.ts +++ b/test/testDocument.ts @@ -235,4 +235,13 @@ describe("Document Tests", () => { assert.equal(result.response.statusCode, 200); }); }); + + describe("PostDocumentPagesResize Test", () => { + it("should return response with code 200", async () => { + const name = "4pages.pdf"; + await BaseTest.uploadFile(name); + const result = await BaseTest.getPdfApi().postDocumentPagesResize(name, 100, 200, "2-3", null, BaseTest.remoteTempFolder) + assert.equal(result.response.statusCode, 200); + }); + }); });