Skip to content

Commit c32769f

Browse files
authored
Merge pull request #91 from aspose-pdf-cloud/develop
update to 24.4
2 parents 4f703f6 + 8f8242f commit c32769f

File tree

7 files changed

+191
-12
lines changed

7 files changed

+191
-12
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ 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 24.3
33+
## Enhancements in Version 24.4
34+
- Convert PDF to optimized Text.
35+
- Convert PDF to EXCEL without Cloud Storage.
3436
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3537

3638
## Installation

docs/PdfApi.md

+48
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Method | HTTP request | Description
153153
*PdfApi* | [**getPdfInStorageToPptx**](PdfApi.md#getPdfInStorageToPptx) | **GET** /pdf/\{name}/convert/pptx | Converts PDF document (located on storage) to PPTX format and returns resulting file in response content
154154
*PdfApi* | [**getPdfInStorageToSvg**](PdfApi.md#getPdfInStorageToSvg) | **GET** /pdf/\{name}/convert/svg | Converts PDF document (located on storage) to SVG format and returns resulting file in response content
155155
*PdfApi* | [**getPdfInStorageToTeX**](PdfApi.md#getPdfInStorageToTeX) | **GET** /pdf/\{name}/convert/tex | Converts PDF document (located on storage) to TeX format and returns resulting file in response content
156+
*PdfApi* | [**getPdfInStorageToText**](PdfApi.md#getPdfInStorageToText) | **GET** /pdf/\{name}/convert/text | Converts PDF document (located on storage) to Text format and returns resulting file in response content
156157
*PdfApi* | [**getPdfInStorageToTiff**](PdfApi.md#getPdfInStorageToTiff) | **GET** /pdf/\{name}/convert/tiff | Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
157158
*PdfApi* | [**getPdfInStorageToXls**](PdfApi.md#getPdfInStorageToXls) | **GET** /pdf/\{name}/convert/xls | Converts PDF document (located on storage) to XLS format and returns resulting file in response content
158159
*PdfApi* | [**getPdfInStorageToXlsx**](PdfApi.md#getPdfInStorageToXlsx) | **GET** /pdf/\{name}/convert/xlsx | Converts PDF document (located on storage) to XLSX format and returns resulting file in response content
@@ -243,6 +244,7 @@ Method | HTTP request | Description
243244
*PdfApi* | [**postPageTextReplace**](PdfApi.md#postPageTextReplace) | **POST** /pdf/\{name}/pages/\{pageNumber}/text/replace | Page's replace text method.
244245
*PdfApi* | [**postPageTextStamps**](PdfApi.md#postPageTextStamps) | **POST** /pdf/\{name}/pages/\{pageNumber}/stamps/text | Add document page text stamps.
245246
*PdfApi* | [**postPageUnderlineAnnotations**](PdfApi.md#postPageUnderlineAnnotations) | **POST** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Add document page underline annotations.
247+
*PdfApi* | [**postPdfToXlsx**](PdfApi.md#postPdfToXlsx) | **POST** /pdf/convert/xlsx | Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
246248
*PdfApi* | [**postPopupAnnotation**](PdfApi.md#postPopupAnnotation) | **POST** /pdf/\{name}/annotations/\{annotationId}/popup | Add document popup annotations.
247249
*PdfApi* | [**postRadioButtonFields**](PdfApi.md#postRadioButtonFields) | **POST** /pdf/\{name}/fields/radiobutton | Add document RadioButton fields.
248250
*PdfApi* | [**postSignatureField**](PdfApi.md#postSignatureField) | **POST** /pdf/\{name}/fields/signature | Add document signature field.
@@ -3815,6 +3817,28 @@ Name | Type | Description | Notes
38153817

38163818
**Buffer**
38173819

3820+
### HTTP request headers
3821+
3822+
- **Content-Type**: application/json
3823+
- **Accept**: multipart/form-data
3824+
3825+
<a name="getPdfInStorageToText"></a>
3826+
## **getPdfInStorageToText**
3827+
> getPdfInStorageToText(name, folder, storage)
3828+
3829+
Converts PDF document (located on storage) to Text format and returns resulting file in response content
3830+
3831+
### Parameters
3832+
Name | Type | Description | Notes
3833+
------------- | ------------- | ------------- | -------------
3834+
**name** | **string** | The document name. |
3835+
**folder** | **string** | The document folder. | [optional]
3836+
**storage** | **string** | The document storage. | [optional]
3837+
3838+
### Return type
3839+
3840+
**Buffer**
3841+
38183842
### HTTP request headers
38193843

38203844
- **Content-Type**: application/json
@@ -5978,6 +6002,30 @@ Name | Type | Description | Notes
59786002
- **Content-Type**: application/json
59796003
- **Accept**: application/json
59806004

6005+
<a name="postPdfToXlsx"></a>
6006+
## **postPdfToXlsx**
6007+
> postPdfToXlsx(insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, uniformWorksheets, password, file)
6008+
6009+
Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
6010+
6011+
### Parameters
6012+
Name | Type | Description | Notes
6013+
------------- | ------------- | ------------- | -------------
6014+
**insertBlankColumnAtFirst** | **boolean** | Insert blank column at first | [optional]
6015+
**minimizeTheNumberOfWorksheets** | **boolean** | Minimize the number of worksheets | [optional]
6016+
**uniformWorksheets** | **boolean** | Uniform worksheets | [optional]
6017+
**password** | **string** | The password (Base64). | [optional]
6018+
**file** | **Buffer** | A file to be converted. | [optional]
6019+
6020+
### Return type
6021+
6022+
**Buffer**
6023+
6024+
### HTTP request headers
6025+
6026+
- **Content-Type**: multipart/form-data
6027+
- **Accept**: multipart/form-data
6028+
59816029
<a name="postPopupAnnotation"></a>
59826030
## **postPopupAnnotation**
59836031
> postPopupAnnotation(name, annotationId, annotation, storage, folder)

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asposepdfcloud",
3-
"version": "24.3.0",
3+
"version": "24.4.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

+115
Original file line numberDiff line numberDiff line change
@@ -9212,6 +9212,58 @@ export class PdfApi {
92129212
}
92139213

92149214

9215+
/**
9216+
*
9217+
* @summary Converts PDF document (located on storage) to Text format and returns resulting file in response content
9218+
* @param name The document name.
9219+
* @param folder The document folder.
9220+
* @param storage The document storage.
9221+
*/
9222+
public async getPdfInStorageToText (name: string, folder?: string, storage?: string) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
9223+
const localVarPath = this.basePath + '/pdf/{name}/convert/text'
9224+
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'));
9225+
let localVarQueryParameters: any = {};
9226+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
9227+
let localVarFormParams: any = {};
9228+
9229+
// verify required parameter 'name' is not null or undefined
9230+
if (name === null || name === undefined) {
9231+
throw new Error('Required parameter name was null or undefined when calling getPdfInStorageToText.');
9232+
}
9233+
9234+
if (folder !== undefined && null !== folder) {
9235+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
9236+
}
9237+
9238+
if (storage !== undefined && null !== storage) {
9239+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
9240+
}
9241+
9242+
9243+
let localVarUseFormData = false;
9244+
let fileData = null;
9245+
let localVarRequestOptions: localVarRequest.Options = {
9246+
method: 'GET',
9247+
qs: localVarQueryParameters,
9248+
headers: localVarHeaderParams,
9249+
uri: localVarPath,
9250+
useQuerystring: this._useQuerystring,
9251+
encoding: null,
9252+
};
9253+
9254+
if (Object.keys(localVarFormParams).length) {
9255+
if (localVarUseFormData) {
9256+
(<any>localVarRequestOptions).formData = localVarFormParams;
9257+
} else {
9258+
localVarRequestOptions.form = localVarFormParams;
9259+
}
9260+
}
9261+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
9262+
const result = ObjectSerializer.deserialize(response.body, "Buffer");
9263+
return Promise.resolve({body: result, response});
9264+
}
9265+
9266+
92159267
/**
92169268
*
92179269
* @summary Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
@@ -15116,6 +15168,69 @@ export class PdfApi {
1511615168
}
1511715169

1511815170

15171+
/**
15172+
*
15173+
* @summary Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
15174+
* @param insertBlankColumnAtFirst Insert blank column at first
15175+
* @param minimizeTheNumberOfWorksheets Minimize the number of worksheets
15176+
* @param uniformWorksheets Uniform worksheets
15177+
* @param password The password (Base64).
15178+
* @param file A file to be converted.
15179+
*/
15180+
public async postPdfToXlsx (insertBlankColumnAtFirst?: boolean, minimizeTheNumberOfWorksheets?: boolean, uniformWorksheets?: boolean, password?: string, file?: Buffer) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
15181+
const localVarPath = this.basePath + '/pdf/convert/xlsx';
15182+
let localVarQueryParameters: any = {};
15183+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
15184+
let localVarFormParams: any = {};
15185+
15186+
if (insertBlankColumnAtFirst !== undefined && null !== insertBlankColumnAtFirst) {
15187+
localVarQueryParameters['insertBlankColumnAtFirst'] = ObjectSerializer.serialize(insertBlankColumnAtFirst, "boolean");
15188+
}
15189+
15190+
if (minimizeTheNumberOfWorksheets !== undefined && null !== minimizeTheNumberOfWorksheets) {
15191+
localVarQueryParameters['minimizeTheNumberOfWorksheets'] = ObjectSerializer.serialize(minimizeTheNumberOfWorksheets, "boolean");
15192+
}
15193+
15194+
if (uniformWorksheets !== undefined && null !== uniformWorksheets) {
15195+
localVarQueryParameters['uniformWorksheets'] = ObjectSerializer.serialize(uniformWorksheets, "boolean");
15196+
}
15197+
15198+
if (password !== undefined && null !== password) {
15199+
localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string");
15200+
}
15201+
15202+
15203+
let localVarUseFormData = false;
15204+
let fileData = null;
15205+
if (file !== undefined) {
15206+
localVarFormParams['file'] = file;
15207+
fileData = file;
15208+
}
15209+
localVarUseFormData = true;
15210+
15211+
15212+
let localVarRequestOptions: localVarRequest.Options = {
15213+
method: 'POST',
15214+
qs: localVarQueryParameters,
15215+
headers: localVarHeaderParams,
15216+
uri: localVarPath,
15217+
useQuerystring: this._useQuerystring,
15218+
encoding: null,
15219+
};
15220+
15221+
if (Object.keys(localVarFormParams).length) {
15222+
if (localVarUseFormData) {
15223+
(<any>localVarRequestOptions).formData = localVarFormParams;
15224+
} else {
15225+
localVarRequestOptions.form = localVarFormParams;
15226+
}
15227+
}
15228+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
15229+
const result = ObjectSerializer.deserialize(response.body, "Buffer");
15230+
return Promise.resolve({body: result, response});
15231+
}
15232+
15233+
1511915234
/**
1512015235
*
1512115236
* @summary Add document popup annotations.

src/requestHelper.ts

+1-1
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", "24.3.0");
98+
sa.set("x-aspose-client-version", "24.4.0");
9999

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

test/testConvert.ts

+21-7
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,7 @@ describe("Convert Tests", () => {
292292
const outPath = BaseTest.remoteTempFolder + "/" + resFileName;
293293

294294
describe("GetPdfInStorageToXlsx Test", () => {
295-
296295
it("should return response with code 200", async () => {
297-
298296
return BaseTest.getPdfApi().getPdfInStorageToXlsx(simplePdf, null, null, null, null, BaseTest.remoteTempFolder)
299297
.then((result) => {
300298
assert.equal(result.response.statusCode, 200);
@@ -303,9 +301,7 @@ describe("Convert Tests", () => {
303301
});
304302

305303
describe("PutPdfInStorageToXlsx Test", () => {
306-
307304
it("should return response with code 200", async () => {
308-
309305
return BaseTest.getPdfApi().putPdfInStorageToXlsx(simplePdf, outPath, null, null, null, null, BaseTest.remoteTempFolder)
310306
.then((result) => {
311307
assert.equal(result.response.statusCode, 200);
@@ -314,17 +310,24 @@ describe("Convert Tests", () => {
314310
});
315311

316312
describe("PutPdfInRequestToXlsx Test", () => {
317-
318313
it("should return response with code 200", async () => {
319-
320314
var data = fs.readFileSync(BaseTest.localTestDataFolder + "/" + simplePdf);
321-
322315
return BaseTest.getPdfApi().putPdfInRequestToXlsx(outPath, null, null, null, null, null, null, data)
323316
.then((result) => {
324317
assert.equal(result.response.statusCode, 200);
325318
});
326319
});
327320
});
321+
322+
describe("PostPdfToXlsx Test", () => {
323+
it("should return response with code 200", async () => {
324+
var data = fs.readFileSync(BaseTest.localTestDataFolder + "/" + simplePdf);
325+
return BaseTest.getPdfApi().postPdfToXlsx(null, null, null, null, data)
326+
.then((result) => {
327+
assert.equal(result.response.statusCode, 200);
328+
});
329+
});
330+
});
328331
});
329332

330333
describe("To HTML Tests", () => {
@@ -648,4 +651,15 @@ describe("Convert Tests", () => {
648651
});
649652
});
650653
});
654+
655+
describe("To Text Tests", () => {
656+
describe("GetPdfInStorageToDoc Test", () => {
657+
it("should return response with code 200", async () => {
658+
return BaseTest.getPdfApi().getPdfInStorageToText(simplePdf, BaseTest.remoteTempFolder)
659+
.then((result) => {
660+
assert.equal(result.response.statusCode, 200);
661+
});
662+
});
663+
});
664+
});
651665
});

0 commit comments

Comments
 (0)