Skip to content

Commit 0174448

Browse files
committed
Update to v20.2
1 parent 4d2ce97 commit 0174448

File tree

7 files changed

+210
-6
lines changed

7 files changed

+210
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Class | Method | HTTP request | Description
199199
*PdfApi* | [**getPageTextBoxFields**](docs/PdfApi.md#getPageTextBoxFields) | **GET** /pdf/\{name}/page/\{pageNumber}/fields/textbox | Read document page text box fields.
200200
*PdfApi* | [**getPageUnderlineAnnotations**](docs/PdfApi.md#getPageUnderlineAnnotations) | **GET** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Read document page underline annotations.
201201
*PdfApi* | [**getPclInStorageToPdf**](docs/PdfApi.md#getPclInStorageToPdf) | **GET** /pdf/create/pcl | Convert PCL file (located on storage) to PDF format and return resulting file in response.
202+
*PdfApi* | [**getPdfAInStorageToPdf**](docs/PdfApi.md#getPdfAInStorageToPdf) | **GET** /pdf/create/pdfa | Convert PDFA file (located on storage) to PDF format and return resulting file in response.
202203
*PdfApi* | [**getPdfInStorageToDoc**](docs/PdfApi.md#getPdfInStorageToDoc) | **GET** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and returns resulting file in response content
203204
*PdfApi* | [**getPdfInStorageToEpub**](docs/PdfApi.md#getPdfInStorageToEpub) | **GET** /pdf/\{name}/convert/epub | Converts PDF document (located on storage) to EPUB format and returns resulting file in response content
204205
*PdfApi* | [**getPdfInStorageToHtml**](docs/PdfApi.md#getPdfInStorageToHtml) | **GET** /pdf/\{name}/convert/html | Converts PDF document (located on storage) to Html format and returns resulting file in response content
@@ -352,6 +353,7 @@ Class | Method | HTTP request | Description
352353
*PdfApi* | [**putPageConvertToPng**](docs/PdfApi.md#putPageConvertToPng) | **PUT** /pdf/\{name}/pages/\{pageNumber}/convert/png | Convert document page to png image and upload resulting file to storage.
353354
*PdfApi* | [**putPageConvertToTiff**](docs/PdfApi.md#putPageConvertToTiff) | **PUT** /pdf/\{name}/pages/\{pageNumber}/convert/tiff | Convert document page to Tiff image and upload resulting file to storage.
354355
*PdfApi* | [**putPclInStorageToPdf**](docs/PdfApi.md#putPclInStorageToPdf) | **PUT** /pdf/\{name}/create/pcl | Convert PCL file (located on storage) to PDF format and upload resulting file to storage.
356+
*PdfApi* | [**putPdfAInStorageToPdf**](docs/PdfApi.md#putPdfAInStorageToPdf) | **PUT** /pdf/\{name}/create/pdfa | Convert PDFA file (located on storage) to PDF format and upload resulting file to storage.
355357
*PdfApi* | [**putPdfInRequestToDoc**](docs/PdfApi.md#putPdfInRequestToDoc) | **PUT** /pdf/convert/doc | Converts PDF document (in request content) to DOC format and uploads resulting file to storage.
356358
*PdfApi* | [**putPdfInRequestToEpub**](docs/PdfApi.md#putPdfInRequestToEpub) | **PUT** /pdf/convert/epub | Converts PDF document (in request content) to EPUB format and uploads resulting file to storage.
357359
*PdfApi* | [**putPdfInRequestToHtml**](docs/PdfApi.md#putPdfInRequestToHtml) | **PUT** /pdf/convert/html | Converts PDF document (in request content) to Html format and uploads resulting file to storage.

docs/PdfApi.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ Method | HTTP request | Description
145145
*PdfApi* | [**getPageTextBoxFields**](PdfApi.md#getPageTextBoxFields) | **GET** /pdf/\{name}/page/\{pageNumber}/fields/textbox | Read document page text box fields.
146146
*PdfApi* | [**getPageUnderlineAnnotations**](PdfApi.md#getPageUnderlineAnnotations) | **GET** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Read document page underline annotations.
147147
*PdfApi* | [**getPclInStorageToPdf**](PdfApi.md#getPclInStorageToPdf) | **GET** /pdf/create/pcl | Convert PCL file (located on storage) to PDF format and return resulting file in response.
148+
*PdfApi* | [**getPdfAInStorageToPdf**](PdfApi.md#getPdfAInStorageToPdf) | **GET** /pdf/create/pdfa | Convert PDFA file (located on storage) to PDF format and return resulting file in response.
148149
*PdfApi* | [**getPdfInStorageToDoc**](PdfApi.md#getPdfInStorageToDoc) | **GET** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and returns resulting file in response content
149150
*PdfApi* | [**getPdfInStorageToEpub**](PdfApi.md#getPdfInStorageToEpub) | **GET** /pdf/\{name}/convert/epub | Converts PDF document (located on storage) to EPUB format and returns resulting file in response content
150151
*PdfApi* | [**getPdfInStorageToHtml**](PdfApi.md#getPdfInStorageToHtml) | **GET** /pdf/\{name}/convert/html | Converts PDF document (located on storage) to Html format and returns resulting file in response content
@@ -298,6 +299,7 @@ Method | HTTP request | Description
298299
*PdfApi* | [**putPageConvertToPng**](PdfApi.md#putPageConvertToPng) | **PUT** /pdf/\{name}/pages/\{pageNumber}/convert/png | Convert document page to png image and upload resulting file to storage.
299300
*PdfApi* | [**putPageConvertToTiff**](PdfApi.md#putPageConvertToTiff) | **PUT** /pdf/\{name}/pages/\{pageNumber}/convert/tiff | Convert document page to Tiff image and upload resulting file to storage.
300301
*PdfApi* | [**putPclInStorageToPdf**](PdfApi.md#putPclInStorageToPdf) | **PUT** /pdf/\{name}/create/pcl | Convert PCL file (located on storage) to PDF format and upload resulting file to storage.
302+
*PdfApi* | [**putPdfAInStorageToPdf**](PdfApi.md#putPdfAInStorageToPdf) | **PUT** /pdf/\{name}/create/pdfa | Convert PDFA file (located on storage) to PDF format and upload resulting file to storage.
301303
*PdfApi* | [**putPdfInRequestToDoc**](PdfApi.md#putPdfInRequestToDoc) | **PUT** /pdf/convert/doc | Converts PDF document (in request content) to DOC format and uploads resulting file to storage.
302304
*PdfApi* | [**putPdfInRequestToEpub**](PdfApi.md#putPdfInRequestToEpub) | **PUT** /pdf/convert/epub | Converts PDF document (in request content) to EPUB format and uploads resulting file to storage.
303305
*PdfApi* | [**putPdfInRequestToHtml**](PdfApi.md#putPdfInRequestToHtml) | **PUT** /pdf/convert/html | Converts PDF document (in request content) to Html format and uploads resulting file to storage.
@@ -3565,6 +3567,28 @@ Name | Type | Description | Notes
35653567

35663568
**Buffer**
35673569

3570+
### HTTP request headers
3571+
3572+
- **Content-Type**: application/json
3573+
- **Accept**: multipart/form-data
3574+
3575+
<a name="getPdfAInStorageToPdf"></a>
3576+
## **getPdfAInStorageToPdf**
3577+
> getPdfAInStorageToPdf(srcPath, dontOptimize, storage)
3578+
3579+
Convert PDFA file (located on storage) to PDF format and return resulting file in response.
3580+
3581+
### Parameters
3582+
Name | Type | Description | Notes
3583+
------------- | ------------- | ------------- | -------------
3584+
**srcPath** | **string** | Full source filename (ex. /folder1/folder2/template.pdf) |
3585+
**dontOptimize** | **boolean** | If set, document resources will not be optimized. | [optional]
3586+
**storage** | **string** | The document storage. | [optional]
3587+
3588+
### Return type
3589+
3590+
**Buffer**
3591+
35683592
### HTTP request headers
35693593

35703594
- **Content-Type**: application/json
@@ -4701,7 +4725,7 @@ Add document bookmarks.
47014725
Name | Type | Description | Notes
47024726
------------- | ------------- | ------------- | -------------
47034727
**name** | **string** | The document name. |
4704-
**bookmarkPath** | **string** | The bookmark path. |
4728+
**bookmarkPath** | **string** | The parent bookmark path. Specify an empty string when adding a bookmark to the root. |
47054729
**bookmarks** | [**Array&lt;Bookmark&gt;**](Bookmark.md) | The array of bookmark. |
47064730
**folder** | **string** | The document folder. | [optional]
47074731
**storage** | **string** | The document storage. | [optional]
@@ -7276,6 +7300,30 @@ Name | Type | Description | Notes
72767300

72777301
[**AsposeResponse**](AsposeResponse.md)
72787302

7303+
### HTTP request headers
7304+
7305+
- **Content-Type**: application/json
7306+
- **Accept**: application/json
7307+
7308+
<a name="putPdfAInStorageToPdf"></a>
7309+
## **putPdfAInStorageToPdf**
7310+
> putPdfAInStorageToPdf(name, srcPath, dstFolder, dontOptimize, storage)
7311+
7312+
Convert PDFA file (located on storage) to PDF format and upload resulting file to storage.
7313+
7314+
### Parameters
7315+
Name | Type | Description | Notes
7316+
------------- | ------------- | ------------- | -------------
7317+
**name** | **string** | The document name. |
7318+
**srcPath** | **string** | Full source filename (ex. /folder1/folder2/template.pdf) |
7319+
**dstFolder** | **string** | The destination document folder. | [optional]
7320+
**dontOptimize** | **boolean** | If set, document resources will not be optimized. | [optional]
7321+
**storage** | **string** | The document storage. | [optional]
7322+
7323+
### Return type
7324+
7325+
[**AsposeResponse**](AsposeResponse.md)
7326+
72797327
### HTTP request headers
72807328

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

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asposepdfcloud",
3-
"version": "20.1.0",
3+
"version": "20.2.0",
44
"description": "Aspose.PDF Cloud SDK",
55
"homepage": "https://products.aspose.cloud/pdf/cloud",
66
"author": {
@@ -25,7 +25,7 @@
2525
"scripts": {
2626
"clean": "rm -Rf node_modules/ typings/ *.js",
2727
"build": "tsc",
28-
"test": "mocha -r ts-node/register test/test*.ts --timeout 600000"
28+
"test": "mocha -r ts-node/register test/_test*.ts --timeout 600000"
2929
},
3030
"dependencies": {
3131
"@types/bluebird": "*",

src/api/api.ts

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8441,6 +8441,61 @@ export class PdfApi {
84418441
}
84428442

84438443

8444+
/**
8445+
*
8446+
* @summary Convert PDFA file (located on storage) to PDF format and return resulting file in response.
8447+
* @param srcPath Full source filename (ex. /folder1/folder2/template.pdf)
8448+
* @param dontOptimize If set, document resources will not be optimized.
8449+
* @param storage The document storage.
8450+
*/
8451+
public async getPdfAInStorageToPdf (srcPath: string, dontOptimize?: boolean, storage?: string) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
8452+
const localVarPath = this.basePath + '/pdf/create/pdfa';
8453+
let localVarQueryParameters: any = {};
8454+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
8455+
let localVarFormParams: any = {};
8456+
8457+
// verify required parameter 'srcPath' is not null or undefined
8458+
if (srcPath === null || srcPath === undefined) {
8459+
throw new Error('Required parameter srcPath was null or undefined when calling getPdfAInStorageToPdf.');
8460+
}
8461+
8462+
if (srcPath !== undefined && null !== srcPath) {
8463+
localVarQueryParameters['srcPath'] = ObjectSerializer.serialize(srcPath, "string");
8464+
}
8465+
8466+
if (dontOptimize !== undefined && null !== dontOptimize) {
8467+
localVarQueryParameters['dontOptimize'] = ObjectSerializer.serialize(dontOptimize, "boolean");
8468+
}
8469+
8470+
if (storage !== undefined && null !== storage) {
8471+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
8472+
}
8473+
8474+
8475+
let localVarUseFormData = false;
8476+
let fileData = null;
8477+
let localVarRequestOptions: localVarRequest.Options = {
8478+
method: 'GET',
8479+
qs: localVarQueryParameters,
8480+
headers: localVarHeaderParams,
8481+
uri: localVarPath,
8482+
useQuerystring: this._useQuerystring,
8483+
encoding: null,
8484+
};
8485+
8486+
if (Object.keys(localVarFormParams).length) {
8487+
if (localVarUseFormData) {
8488+
(<any>localVarRequestOptions).formData = localVarFormParams;
8489+
} else {
8490+
localVarRequestOptions.form = localVarFormParams;
8491+
}
8492+
}
8493+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
8494+
const result = ObjectSerializer.deserialize(response.body, "Buffer");
8495+
return Promise.resolve({body: result, response});
8496+
}
8497+
8498+
84448499
/**
84458500
*
84468501
* @summary Converts PDF document (located on storage) to DOC format and returns resulting file in response content
@@ -11483,7 +11538,7 @@ export class PdfApi {
1148311538
*
1148411539
* @summary Add document bookmarks.
1148511540
* @param name The document name.
11486-
* @param bookmarkPath The bookmark path.
11541+
* @param bookmarkPath The parent bookmark path. Specify an empty string when adding a bookmark to the root.
1148711542
* @param bookmarks The array of bookmark.
1148811543
* @param folder The document folder.
1148911544
* @param storage The document storage.
@@ -18696,6 +18751,73 @@ export class PdfApi {
1869618751
}
1869718752

1869818753

18754+
/**
18755+
*
18756+
* @summary Convert PDFA file (located on storage) to PDF format and upload resulting file to storage.
18757+
* @param name The document name.
18758+
* @param srcPath Full source filename (ex. /folder1/folder2/template.pdf)
18759+
* @param dstFolder The destination document folder.
18760+
* @param dontOptimize If set, document resources will not be optimized.
18761+
* @param storage The document storage.
18762+
*/
18763+
public async putPdfAInStorageToPdf (name: string, srcPath: string, dstFolder?: string, dontOptimize?: boolean, storage?: string) : Promise<{ response: http.IncomingMessage; body: AsposeResponse; }> {
18764+
const localVarPath = this.basePath + '/pdf/{name}/create/pdfa'
18765+
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'));
18766+
let localVarQueryParameters: any = {};
18767+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
18768+
let localVarFormParams: any = {};
18769+
18770+
// verify required parameter 'name' is not null or undefined
18771+
if (name === null || name === undefined) {
18772+
throw new Error('Required parameter name was null or undefined when calling putPdfAInStorageToPdf.');
18773+
}
18774+
18775+
// verify required parameter 'srcPath' is not null or undefined
18776+
if (srcPath === null || srcPath === undefined) {
18777+
throw new Error('Required parameter srcPath was null or undefined when calling putPdfAInStorageToPdf.');
18778+
}
18779+
18780+
if (srcPath !== undefined && null !== srcPath) {
18781+
localVarQueryParameters['srcPath'] = ObjectSerializer.serialize(srcPath, "string");
18782+
}
18783+
18784+
if (dstFolder !== undefined && null !== dstFolder) {
18785+
localVarQueryParameters['dstFolder'] = ObjectSerializer.serialize(dstFolder, "string");
18786+
}
18787+
18788+
if (dontOptimize !== undefined && null !== dontOptimize) {
18789+
localVarQueryParameters['dontOptimize'] = ObjectSerializer.serialize(dontOptimize, "boolean");
18790+
}
18791+
18792+
if (storage !== undefined && null !== storage) {
18793+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
18794+
}
18795+
18796+
18797+
let localVarUseFormData = false;
18798+
let fileData = null;
18799+
let localVarRequestOptions: localVarRequest.Options = {
18800+
method: 'PUT',
18801+
qs: localVarQueryParameters,
18802+
headers: localVarHeaderParams,
18803+
uri: localVarPath,
18804+
useQuerystring: this._useQuerystring,
18805+
json: true,
18806+
};
18807+
18808+
if (Object.keys(localVarFormParams).length) {
18809+
if (localVarUseFormData) {
18810+
(<any>localVarRequestOptions).formData = localVarFormParams;
18811+
} else {
18812+
localVarRequestOptions.form = localVarFormParams;
18813+
}
18814+
}
18815+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
18816+
const result = ObjectSerializer.deserialize(response.body, "AsposeResponse");
18817+
return Promise.resolve({body: result, response});
18818+
}
18819+
18820+
1869918821
/**
1870018822
*
1870118823
* @summary Converts PDF document (in request content) to DOC format and uploads resulting file to storage.

test/testConvertToPdf.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { ImageSrcType } from "../src/models/imageSrcType";
2727
var assert = require('assert');
2828

2929
describe("Convert To PDF Tests", () => {
30-
3130
describe("EPUB To PDF Tests", () => {
3231

3332
const name = "4pages.epub";
@@ -459,4 +458,37 @@ describe("Convert To PDF Tests", () => {
459458
});
460459
});
461460
});
461+
462+
describe("PDFA To PDF Tests", () => {
463+
464+
const name = "4pagesPdfA.pdf";
465+
const resFileName = "fromPdfA.pdf";
466+
const srcPath = BaseTest.remoteTempFolder + "/" + name;
467+
468+
before( async ()=> {
469+
await BaseTest.uploadFile(name);
470+
});
471+
472+
describe("GetPdfAInStorageToPdf Test", () => {
473+
474+
it("should return response with code 200", async () => {
475+
476+
return BaseTest.getPdfApi().getPdfAInStorageToPdf(srcPath)
477+
.then((result) => {
478+
assert.equal(result.response.statusCode, 200);
479+
});
480+
});
481+
});
482+
483+
describe("PutPdfAInStorageToPdf Test", () => {
484+
485+
it("should return response with code 200", async () => {
486+
487+
return BaseTest.getPdfApi().putPdfAInStorageToPdf(resFileName, srcPath, BaseTest.remoteTempFolder)
488+
.then((result) => {
489+
assert.equal(result.response.statusCode, 200);
490+
});
491+
});
492+
});
493+
});
462494
});

testData/4pagesPdfA.pdf

585 KB
Binary file not shown.

0 commit comments

Comments
 (0)