Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
## Read PDF Formats
MHT, PCL, PS, XSLFO, MD

## Enhancements in Version 24.3
## Enhancements in Version 24.4
- Convert PDF to optimized Text.
- Convert PDF to EXCEL without Cloud Storage.
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.

## Installation
Expand Down
48 changes: 48 additions & 0 deletions docs/PdfApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Method | HTTP request | Description
*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
*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
*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
*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
*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
*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
*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
Expand Down Expand Up @@ -243,6 +244,7 @@ Method | HTTP request | Description
*PdfApi* | [**postPageTextReplace**](PdfApi.md#postPageTextReplace) | **POST** /pdf/\{name}/pages/\{pageNumber}/text/replace | Page's replace text method.
*PdfApi* | [**postPageTextStamps**](PdfApi.md#postPageTextStamps) | **POST** /pdf/\{name}/pages/\{pageNumber}/stamps/text | Add document page text stamps.
*PdfApi* | [**postPageUnderlineAnnotations**](PdfApi.md#postPageUnderlineAnnotations) | **POST** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Add document page underline annotations.
*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.
*PdfApi* | [**postPopupAnnotation**](PdfApi.md#postPopupAnnotation) | **POST** /pdf/\{name}/annotations/\{annotationId}/popup | Add document popup annotations.
*PdfApi* | [**postRadioButtonFields**](PdfApi.md#postRadioButtonFields) | **POST** /pdf/\{name}/fields/radiobutton | Add document RadioButton fields.
*PdfApi* | [**postSignatureField**](PdfApi.md#postSignatureField) | **POST** /pdf/\{name}/fields/signature | Add document signature field.
Expand Down Expand Up @@ -3815,6 +3817,28 @@ Name | Type | Description | Notes

**Buffer**

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: multipart/form-data

<a name="getPdfInStorageToText"></a>
## **getPdfInStorageToText**
> getPdfInStorageToText(name, folder, storage)

Converts PDF document (located on storage) to Text format and returns resulting file in response content

### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **string** | The document name. |
**folder** | **string** | The document folder. | [optional]
**storage** | **string** | The document storage. | [optional]

### Return type

**Buffer**

### HTTP request headers

- **Content-Type**: application/json
Expand Down Expand Up @@ -5978,6 +6002,30 @@ Name | Type | Description | Notes
- **Content-Type**: application/json
- **Accept**: application/json

<a name="postPdfToXlsx"></a>
## **postPdfToXlsx**
> postPdfToXlsx(insertBlankColumnAtFirst, minimizeTheNumberOfWorksheets, uniformWorksheets, password, file)

Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.

### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**insertBlankColumnAtFirst** | **boolean** | Insert blank column at first | [optional]
**minimizeTheNumberOfWorksheets** | **boolean** | Minimize the number of worksheets | [optional]
**uniformWorksheets** | **boolean** | Uniform worksheets | [optional]
**password** | **string** | The password (Base64). | [optional]
**file** | **Buffer** | A file to be converted. | [optional]

### Return type

**Buffer**

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: multipart/form-data

<a name="postPopupAnnotation"></a>
## **postPopupAnnotation**
> postPopupAnnotation(name, annotationId, annotation, storage, folder)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asposepdfcloud",
"version": "24.3.0",
"version": "24.4.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": {
Expand Down
115 changes: 115 additions & 0 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9212,6 +9212,58 @@ export class PdfApi {
}


/**
*
* @summary Converts PDF document (located on storage) to Text format and returns resulting file in response content
* @param name The document name.
* @param folder The document folder.
* @param storage The document storage.
*/
public async getPdfInStorageToText (name: string, folder?: string, storage?: string) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/pdf/{name}/convert/text'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<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 getPdfInStorageToText.');
}

if (folder !== undefined && null !== folder) {
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
}

if (storage !== undefined && null !== storage) {
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
}


let localVarUseFormData = false;
let fileData = null;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};

if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
const result = ObjectSerializer.deserialize(response.body, "Buffer");
return Promise.resolve({body: result, response});
}


/**
*
* @summary Converts PDF document (located on storage) to TIFF format and returns resulting file in response content
Expand Down Expand Up @@ -15116,6 +15168,69 @@ export class PdfApi {
}


/**
*
* @summary Converts PDF document (in request content) to XLSX format and uploads and returns resulting file in response content.
* @param insertBlankColumnAtFirst Insert blank column at first
* @param minimizeTheNumberOfWorksheets Minimize the number of worksheets
* @param uniformWorksheets Uniform worksheets
* @param password The password (Base64).
* @param file A file to be converted.
*/
public async postPdfToXlsx (insertBlankColumnAtFirst?: boolean, minimizeTheNumberOfWorksheets?: boolean, uniformWorksheets?: boolean, password?: string, file?: Buffer) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/pdf/convert/xlsx';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
let localVarFormParams: any = {};

if (insertBlankColumnAtFirst !== undefined && null !== insertBlankColumnAtFirst) {
localVarQueryParameters['insertBlankColumnAtFirst'] = ObjectSerializer.serialize(insertBlankColumnAtFirst, "boolean");
}

if (minimizeTheNumberOfWorksheets !== undefined && null !== minimizeTheNumberOfWorksheets) {
localVarQueryParameters['minimizeTheNumberOfWorksheets'] = ObjectSerializer.serialize(minimizeTheNumberOfWorksheets, "boolean");
}

if (uniformWorksheets !== undefined && null !== uniformWorksheets) {
localVarQueryParameters['uniformWorksheets'] = ObjectSerializer.serialize(uniformWorksheets, "boolean");
}

if (password !== undefined && null !== password) {
localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string");
}


let localVarUseFormData = false;
let fileData = null;
if (file !== undefined) {
localVarFormParams['file'] = file;
fileData = file;
}
localVarUseFormData = true;


let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};

if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
const result = ObjectSerializer.deserialize(response.body, "Buffer");
return Promise.resolve({body: result, response});
}


/**
*
* @summary Add document popup annotations.
Expand Down
2 changes: 1 addition & 1 deletion src/requestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", "24.3.0");
sa.set("x-aspose-client-version", "24.4.0");

if (!requestOptions.headers) {
requestOptions.headers = {};
Expand Down
28 changes: 21 additions & 7 deletions test/testConvert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,7 @@ describe("Convert Tests", () => {
const outPath = BaseTest.remoteTempFolder + "/" + resFileName;

describe("GetPdfInStorageToXlsx Test", () => {

it("should return response with code 200", async () => {

return BaseTest.getPdfApi().getPdfInStorageToXlsx(simplePdf, null, null, null, null, BaseTest.remoteTempFolder)
.then((result) => {
assert.equal(result.response.statusCode, 200);
Expand All @@ -303,9 +301,7 @@ describe("Convert Tests", () => {
});

describe("PutPdfInStorageToXlsx Test", () => {

it("should return response with code 200", async () => {

return BaseTest.getPdfApi().putPdfInStorageToXlsx(simplePdf, outPath, null, null, null, null, BaseTest.remoteTempFolder)
.then((result) => {
assert.equal(result.response.statusCode, 200);
Expand All @@ -314,17 +310,24 @@ describe("Convert Tests", () => {
});

describe("PutPdfInRequestToXlsx Test", () => {

it("should return response with code 200", async () => {

var data = fs.readFileSync(BaseTest.localTestDataFolder + "/" + simplePdf);

return BaseTest.getPdfApi().putPdfInRequestToXlsx(outPath, null, null, null, null, null, null, data)
.then((result) => {
assert.equal(result.response.statusCode, 200);
});
});
});

describe("PostPdfToXlsx Test", () => {
it("should return response with code 200", async () => {
var data = fs.readFileSync(BaseTest.localTestDataFolder + "/" + simplePdf);
return BaseTest.getPdfApi().postPdfToXlsx(null, null, null, null, data)
.then((result) => {
assert.equal(result.response.statusCode, 200);
});
});
});
});

describe("To HTML Tests", () => {
Expand Down Expand Up @@ -648,4 +651,15 @@ describe("Convert Tests", () => {
});
});
});

describe("To Text Tests", () => {
describe("GetPdfInStorageToDoc Test", () => {
it("should return response with code 200", async () => {
return BaseTest.getPdfApi().getPdfInStorageToText(simplePdf, BaseTest.remoteTempFolder)
.then((result) => {
assert.equal(result.response.statusCode, 200);
});
});
});
});
});