Skip to content

Commit 4d2ce97

Browse files
committed
Update to v20.1
1 parent 7d0a0bc commit 4d2ce97

File tree

7 files changed

+257
-4
lines changed

7 files changed

+257
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ Class | Method | HTTP request | Description
295295
*PdfApi* | [**postPageUnderlineAnnotations**](docs/PdfApi.md#postPageUnderlineAnnotations) | **POST** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Add document page underline annotations.
296296
*PdfApi* | [**postPopupAnnotation**](docs/PdfApi.md#postPopupAnnotation) | **POST** /pdf/\{name}/annotations/\{annotationId}/popup | Add document popup annotations.
297297
*PdfApi* | [**postRadioButtonFields**](docs/PdfApi.md#postRadioButtonFields) | **POST** /pdf/\{name}/fields/radiobutton | Add document RadioButton fields.
298+
*PdfApi* | [**postSignatureField**](docs/PdfApi.md#postSignatureField) | **POST** /pdf/\{name}/fields/signature | Add document signature field.
298299
*PdfApi* | [**postSignDocument**](docs/PdfApi.md#postSignDocument) | **POST** /pdf/\{name}/sign | Sign document.
299300
*PdfApi* | [**postSignPage**](docs/PdfApi.md#postSignPage) | **POST** /pdf/\{name}/pages/\{pageNumber}/sign | Sign page.
300301
*PdfApi* | [**postSplitDocument**](docs/PdfApi.md#postSplitDocument) | **POST** /pdf/\{name}/split | Split document to parts.
@@ -389,6 +390,7 @@ Class | Method | HTTP request | Description
389390
*PdfApi* | [**putScreenAnnotationDataExtract**](docs/PdfApi.md#putScreenAnnotationDataExtract) | **PUT** /pdf/\{name}/annotations/screen/\{annotationId}/data/extract | Extract document screen annotation content to storage
390391
*PdfApi* | [**putSearchableDocument**](docs/PdfApi.md#putSearchableDocument) | **PUT** /pdf/\{name}/ocr | Create searchable PDF document. Generate OCR layer for images in input PDF document.
391392
*PdfApi* | [**putSetProperty**](docs/PdfApi.md#putSetProperty) | **PUT** /pdf/\{name}/documentproperties/\{propertyName} | Add/update document property.
393+
*PdfApi* | [**putSignatureField**](docs/PdfApi.md#putSignatureField) | **PUT** /pdf/\{name}/fields/signature/\{fieldName} | Replace document signature field.
392394
*PdfApi* | [**putSoundAnnotation**](docs/PdfApi.md#putSoundAnnotation) | **PUT** /pdf/\{name}/annotations/sound/\{annotationId} | Replace document sound annotation
393395
*PdfApi* | [**putSoundAnnotationDataExtract**](docs/PdfApi.md#putSoundAnnotationDataExtract) | **PUT** /pdf/\{name}/annotations/sound/\{annotationId}/data/extract | Extract document sound annotation content to storage
394396
*PdfApi* | [**putSquareAnnotation**](docs/PdfApi.md#putSquareAnnotation) | **PUT** /pdf/\{name}/annotations/square/\{annotationId} | Replace document square annotation

docs/PdfApi.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ Method | HTTP request | Description
241241
*PdfApi* | [**postPageUnderlineAnnotations**](PdfApi.md#postPageUnderlineAnnotations) | **POST** /pdf/\{name}/pages/\{pageNumber}/annotations/underline | Add document page underline annotations.
242242
*PdfApi* | [**postPopupAnnotation**](PdfApi.md#postPopupAnnotation) | **POST** /pdf/\{name}/annotations/\{annotationId}/popup | Add document popup annotations.
243243
*PdfApi* | [**postRadioButtonFields**](PdfApi.md#postRadioButtonFields) | **POST** /pdf/\{name}/fields/radiobutton | Add document RadioButton fields.
244+
*PdfApi* | [**postSignatureField**](PdfApi.md#postSignatureField) | **POST** /pdf/\{name}/fields/signature | Add document signature field.
244245
*PdfApi* | [**postSignDocument**](PdfApi.md#postSignDocument) | **POST** /pdf/\{name}/sign | Sign document.
245246
*PdfApi* | [**postSignPage**](PdfApi.md#postSignPage) | **POST** /pdf/\{name}/pages/\{pageNumber}/sign | Sign page.
246247
*PdfApi* | [**postSplitDocument**](PdfApi.md#postSplitDocument) | **POST** /pdf/\{name}/split | Split document to parts.
@@ -335,6 +336,7 @@ Method | HTTP request | Description
335336
*PdfApi* | [**putScreenAnnotationDataExtract**](PdfApi.md#putScreenAnnotationDataExtract) | **PUT** /pdf/\{name}/annotations/screen/\{annotationId}/data/extract | Extract document screen annotation content to storage
336337
*PdfApi* | [**putSearchableDocument**](PdfApi.md#putSearchableDocument) | **PUT** /pdf/\{name}/ocr | Create searchable PDF document. Generate OCR layer for images in input PDF document.
337338
*PdfApi* | [**putSetProperty**](PdfApi.md#putSetProperty) | **PUT** /pdf/\{name}/documentproperties/\{propertyName} | Add/update document property.
339+
*PdfApi* | [**putSignatureField**](PdfApi.md#putSignatureField) | **PUT** /pdf/\{name}/fields/signature/\{fieldName} | Replace document signature field.
338340
*PdfApi* | [**putSoundAnnotation**](PdfApi.md#putSoundAnnotation) | **PUT** /pdf/\{name}/annotations/sound/\{annotationId} | Replace document sound annotation
339341
*PdfApi* | [**putSoundAnnotationDataExtract**](PdfApi.md#putSoundAnnotationDataExtract) | **PUT** /pdf/\{name}/annotations/sound/\{annotationId}/data/extract | Extract document sound annotation content to storage
340342
*PdfApi* | [**putSquareAnnotation**](PdfApi.md#putSquareAnnotation) | **PUT** /pdf/\{name}/annotations/square/\{annotationId} | Replace document square annotation
@@ -5889,6 +5891,29 @@ Name | Type | Description | Notes
58895891

58905892
[**AsposeResponse**](AsposeResponse.md)
58915893

5894+
### HTTP request headers
5895+
5896+
- **Content-Type**: application/json
5897+
- **Accept**: application/json
5898+
5899+
<a name="postSignatureField"></a>
5900+
## **postSignatureField**
5901+
> postSignatureField(name, field, storage, folder)
5902+
5903+
Add document signature field.
5904+
5905+
### Parameters
5906+
Name | Type | Description | Notes
5907+
------------- | ------------- | ------------- | -------------
5908+
**name** | **string** | The document name. |
5909+
**field** | [**SignatureField**](SignatureField.md) | The field. |
5910+
**storage** | **string** | The document storage. | [optional]
5911+
**folder** | **string** | The document folder. | [optional]
5912+
5913+
### Return type
5914+
5915+
[**AsposeResponse**](AsposeResponse.md)
5916+
58925917
### HTTP request headers
58935918

58945919
- **Content-Type**: application/json
@@ -8252,6 +8277,30 @@ Name | Type | Description | Notes
82528277

82538278
[**DocumentPropertyResponse**](DocumentPropertyResponse.md)
82548279

8280+
### HTTP request headers
8281+
8282+
- **Content-Type**: application/json
8283+
- **Accept**: application/json
8284+
8285+
<a name="putSignatureField"></a>
8286+
## **putSignatureField**
8287+
> putSignatureField(name, fieldName, field, storage, folder)
8288+
8289+
Replace document signature field.
8290+
8291+
### Parameters
8292+
Name | Type | Description | Notes
8293+
------------- | ------------- | ------------- | -------------
8294+
**name** | **string** | The document name. |
8295+
**fieldName** | **string** | The field name. |
8296+
**field** | [**SignatureField**](SignatureField.md) | The field. |
8297+
**storage** | **string** | The document storage. | [optional]
8298+
**folder** | **string** | The document folder. | [optional]
8299+
8300+
### Return type
8301+
8302+
[**SignatureFieldResponse**](SignatureFieldResponse.md)
8303+
82558304
### HTTP request headers
82568305

82578306
- **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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "asposepdfcloud",
3-
"version": "19.12.0",
3+
"version": "20.1.0",
44
"description": "Aspose.PDF Cloud SDK",
55
"homepage": "https://products.aspose.cloud/pdf/cloud",
66
"author": {

src/api/api.ts

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14953,6 +14953,65 @@ export class PdfApi {
1495314953
}
1495414954

1495514955

14956+
/**
14957+
*
14958+
* @summary Add document signature field.
14959+
* @param name The document name.
14960+
* @param field The field.
14961+
* @param storage The document storage.
14962+
* @param folder The document folder.
14963+
*/
14964+
public async postSignatureField (name: string, field: SignatureField, storage?: string, folder?: string) : Promise<{ response: http.IncomingMessage; body: AsposeResponse; }> {
14965+
const localVarPath = this.basePath + '/pdf/{name}/fields/signature'
14966+
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'));
14967+
let localVarQueryParameters: any = {};
14968+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
14969+
let localVarFormParams: any = {};
14970+
14971+
// verify required parameter 'name' is not null or undefined
14972+
if (name === null || name === undefined) {
14973+
throw new Error('Required parameter name was null or undefined when calling postSignatureField.');
14974+
}
14975+
14976+
// verify required parameter 'field' is not null or undefined
14977+
if (field === null || field === undefined) {
14978+
throw new Error('Required parameter field was null or undefined when calling postSignatureField.');
14979+
}
14980+
14981+
if (storage !== undefined && null !== storage) {
14982+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
14983+
}
14984+
14985+
if (folder !== undefined && null !== folder) {
14986+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
14987+
}
14988+
14989+
14990+
let localVarUseFormData = false;
14991+
let fileData = null;
14992+
let localVarRequestOptions: localVarRequest.Options = {
14993+
method: 'POST',
14994+
qs: localVarQueryParameters,
14995+
headers: localVarHeaderParams,
14996+
uri: localVarPath,
14997+
useQuerystring: this._useQuerystring,
14998+
json: true,
14999+
body: ObjectSerializer.serialize(field, "SignatureField")
15000+
};
15001+
15002+
if (Object.keys(localVarFormParams).length) {
15003+
if (localVarUseFormData) {
15004+
(<any>localVarRequestOptions).formData = localVarFormParams;
15005+
} else {
15006+
localVarRequestOptions.form = localVarFormParams;
15007+
}
15008+
}
15009+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
15010+
const result = ObjectSerializer.deserialize(response.body, "AsposeResponse");
15011+
return Promise.resolve({body: result, response});
15012+
}
15013+
15014+
1495615015
/**
1495715016
*
1495815017
* @summary Split document to parts.
@@ -21641,6 +21700,72 @@ export class PdfApi {
2164121700
}
2164221701

2164321702

21703+
/**
21704+
*
21705+
* @summary Replace document signature field.
21706+
* @param name The document name.
21707+
* @param fieldName The field name.
21708+
* @param field The field.
21709+
* @param storage The document storage.
21710+
* @param folder The document folder.
21711+
*/
21712+
public async putSignatureField (name: string, fieldName: string, field: SignatureField, storage?: string, folder?: string) : Promise<{ response: http.IncomingMessage; body: SignatureFieldResponse; }> {
21713+
const localVarPath = this.basePath + '/pdf/{name}/fields/signature/{fieldName}'
21714+
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'))
21715+
.replace('{' + 'fieldName' + '}', encodeURIComponent(String(fieldName)).replace('%2F', '/'));
21716+
let localVarQueryParameters: any = {};
21717+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
21718+
let localVarFormParams: any = {};
21719+
21720+
// verify required parameter 'name' is not null or undefined
21721+
if (name === null || name === undefined) {
21722+
throw new Error('Required parameter name was null or undefined when calling putSignatureField.');
21723+
}
21724+
21725+
// verify required parameter 'fieldName' is not null or undefined
21726+
if (fieldName === null || fieldName === undefined) {
21727+
throw new Error('Required parameter fieldName was null or undefined when calling putSignatureField.');
21728+
}
21729+
21730+
// verify required parameter 'field' is not null or undefined
21731+
if (field === null || field === undefined) {
21732+
throw new Error('Required parameter field was null or undefined when calling putSignatureField.');
21733+
}
21734+
21735+
if (storage !== undefined && null !== storage) {
21736+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
21737+
}
21738+
21739+
if (folder !== undefined && null !== folder) {
21740+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
21741+
}
21742+
21743+
21744+
let localVarUseFormData = false;
21745+
let fileData = null;
21746+
let localVarRequestOptions: localVarRequest.Options = {
21747+
method: 'PUT',
21748+
qs: localVarQueryParameters,
21749+
headers: localVarHeaderParams,
21750+
uri: localVarPath,
21751+
useQuerystring: this._useQuerystring,
21752+
json: true,
21753+
body: ObjectSerializer.serialize(field, "SignatureField")
21754+
};
21755+
21756+
if (Object.keys(localVarFormParams).length) {
21757+
if (localVarUseFormData) {
21758+
(<any>localVarRequestOptions).formData = localVarFormParams;
21759+
} else {
21760+
localVarRequestOptions.form = localVarFormParams;
21761+
}
21762+
}
21763+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
21764+
const result = ObjectSerializer.deserialize(response.body, "SignatureFieldResponse");
21765+
return Promise.resolve({body: result, response});
21766+
}
21767+
21768+
2164421769
/**
2164521770
*
2164621771
* @summary Replace document sound annotation

test/baseTestPdfApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright (c) 2019 Aspose.Pdf for Cloud
3+
* Copyright (c) 2020 Aspose.Pdf for Cloud
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
66
* in the Software without restriction, including without limitation the rights

test/testFields.ts

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright (c) 2019 Aspose.Pdf for Cloud
3+
* Copyright (c) 2020 Aspose.Pdf for Cloud
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
66
* in the Software without restriction, including without limitation the rights
@@ -31,6 +31,9 @@ import { RadioButtonOptionField } from "../src/models/radioButtonOptionField";
3131
import { Option } from "../src/models/option";
3232
import { ComboBoxField } from "../src/models/comboBoxField";
3333
import { ListBoxField } from "../src/models/listBoxField";
34+
import { Signature } from "../src/models/signature";
35+
import { SignatureType } from "../src/models/signatureType";
36+
import { SignatureField } from "../src/models/signatureField";
3437
var assert = require('assert');
3538

3639
describe("Fields Tests", () => {
@@ -239,6 +242,80 @@ describe("Fields Tests", () => {
239242
});
240243
});
241244
});
245+
246+
describe("PostSignatureField Test", () => {
247+
248+
it("should return response with code 200", async () => {
249+
250+
const name = "4pages.pdf";
251+
await BaseTest.uploadFile(name);
252+
253+
const signatureFileName = "33226.p12";
254+
await BaseTest.uploadFile(signatureFileName);
255+
256+
257+
const sign = new Signature();
258+
sign.authority = "Sergey Smal";
259+
sign.contact = "test@mail.ru"
260+
sign.date = "08/01/2012 12:15:00.000 PM";
261+
sign.formFieldName = "Signature1";
262+
sign.location = "Ukraine";
263+
sign.password = "sIikZSmz";
264+
sign.rectangle = { lLX: 100, lLY: 100, uRX: 0, uRY: 0 };
265+
sign.signaturePath = BaseTest.remoteTempFolder + "/" + signatureFileName;
266+
sign.signatureType = SignatureType.PKCS7;
267+
sign.visible = true;
268+
sign.showProperties = false;
269+
270+
const field = new SignatureField();
271+
field.pageIndex = 1;
272+
field.partialName = "sign1";
273+
field.signature = sign;
274+
field.rect = { lLX: 100, lLY: 100, uRX: 0, uRY: 0 };
275+
276+
return BaseTest.getPdfApi().postSignatureField(name, field, null, BaseTest.remoteTempFolder)
277+
.then((result) => {
278+
assert.equal(result.response.statusCode, 200);
279+
});
280+
});
281+
});
282+
283+
describe("PutSignatureField Test", () => {
284+
285+
it("should return response with code 200", async () => {
286+
287+
const name = "adbe.x509.rsa_sha1.valid.pdf";
288+
await BaseTest.uploadFile(name);
289+
290+
const signatureFileName = "33226.p12";
291+
await BaseTest.uploadFile(signatureFileName);
292+
293+
294+
const sign = new Signature();
295+
sign.authority = "Sergey Smal";
296+
sign.contact = "test@mail.ru"
297+
sign.date = "08/01/2012 12:15:00.000 PM";
298+
sign.formFieldName = "Signature1";
299+
sign.location = "Ukraine";
300+
sign.password = "sIikZSmz";
301+
sign.rectangle = { lLX: 100, lLY: 100, uRX: 0, uRY: 0 };
302+
sign.signaturePath = BaseTest.remoteTempFolder + "/" + signatureFileName;
303+
sign.signatureType = SignatureType.PKCS7;
304+
sign.visible = true;
305+
sign.showProperties = false;
306+
307+
const field = new SignatureField();
308+
field.pageIndex = 1;
309+
field.partialName = "sign1";
310+
field.signature = sign;
311+
field.rect = { lLX: 100, lLY: 100, uRX: 0, uRY: 0 };
312+
313+
return BaseTest.getPdfApi().putSignatureField(name, "Signature1", field, null, BaseTest.remoteTempFolder)
314+
.then((result) => {
315+
assert.equal(result.response.statusCode, 200);
316+
});
317+
});
318+
});
242319
});
243320

244321
describe("TextBoxField Tests", () => {

0 commit comments

Comments
 (0)