|
1 |
| - /** |
| 1 | + /** |
2 | 2 | *
|
3 | 3 | * Copyright (c) 2024 Aspose.PDF Cloud
|
4 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
@@ -135,6 +135,8 @@ import { TimestampSettings } from "../models/timestampSettings";
|
135 | 135 | import { VerticalAlignment } from "../models/verticalAlignment";
|
136 | 136 | import { WordCount } from "../models/wordCount";
|
137 | 137 | import { WrapMode } from "../models/wrapMode";
|
| 138 | +import { XmpMetadata } from "../models/xmpMetadata"; |
| 139 | +import { XmpMetadataProperty } from "../models/xmpMetadataProperty"; |
138 | 140 | import { Annotation } from "../models/annotation";
|
139 | 141 | import { AnnotationsInfo } from "../models/annotationsInfo";
|
140 | 142 | import { AnnotationsInfoResponse } from "../models/annotationsInfoResponse";
|
@@ -11509,6 +11511,120 @@ export class PdfApi {
|
11509 | 11511 | }
|
11510 | 11512 |
|
11511 | 11513 |
|
| 11514 | + /** |
| 11515 | + * |
| 11516 | + * @summary Gets document XMP Metadata as JSON. |
| 11517 | + * @param name The document name. |
| 11518 | + * @param folder The document folder. |
| 11519 | + * @param storage The document storage. |
| 11520 | + * @param passBase64 The password (Base64). |
| 11521 | + */ |
| 11522 | + public async getXmpMetadataJson (name: string, folder?: string, storage?: string, passBase64?: string) : Promise<{ response: http.IncomingMessage; body: XmpMetadata; }> { |
| 11523 | + const localVarPath = this.basePath + '/pdf/{name}/xmpmetadata/json' |
| 11524 | + .replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/')); |
| 11525 | + let localVarQueryParameters: any = {}; |
| 11526 | + let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders); |
| 11527 | + let localVarFormParams: any = {}; |
| 11528 | + |
| 11529 | + // verify required parameter 'name' is not null or undefined |
| 11530 | + if (name === null || name === undefined) { |
| 11531 | + throw new Error('Required parameter name was null or undefined when calling getXmpMetadataJson.'); |
| 11532 | + } |
| 11533 | + |
| 11534 | + if (folder !== undefined && null !== folder) { |
| 11535 | + localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string"); |
| 11536 | + } |
| 11537 | + |
| 11538 | + if (storage !== undefined && null !== storage) { |
| 11539 | + localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string"); |
| 11540 | + } |
| 11541 | + |
| 11542 | + if (passBase64 !== undefined && null !== passBase64) { |
| 11543 | + localVarQueryParameters['passBase64'] = ObjectSerializer.serialize(passBase64, "string"); |
| 11544 | + } |
| 11545 | + |
| 11546 | + |
| 11547 | + let localVarUseFormData = false; |
| 11548 | + let fileData = null; |
| 11549 | + let localVarRequestOptions: localVarRequest.Options = { |
| 11550 | + method: 'GET', |
| 11551 | + qs: localVarQueryParameters, |
| 11552 | + headers: localVarHeaderParams, |
| 11553 | + uri: localVarPath, |
| 11554 | + useQuerystring: this._useQuerystring, |
| 11555 | + json: true, |
| 11556 | + }; |
| 11557 | + |
| 11558 | + if (Object.keys(localVarFormParams).length) { |
| 11559 | + if (localVarUseFormData) { |
| 11560 | + (<any>localVarRequestOptions).formData = localVarFormParams; |
| 11561 | + } else { |
| 11562 | + localVarRequestOptions.form = localVarFormParams; |
| 11563 | + } |
| 11564 | + } |
| 11565 | + const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData); |
| 11566 | + const result = ObjectSerializer.deserialize(response.body, "XmpMetadata"); |
| 11567 | + return Promise.resolve({body: result, response}); |
| 11568 | + } |
| 11569 | + |
| 11570 | + |
| 11571 | + /** |
| 11572 | + * |
| 11573 | + * @summary Gets document XMP Metadata as XML file. |
| 11574 | + * @param name The document name. |
| 11575 | + * @param folder The document folder. |
| 11576 | + * @param storage The document storage. |
| 11577 | + * @param passBase64 The password (Base64). |
| 11578 | + */ |
| 11579 | + public async getXmpMetadataXml (name: string, folder?: string, storage?: string, passBase64?: string) : Promise<{ response: http.IncomingMessage; body: Buffer; }> { |
| 11580 | + const localVarPath = this.basePath + '/pdf/{name}/xmpmetadata/xml' |
| 11581 | + .replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/')); |
| 11582 | + let localVarQueryParameters: any = {}; |
| 11583 | + let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders); |
| 11584 | + let localVarFormParams: any = {}; |
| 11585 | + |
| 11586 | + // verify required parameter 'name' is not null or undefined |
| 11587 | + if (name === null || name === undefined) { |
| 11588 | + throw new Error('Required parameter name was null or undefined when calling getXmpMetadataXml.'); |
| 11589 | + } |
| 11590 | + |
| 11591 | + if (folder !== undefined && null !== folder) { |
| 11592 | + localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string"); |
| 11593 | + } |
| 11594 | + |
| 11595 | + if (storage !== undefined && null !== storage) { |
| 11596 | + localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string"); |
| 11597 | + } |
| 11598 | + |
| 11599 | + if (passBase64 !== undefined && null !== passBase64) { |
| 11600 | + localVarQueryParameters['passBase64'] = ObjectSerializer.serialize(passBase64, "string"); |
| 11601 | + } |
| 11602 | + |
| 11603 | + |
| 11604 | + let localVarUseFormData = false; |
| 11605 | + let fileData = null; |
| 11606 | + let localVarRequestOptions: localVarRequest.Options = { |
| 11607 | + method: 'GET', |
| 11608 | + qs: localVarQueryParameters, |
| 11609 | + headers: localVarHeaderParams, |
| 11610 | + uri: localVarPath, |
| 11611 | + useQuerystring: this._useQuerystring, |
| 11612 | + encoding: null, |
| 11613 | + }; |
| 11614 | + |
| 11615 | + if (Object.keys(localVarFormParams).length) { |
| 11616 | + if (localVarUseFormData) { |
| 11617 | + (<any>localVarRequestOptions).formData = localVarFormParams; |
| 11618 | + } else { |
| 11619 | + localVarRequestOptions.form = localVarFormParams; |
| 11620 | + } |
| 11621 | + } |
| 11622 | + const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData); |
| 11623 | + const result = ObjectSerializer.deserialize(response.body, "Buffer"); |
| 11624 | + return Promise.resolve({body: result, response}); |
| 11625 | + } |
| 11626 | + |
| 11627 | + |
11512 | 11628 | /**
|
11513 | 11629 | *
|
11514 | 11630 | * @summary Convert XPS file (located on storage) to PDF format and return resulting file in response.
|
@@ -16074,6 +16190,70 @@ export class PdfApi {
|
16074 | 16190 | }
|
16075 | 16191 |
|
16076 | 16192 |
|
| 16193 | + /** |
| 16194 | + * |
| 16195 | + * @summary Add or remove XMP Metadata properties. |
| 16196 | + * @param name The document name. |
| 16197 | + * @param metadata XmpMetadata instance. |
| 16198 | + * @param folder The document folder. |
| 16199 | + * @param storage The document storage. |
| 16200 | + * @param passBase64 The password (Base64). |
| 16201 | + */ |
| 16202 | + public async postXmpMetadata (name: string, metadata: XmpMetadata, folder?: string, storage?: string, passBase64?: string) : Promise<{ response: http.IncomingMessage; body: AsposeResponse; }> { |
| 16203 | + const localVarPath = this.basePath + '/pdf/{name}/xmpmetadata' |
| 16204 | + .replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/')); |
| 16205 | + let localVarQueryParameters: any = {}; |
| 16206 | + let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders); |
| 16207 | + let localVarFormParams: any = {}; |
| 16208 | + |
| 16209 | + // verify required parameter 'name' is not null or undefined |
| 16210 | + if (name === null || name === undefined) { |
| 16211 | + throw new Error('Required parameter name was null or undefined when calling postXmpMetadata.'); |
| 16212 | + } |
| 16213 | + |
| 16214 | + // verify required parameter 'metadata' is not null or undefined |
| 16215 | + if (metadata === null || metadata === undefined) { |
| 16216 | + throw new Error('Required parameter metadata was null or undefined when calling postXmpMetadata.'); |
| 16217 | + } |
| 16218 | + |
| 16219 | + if (folder !== undefined && null !== folder) { |
| 16220 | + localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string"); |
| 16221 | + } |
| 16222 | + |
| 16223 | + if (storage !== undefined && null !== storage) { |
| 16224 | + localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string"); |
| 16225 | + } |
| 16226 | + |
| 16227 | + if (passBase64 !== undefined && null !== passBase64) { |
| 16228 | + localVarQueryParameters['passBase64'] = ObjectSerializer.serialize(passBase64, "string"); |
| 16229 | + } |
| 16230 | + |
| 16231 | + |
| 16232 | + let localVarUseFormData = false; |
| 16233 | + let fileData = null; |
| 16234 | + let localVarRequestOptions: localVarRequest.Options = { |
| 16235 | + method: 'POST', |
| 16236 | + qs: localVarQueryParameters, |
| 16237 | + headers: localVarHeaderParams, |
| 16238 | + uri: localVarPath, |
| 16239 | + useQuerystring: this._useQuerystring, |
| 16240 | + json: true, |
| 16241 | + body: ObjectSerializer.serialize(metadata, "XmpMetadata") |
| 16242 | + }; |
| 16243 | + |
| 16244 | + if (Object.keys(localVarFormParams).length) { |
| 16245 | + if (localVarUseFormData) { |
| 16246 | + (<any>localVarRequestOptions).formData = localVarFormParams; |
| 16247 | + } else { |
| 16248 | + localVarRequestOptions.form = localVarFormParams; |
| 16249 | + } |
| 16250 | + } |
| 16251 | + const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData); |
| 16252 | + const result = ObjectSerializer.deserialize(response.body, "AsposeResponse"); |
| 16253 | + return Promise.resolve({body: result, response}); |
| 16254 | + } |
| 16255 | + |
| 16256 | + |
16077 | 16257 | /**
|
16078 | 16258 | *
|
16079 | 16259 | * @summary Add new page to end of the document.
|
|
0 commit comments